Skip to content
Snippets Groups Projects
Commit 2ff3b6e6 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by Matthew Andrew
Browse files

Create a blank user config file before running tests

Previously we only removed the properties file but some tests
could touch other parts of the user config so remove it all
and create a blank file to ensure the environment is clean.
Refs #22063

(cherry picked from commit 07c1513f)
parent 72a06cb9
No related merge requests found
......@@ -280,9 +280,11 @@ fi
###############################################################################
# Run the unit tests
###############################################################################
# Remove any Mantid.user.properties file
userprops=~/.mantid/Mantid.user.properties
rm -f $userprops
# Prevent race conditions when creating the user config directory
userconfig_dir=$HOME/.mantid
rm -fr $userconfig_dir
mkdir -p $userconfig_dir
touch $userconfig_dir/Mantid.user.properties
$CTEST_EXE -j${BUILD_THREADS:?} --schedule-random --output-on-failure
###############################################################################
......
......@@ -157,10 +157,14 @@ if ERRORLEVEL 1 exit /B %ERRORLEVEL%
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Run the tests
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Remove the user properties file just in case anything polluted it
:: Remove any user configuration and create a blank user properties file
:: This prevents race conditions when creating the user config directory
set USERPROPS=bin\%BUILD_CONFIG%\Mantid.user.properties
del %USERPROPS%
set CONFIGDIR=%APPDATA%\mantidproject\mantid
rmdir /S /Q %CONFIGDIR%
mkdir %CONFIGDIR%
call cmake.exe -E touch %USERPROPS%
call ctest.exe -C %BUILD_CONFIG% -j%BUILD_THREADS% --schedule-random --output-on-failure
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment