From c474a45f24f7e134b68b1e415129c8869fd070d6 Mon Sep 17 00:00:00 2001 From: DonaldChung-HK Date: Fri, 9 Dec 2022 16:38:27 +0000 Subject: [PATCH 01/27] Example for migrating system test to ctest --- CMakeLists.txt | 5 ++ .../scripts/systemtest_no_update.bat.in | 77 +++++++++++++++++++ .../scripts/systemtest_no_update.in | 75 ++++++++++++++++++ buildconfig/CMake/PyUnitTest.cmake | 20 +++++ 4 files changed, 177 insertions(+) create mode 100644 Testing/SystemTests/scripts/systemtest_no_update.bat.in create mode 100755 Testing/SystemTests/scripts/systemtest_no_update.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f8fd1fdc42d..70973260b4c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,5 +225,10 @@ if(COVERAGE) coverage_setup(${SRCS_FILENAME} OFF "${CMAKE_SOURCE_DIR}/buildconfig/CMake") endif() +# adding system test to it +set(SYSTEST_NAMES AbinsTest.AbinsCRYSTAL2D AbinsTest.AbinsCRYSTALTestScratch) +# function to add system test +pysystemtest_add_test(${SYSTEST_NAMES}) + # THIS MUST BE THE LAST SUB_DIRECTORY ADDED. See Framework/PostInstall/CMakeLists for an explanation add_subdirectory(Framework/PostInstall) diff --git a/Testing/SystemTests/scripts/systemtest_no_update.bat.in b/Testing/SystemTests/scripts/systemtest_no_update.bat.in new file mode 100644 index 000000000000..1b667fd1491c --- /dev/null +++ b/Testing/SystemTests/scripts/systemtest_no_update.bat.in @@ -0,0 +1,77 @@ +:: Mantid Repository : https://github.com/mantidproject/mantid +:: +:: Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, +:: NScD Oak Ridge National Laboratory, European Spallation Source, +:: Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS +:: SPDX - License - Identifier: GPL - 3.0 + +@echo off +:: Wrapper script to launch the system tests for a development build. +:: +:: It uses the python, with the mantid framework on the pythonpath, to run the tests. +:: All arguments to this script are forwarded to the test runner. + +set PYTHON_EXE=@PYTHON_EXECUTABLE@ +set RUNNER_SCRIPT=@SYSTEMTESTS_RUNNER_SCRIPT@ +set MULTI_CONFIG_GENERATOR=@MULTI_CONFIG_GENERATOR@ +set BIN_DIR=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ + + +:: Print usage +if [%1]==[-h] ( + goto usage + goto end +) + +:: Are there enough arguments +if "%MULTI_CONFIG_GENERATOR%" == "true" ( + if [%1] EQU [-C] ( + if [%2] NEQ [] ( + set PYTHONPATH=%PYTHONPATH%;%BIN_DIR%\%2\ + ) else ( + echo -C requires a config argument + echo. + echo Use -h for full usage + goto error + ) + ) else ( + echo Multi-configuration build requires -C ^ to specify test configuration + echo. + echo Use -h for full usage + goto error + ) +) else ( + if [%1] EQU [-C] ( + echo Ninja builds do not require you to specify a configuration -C. + echo. + echo Use -h for full usage + goto error + ) else ( + set PYTHONPATH=%PYTHONPATH%;%BIN_DIR%\ + ) +) + +:: Execute +echo. +echo Running tests... +if "%MULTI_CONFIG_GENERATOR%" == "true" ( + %PYTHON_EXE% %RUNNER_SCRIPT% --executable=%PYTHON_EXE% --exec-args= %3 %4 %5 %6 %7 %8 %9 +) else ( + %PYTHON_EXE% %RUNNER_SCRIPT% --executable=%PYTHON_EXE% --exec-args= %1 %2 %3 %4 %5 %6 %7 +) +goto end + +:: -------- Functions --------- + +:usage +echo systemtest.bat -C ^ ^[arg1^] ^[arg2^] ... +echo. +echo ^ is one ^[Release^|Debug^|RelWithDebInfo^|DebugWithRelRuntime^|MinSizeRelease^] +echo All arguments after ^ are passed to the runSystemTest.py script +%PYTHON_EXE% %RUNNER_SCRIPT% -h +goto:eof + +:end +exit /b 0 + +:error +exit /b 1 diff --git a/Testing/SystemTests/scripts/systemtest_no_update.in b/Testing/SystemTests/scripts/systemtest_no_update.in new file mode 100755 index 000000000000..84bca029af15 --- /dev/null +++ b/Testing/SystemTests/scripts/systemtest_no_update.in @@ -0,0 +1,75 @@ +#!/bin/bash +# Mantid Repository : https://github.com/mantidproject/mantid +# +# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, +# NScD Oak Ridge National Laboratory, European Spallation Source, +# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS +# SPDX - License - Identifier: GPL - 3.0 + +# Wrapper script to launch the system tests for a development build. +# +# It uses the python launch script to run the tests. All arguments to +# this script are forwarded to the test runner. + +@JEMALLOC_DEFINITIONS@ + +PYTHON_EXE=@PYTHON_EXECUTABLE@ +RUNNER_SCRIPT=@SYSTEMTESTS_RUNNER_SCRIPT@ +MULTI_CONFIG_GENERATOR=@MULTI_CONFIG_GENERATOR@ +BIN_DIR=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ + +function usage() { + if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then + echo "systemtest -C [arg1] [arg2] ..." + echo + echo " is one [Release|Debug|RelWithDebInfo|MinSizeRelease]" + echo "All arguments after are passed to the runSystemTest.py script" + else + echo "systemtest [arg1] [arg2] ..." + echo + echo "All arguments are passed to the runSystemTest.py script" + fi + $PYTHON_EXE $RUNNER_SCRIPT -h +} + +# Sets the LOACL_PYTHONPATH variable +function setup_python_path() { + if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then + if [ "$1" == "-C" ]; then + if [ -n "$2" ]; then + LOCAL_PYTHONPATH=$BIN_DIR/$2/ + else + echo "-C requires a config argument" + usage + exit 1 + fi + else + echo "Multi-configuration build requires -C to specify test configuration" + usage + exit 1 + fi + else + LOCAL_PYTHONPATH=$BIN_DIR/ + fi +} + +if [ "$1" == "-h" ]; then + usage + exit 0 +fi + +# For multi-config generators the bin folder has a config-dependent subdirectory +LOCAL_PYTHONPATH="" +setup_python_path $1 $2 +CMAKE_TARGET_ARG="" +if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then + shift 2 + CMAKE_TARGET_ARG="-target" +fi + +# Execute +echo +echo "Running tests..." +LD_PRELOAD=${LOCAL_PRELOAD} \ + PYTHONPATH=${LOCAL_PYTHONPATH} \ + python3 $RUNNER_SCRIPT \ + --executable="python3" --exec-args= "$@" diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index c96144e2a61b..f9d053e3e5a4 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -70,6 +70,26 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) endforeach(part ${ARGN}) endfunction() +# PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module +# This add the named system test and reun the individually + +function(PYSYSTEMTEST_ADD_TEST) + + # Add all of the individual tests so that they can be run in parallel + foreach(part ${ARGN}) + set(_test_name ${part}) + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + add_test(NAME ${_test_name} COMMAND systemtest_no_update.bat -R ${_test_name}) + else() + add_test(NAME ${_test_name} COMMAND systemtest_no_update -R ${_test_name}) + endif() + + if(PYUNITTEST_RUN_SERIAL) + set_tests_properties(${_pyunit_separate_name} PROPERTIES RUN_SERIAL 1) + endif() + endforeach(part ${ARGN}) +endfunction() + # Defines a macro to check that each file contains a call to unittest.main() The arguments should be the source # directory followed by the test files as list, e.g. check_tests_valid ( ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_FILES} ) # From 1511ddc6c1b4c2ad0c7872515a58ae03c6652d6a Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Thu, 7 Nov 2024 13:01:24 +0000 Subject: [PATCH 02/27] Fix no-update script not being generated RE #34850 --- Testing/SystemTests/scripts/CMakeLists.txt | 7 +++++++ buildconfig/CMake/PyUnitTest.cmake | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Testing/SystemTests/scripts/CMakeLists.txt b/Testing/SystemTests/scripts/CMakeLists.txt index 6b6d284366b0..3c938a477861 100644 --- a/Testing/SystemTests/scripts/CMakeLists.txt +++ b/Testing/SystemTests/scripts/CMakeLists.txt @@ -38,3 +38,10 @@ if(MSVC) else() configure_file(${CMAKE_CURRENT_LIST_DIR}/systemtest.in ${CMAKE_BINARY_DIR}/systemtest @ONLY) endif() +if(MSVC) + configure_file( + ${CMAKE_CURRENT_LIST_DIR}/systemtest_no_update.bat.in ${CMAKE_BINARY_DIR}/systemtest_no_update.bat @ONLY + ) +else() + configure_file(${CMAKE_CURRENT_LIST_DIR}/systemtest_no_update.in ${CMAKE_BINARY_DIR}/systemtest_no_update @ONLY) +endif() diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index f9d053e3e5a4..6c228d21639d 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -71,7 +71,7 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) endfunction() # PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module -# This add the named system test and reun the individually +# This adds the named system test do they can be run individually function(PYSYSTEMTEST_ADD_TEST) From 18bd5e219a93a9343909996fc9d2eed9526ee6aa Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Fri, 8 Nov 2024 13:20:52 +0000 Subject: [PATCH 03/27] Add CMakeLists to qt Systest directory RE #34850 --- CMakeLists.txt | 3 ++- Testing/SystemTests/tests/CMakeLists.txt | 3 +++ Testing/SystemTests/tests/qt/CMakeLists.txt | 9 +++++++++ buildconfig/CMake/PyUnitTest.cmake | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 Testing/SystemTests/tests/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/qt/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 70973260b4c1..7ae0ede8728f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,8 +209,9 @@ if(ENABLE_DOCS) add_subdirectory(docs) endif() -# System test data target +# System test targets add_subdirectory(Testing/SystemTests/scripts) +add_subdirectory(Testing/SystemTests/tests) if(COVERAGE) get_property(ALL_SRCS GLOBAL PROPERTY COVERAGE_SRCS) diff --git a/Testing/SystemTests/tests/CMakeLists.txt b/Testing/SystemTests/tests/CMakeLists.txt new file mode 100644 index 000000000000..e6a177cc4cab --- /dev/null +++ b/Testing/SystemTests/tests/CMakeLists.txt @@ -0,0 +1,3 @@ +# System Test Subdirectories to be added to ctest. + +add_subdirectory(qt) diff --git a/Testing/SystemTests/tests/qt/CMakeLists.txt b/Testing/SystemTests/tests/qt/CMakeLists.txt new file mode 100644 index 000000000000..0c63434e791c --- /dev/null +++ b/Testing/SystemTests/tests/qt/CMakeLists.txt @@ -0,0 +1,9 @@ +# System Tests for the mantid qt package + +set(SYSTEST_NAMES CppInterfacesStartupTest FitScriptGeneratorStartupTest PythonInterfacesStartupTest + SliceViewerIntegrationTest WorkbenchStartupTest +) + +if(ENABLE_WORKBENCH) + pysystemtest_add_test(${SYSTEST_NAMES}) +endif() diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 6c228d21639d..6b7a2bab1f28 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -79,9 +79,9 @@ function(PYSYSTEMTEST_ADD_TEST) foreach(part ${ARGN}) set(_test_name ${part}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_test(NAME ${_test_name} COMMAND systemtest_no_update.bat -R ${_test_name}) + add_test(NAME SystemTest_${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name}) else() - add_test(NAME ${_test_name} COMMAND systemtest_no_update -R ${_test_name}) + add_test(NAME SystemTest_${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name}) endif() if(PYUNITTEST_RUN_SERIAL) From 86a9cce3c64e8c98c84bada70ada9de161683686 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Fri, 8 Nov 2024 17:01:52 +0000 Subject: [PATCH 04/27] Add framework system tests to CMake RE #34850 --- CMakeLists.txt | 5 - Testing/SystemTests/tests/CMakeLists.txt | 1 + .../tests/framework/CMakeLists.txt | 235 ++++++++++++++++++ .../tests/framework/ISIS/SANS/CMakeLists.txt | 11 + .../framework/ISIS/SANS/LARMOR/CMakeLists.txt | 7 + .../framework/ISIS/SANS/LOQ/CMakeLists.txt | 18 ++ .../framework/ISIS/SANS/SANS2D/CMakeLists.txt | 33 +++ .../ISIS/SANS/WORKFLOWS/CMakeLists.txt | 23 ++ .../framework/ISIS/SANS/ZOOM/CMakeLists.txt | 14 ++ .../PolarizationCorrections/CMakeLists.txt | 7 + 10 files changed, 349 insertions(+), 5 deletions(-) create mode 100644 Testing/SystemTests/tests/framework/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt create mode 100644 Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ae0ede8728f..9e49082b51c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,10 +226,5 @@ if(COVERAGE) coverage_setup(${SRCS_FILENAME} OFF "${CMAKE_SOURCE_DIR}/buildconfig/CMake") endif() -# adding system test to it -set(SYSTEST_NAMES AbinsTest.AbinsCRYSTAL2D AbinsTest.AbinsCRYSTALTestScratch) -# function to add system test -pysystemtest_add_test(${SYSTEST_NAMES}) - # THIS MUST BE THE LAST SUB_DIRECTORY ADDED. See Framework/PostInstall/CMakeLists for an explanation add_subdirectory(Framework/PostInstall) diff --git a/Testing/SystemTests/tests/CMakeLists.txt b/Testing/SystemTests/tests/CMakeLists.txt index e6a177cc4cab..8e0cb50440f6 100644 --- a/Testing/SystemTests/tests/CMakeLists.txt +++ b/Testing/SystemTests/tests/CMakeLists.txt @@ -1,3 +1,4 @@ # System Test Subdirectories to be added to ctest. +add_subdirectory(framework) add_subdirectory(qt) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt new file mode 100644 index 000000000000..f8b1a4c17b4e --- /dev/null +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -0,0 +1,235 @@ +# System tests for the Mantid Framework package. + +set(SYSTEST_NAMES + AbinsTest + AbsorptionCorrectionTest + AlgorithmDocumentationTest + AlgorithmMatrixWorkspaceValidateInputsTest + AlgorithmMDWorkspaceValidateInputsTest + AlgorithmTableWorkspaceValidateInputsTest + AlgorithmValidateInputsTestBase + AlgorithmWorkspaceGroupValidateInputsTest + AlignAndFocusPowderFromFilesTest + AlignComponentsTest + ARCSReductionTest + BASISTest + BayesQuasiTest + BilbySANSDataProcessorTest + BuildSQWTest + CalMuonDeadTimeTest + CNCSReductionTest + CodeConventions + CompareMDWorkspacesTest + complexShapeAbsorptionsTest + CompressEvents + ConvertHFIRSCDtoMDETest + ConvertMultipleRunsToSingleCrystalMDTest + ConvertQtoHKLMDHistoTest + ConvertToMDworkflow + ConvertWANDSCDtoQTest + ConvToMDCompareDefaultVsIndexing + CorelliPowderCalibrationTest + CountReflectionsTest + CRISPLoadingTest + CrystalFieldPythonInterface + D7AbsoluteCrossSectionsTest + D7YIGPositionCalibrationTest + Diffraction_Workflow_Test + DirectILLAutoProcessTest + DirectInelasticDiagnostic + DirectInelasticDiagnostic2 + DistributeProtonChargeTest + DocumentationTest + DOSTest + DrillProcessTest + ElasticEMUReductionTest + ElasticWindowMultipleTest + EnginXScriptTest + EQSANSBeamCenterAPIv2 + EQSANSDarkCurrentAPIv2 + EQSANSEffAPIv2 + EQSANSFlatTestAPIv2 + EQSANSIQOutputAPIv2 + EQSANSNormalisationAPIv2 + EQSANSProcessedEffAPIv2 + EQSANSSolidAPIv2 + EQSANSTOFStructureTest + EQSANSTransAPIv2 + ExecuteGeneratedPythonFitScriptTest + FilteredLoadvsLoadThenFilter + FilterEventsWithHighFirstIndexSplitter + FindSatellitePeaksTest + FittingDocumentationTest + FlatPlatePaalmanPingsCorrectionTest + GenerateLogbookTest + GetEiT0atSNSSystemTest + GetQsInQENSDataSystemTest + GSASIIRefineFitPeaksTest + HB3AWorkflowTests + HFIRBackgroundAPIv2 + HFIREffAPIv2 + HFIRReductionAPIv2 + HFIRTestsAPIv2 + HFIRTransAPIv2 + HYSPECReductionTest + ILLDetectorEfficiencyCorUserTest + ILLDirectGeometryReductionTest + ILLIndirectEnergyTransferBATS + ILLIndirectReductionFWS + ILLIndirectReductionQENS + ILLPowderD2BEfficiencyTest + ILLPowderDetectorScanTest + ILLPowderEfficiencyClosureTest + ILLPowderEfficiencyTest + ILLPowderLoadDetectorScanTest + ILLPowderParameterScanTest + ILLReflAutoProcessTest + ILLSANSMultiProcessTest + IndirectDiffractionTests + IndirectQuickRunTest + InelasticEMUReductionTest + IntegrateEllipsoidsTest + IntegratePeaksProfileFittingTest + InterfaceDocumentationTest + INTERLoadingTest + INTERReductionTest + ISIS_LETReduction + ISIS_MAPS_DGSReduction + ISIS_MariReduction + ISIS_MERLINReduction + ISIS_PowderGemTest + ISIS_PowderHRPDTest + ISIS_PowderOsirisTest + ISIS_PowderPearlTest + ISIS_PowderPolarisTest + ISIS_WISHPowderReductionTest + ISIS_WISHSingleCrystalReduction + ISISDirectInelastic + ISISDirectReductionComponents + ISISIndirectAnalysisTest + ISISIndirectBayesTest + ISISIndirectDiffractionReductionTest + ISISIndirectEnergyTransferTest + ISISIndirectInelastic + ISISIndirectSimulationTest + ISISLoadingEventData + ISISMuonAnalysis + ISISMuonAnalysisGrouping + ISISReflectometryAutoreductionTest + ISISReflectometryWorkflowBase + ISISReflectometryWorkflowPreprocessingTest + ISISReflectometryWorkflowSlicingTest + ISISReflInstrumentIDFTest + L2QScriptTest + LagrangeILLReductionTest + LinkedUBs_Test + LiquidsReflectometryReductionNoScalingTest + LiquidsReflectometryReductionTest + LiquidsReflectometryReductionWithBackgroundTest + LoadAndCheckBase + LoadCIFTest + LoadElementalAnalysisTest + LoadEmbeddedInstrumentInfo + LoadExedTest + LoadLotsOfFiles + LoadLotsOfInstruments + LoadMuonNexusTest + LoadTest + LoadVesuvioTest + LoadWANDSCDTest + LRPrimaryFractionTest + LRReductionWithReferenceTest + LRScalingFactorsTest + MagnetismReflectometryReductionTest + MaxEntTest + MDNormBackgroundHYSPECTest + MDNormCORELLITest + MDNormHYSPECTest + MDWorkspaceTests + MonteCarloAbsorptionCorrTest + MRFilterCrossSectionsTest + MultiThreadedLoadNeXusTest + MuonFFTTest + MuonKerenFittingTest + MuonLoadersSignatureTest + MuonMaxEntTest + MuonProcessTest + NOMADTest + OFFSPECLoadingTest + OSIRISDiffractionReductionTest + PaalmanPingsMonteCarloAbsorptionTest + PelicanCrystalProcessingTest + PelicanReductionTest + POLDIAnalyseResidualsTest + POLDIAutoCorrelationTest + POLDICreatePeaksFromCellTest + POLDIDataAnalysisTest + PolDiffILLReductionTest + POLDIFitPeaks1DTest + POLDIFitPeaks2DTest + POLDILoadRunsTest + POLDIMergeTest + POLDIPeakSearchTest + POLDITruncateDataTest + PolrefExample + POLREFLoadingTest + PowderDiffProfileCalibrateTest + PowderReduceP2DTest + PredictPeaksTest + PythonChannels + QENSGlobalFitTeixeiraWaterSQE + ReduceOneSCD_Run + ReflectometryFloodCorrection + ReflectometryISIS + ReflectometryISIS_v2 + ReflectometryISISSumBanksTest + ReflectometryQuickCombineMulti + ReflectometryQuickMultiDetector + ReflectometryQuickPointDetector + ReflectometryQuickPointDetectorMakeTransmission + RefRoi + RelectometryInstrumentSignedThetaTest + ReuseExistingCalibration + SANSILLAbsoluteScale2Test + SANSILLAbsoluteScaleTest + SANSILLAutoProcessTest + SANSILLReduction2Test + SANSILLReductionTest + SaveISISReflectometryORSOTest + SaveLoadNexusProcessed + SaveNexusTest + SEQUOIAreduction + SimulatedDensityOfStatesTest + SingleCrystalAbsorptionTest + SingleCrystalDiffuseReductionTest + SingleCrystalPeaksTest + SNAPRedux + SNSConvertToMDTest + SNSPowderRedux + SortHKLTest + SpaceGroupFactoryTest + SpaceGroupReflectionConditionsTest + SpaceGroupUnitCellTest + SphinxWarnings + SplineSmoothingTest + StepScan + SurfLoadingTest + SXDAnalysis + TOPAZPeakFinding + UnweightedLeastSquaresTest + ValidateInstrumentDir + VesuvioCommandsTest + VesuvioCorrectionsTest + VesuvioFittingTest + VesuvioLoadingTest + WeightedLeastSquaresTest + WishAnalysis + WishCalibrate + WishDiffuseScattering + WishMasking +) + +pysystemtest_add_test(${SYSTEST_NAMES}) + +add_subdirectory(ISIS/SANS) +add_subdirectory(PolarizationCorrections) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt new file mode 100644 index 000000000000..3a19d59f024a --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt @@ -0,0 +1,11 @@ +# System tests for ISIS SANS. + +set(SYSTEST_NAMES isis_sans_system_test) + +add_subdirectory(LARMOR) +add_subdirectory(LOQ) +add_subdirectory(SANS2D) +add_subdirectory(WORKFLOWS) +add_subdirectory(ZOOM) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt new file mode 100644 index 000000000000..114fb2504b89 --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt @@ -0,0 +1,7 @@ +# System tests related to the LARMOR instrument at ISIS. + +set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML SANSLARMORMultiPeriod SANSLARMORMultiPeriod_V2 + SANSLARMORMultiPeriodAddFiles SANSLARMORMultiPeriodAddFilesTest_V2 +) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt new file mode 100644 index 000000000000..fd1c4a7f2d5a --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt @@ -0,0 +1,18 @@ +# System tests related to the LOQ instrument at ISIS. + +set(SYSTEST_NAMES + LOQReloadWorkspaces + SANSLOQAddBatch + SANSLOQBatch + SANSLOQBatch_V2 + SANSLOQCan2D + SANSLOQCan2D_TOML + SANSLOQCan2D_V2 + SANSLOQCentreNoGrav + SANSLOQLegacyUserFile + SANSLOQReductionGUI + SANSLOQReductionGUITest_V2 + SANSLOQTransFitWorkspace2D +) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt new file mode 100644 index 000000000000..c099095104d7 --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt @@ -0,0 +1,33 @@ +# System tests related to the SANS2D instrument at ISIS. + +set(SYSTEST_NAMES + SANS2D_empty_cycle_22_02 + SANS2D_GDW20_4m_cycle_22_02 + SANS2D_GDW20_12m_cycle_22_02 + SANS2D_glassy_carbon_cycle_22_02 + SANS2DBatch + SANS2DBatchTest_V2 + SANS2DFrontNoGrav + SANS2DFrontNoGrav_V2 + SANS2DLimitEventsTime + SANS2DLimitEventsTime_V2 + SANS2DMultiPeriod + SANS2DMultiPeriod_V2 + SANS2DMultiPeriodAddFiles + SANS2DMultiPeriodAddFilesTest_V2 + SANS2DReductionGUI + SANS2DReductionGUI_V2 + SANS2DReductionGUIAdded + SANS2DReductionGUIAddedTest_V2 + SANS2DReductionGUITest_V2 + SANS2DReloadWorkspaces + SANS2DSearchCentreGUI + SANS2DSlicing + SANS2DSlicingTest_V2 + SANS2DTubeCalibrationTest + SANS2DTubeMergeTest + SANS2DWaveloops + SANS2DWaveloopsTest_V2 +) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt new file mode 100644 index 000000000000..886a05b6dd99 --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt @@ -0,0 +1,23 @@ +# System tests related to the SANS Workflows. + +set(SYSTEST_NAMES + SANSBatchReductionTest + SANSBeamCentreFinderCoreTest + SANSCentreSample + SANSDarkRunSubtractionTest + SANSDiagnosticPageTest + SANSFileChecking + SANSLoadersTest + SANSLoadTest + SANSLOWCentreNoGrav_V2 + SANSMergedDetectorsTest + SANSMergedDetectorsTest_V2 + SANSQResolutionTest + SANSReductionCoreTest + SANSSaveTest + SANSSingleReductionTest + SANSUtilityTest + SANSWorkspaceTypeTest +) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt new file mode 100644 index 000000000000..3c11a8684375 --- /dev/null +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt @@ -0,0 +1,14 @@ +# System tests related to the ZOOM instrument at ISIS. + +set(SYSTEST_NAMES + SANSZOOMLegacyUserFileTest + SANSZOOMTomlFileConversion + SANSZOOMTomlFileTest + SANSZOOMWavLoopsTest + ZOOMLegacyUserFileTest + ZOOMTomlFileTest + ZOOMTransEventData + ZOOMWavLoopsTest +) + +pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt new file mode 100644 index 000000000000..7e23808e9711 --- /dev/null +++ b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt @@ -0,0 +1,7 @@ +# System tests for the Polarization Corrections algorithms. + +set(SYSTEST_NAMES DepolarizedAnalyserTransmissionTest FlipperEfficiencyTest HeliumAnalyserEfficiencyTest + PolarizerEfficiencyTest SANSPolarizationCorrectionsBase +) + +pysystemtest_add_test(${SYSTEST_NAMES}) From a62619242cc5365b79d1a3ecd336f0cf18a7f273 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 11 Nov 2024 13:01:54 +0000 Subject: [PATCH 05/27] Use labels to differenciate system and unit tests RE #34850 --- buildconfig/CMake/FindCxxTest.cmake | 2 +- buildconfig/CMake/PyUnitTest.cmake | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/buildconfig/CMake/FindCxxTest.cmake b/buildconfig/CMake/FindCxxTest.cmake index d050d101f2da..59e1aa409f32 100644 --- a/buildconfig/CMake/FindCxxTest.cmake +++ b/buildconfig/CMake/FindCxxTest.cmake @@ -160,7 +160,7 @@ PYTHONHOME=${_python_home}" $ ${_suitename} ) - set_tests_properties(${_cxxtest_separate_name} PROPERTIES TIMEOUT ${TESTING_TIMEOUT}) + set_tests_properties(${_cxxtest_separate_name} PROPERTIES TIMEOUT ${TESTING_TIMEOUT} LABELS "UnitTest") if(WIN32) set_property( TEST ${_cxxtest_separate_name} diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 6b7a2bab1f28..383c7ad180e0 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -62,7 +62,8 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) ) # Set the PYTHONPATH so that the built modules can be found set_tests_properties( - ${_pyunit_separate_name} PROPERTIES ENVIRONMENT "${_test_environment}" TIMEOUT ${TESTING_TIMEOUT} + ${_pyunit_separate_name} PROPERTIES ENVIRONMENT "${_test_environment}" TIMEOUT ${TESTING_TIMEOUT} LABELS + "UnitTest" ) if(PYUNITTEST_RUN_SERIAL) set_tests_properties(${_pyunit_separate_name} PROPERTIES RUN_SERIAL 1) @@ -79,14 +80,17 @@ function(PYSYSTEMTEST_ADD_TEST) foreach(part ${ARGN}) set(_test_name ${part}) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_test(NAME SystemTest_${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name}) + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name}) else() - add_test(NAME SystemTest_${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name}) + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name}) endif() + set_tests_properties(${_test_name} PROPERTIES LABELS "SystemTest") + if(PYUNITTEST_RUN_SERIAL) - set_tests_properties(${_pyunit_separate_name} PROPERTIES RUN_SERIAL 1) + set_tests_properties(${_test_name} PROPERTIES RUN_SERIAL 1) endif() + endforeach(part ${ARGN}) endfunction() From 29774490d2aebab940a34ed6f5c170b4579e6dbb Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 11 Nov 2024 13:21:24 +0000 Subject: [PATCH 06/27] Add ctest commands to jenkins testing script RE #34850 --- buildconfig/Jenkins/Conda/run-tests | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/buildconfig/Jenkins/Conda/run-tests b/buildconfig/Jenkins/Conda/run-tests index d61ac05fb40b..7f94d7cc3805 100755 --- a/buildconfig/Jenkins/Conda/run-tests +++ b/buildconfig/Jenkins/Conda/run-tests @@ -82,9 +82,6 @@ if [[ $OSTYPE == "msys"* ]]; then WINDOWS_TEST_OPTIONS="-C Release" WINDOWS_UNITTEST_TIMEOUT_OPTIONS="--timeout 500" export PYTHONHOME=$CONDA_PREFIX - SYSTEM_TEST_EXECUTABLE=$WORKSPACE/build/systemtest.bat -else - SYSTEM_TEST_EXECUTABLE=$WORKSPACE/build/systemtest fi # Run unit tests @@ -92,7 +89,7 @@ cd $WORKSPACE/build # mkdir for test logs mkdir -p test_logs if [[ $ENABLE_UNIT_TESTS == true ]]; then - run_with_xvfb ctest -j$UNIT_TEST_THREADS --no-compress-output -T Test -O test_logs/ctest_$OSTYPE.log --schedule-random --output-on-failure --repeat until-pass:3 $WINDOWS_TEST_OPTIONS $WINDOWS_UNITTEST_TIMEOUT_OPTIONS + run_with_xvfb ctest -L UnitTest -j$UNIT_TEST_THREADS --no-compress-output -T Test -O test_logs/ctest_$OSTYPE.log --schedule-random --output-on-failure --repeat until-pass:3 $WINDOWS_TEST_OPTIONS $WINDOWS_UNITTEST_TIMEOUT_OPTIONS fi if [[ $ENABLE_DOCS == true && $ENABLE_DOC_TESTS == true ]]; then @@ -122,5 +119,5 @@ if [[ $ENABLE_SYSTEM_TESTS == true ]]; then SYSTEM_TEST_OPTIONS+=" --exclude-in-pull-requests" fi - run_with_xvfb $SYSTEM_TEST_EXECUTABLE $WINDOWS_TEST_OPTIONS $SYSTEM_TEST_OPTIONS + run_with_xvfb ctest -L SystemTest --no-compress-output -T Test -O test_logs/systest_$OSTYPE.log --schedule-random --repeat until-pass:3 $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS fi From a26ad8bc894e35dbaed98d2f3c37ed937beb8bf1 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 11 Nov 2024 17:02:09 +0000 Subject: [PATCH 07/27] Move flag not compatible with ctest command RE #34850 --- buildconfig/CMake/PyUnitTest.cmake | 4 +++- buildconfig/Jenkins/Conda/run-tests | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 383c7ad180e0..10b42c268126 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -82,7 +82,9 @@ function(PYSYSTEMTEST_ADD_TEST) if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name}) else() - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name}) + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} -l information + --quiet --output-on-failure + ) endif() set_tests_properties(${_test_name} PROPERTIES LABELS "SystemTest") diff --git a/buildconfig/Jenkins/Conda/run-tests b/buildconfig/Jenkins/Conda/run-tests index 7f94d7cc3805..fc497ecb6c6a 100755 --- a/buildconfig/Jenkins/Conda/run-tests +++ b/buildconfig/Jenkins/Conda/run-tests @@ -113,11 +113,11 @@ if [[ $ENABLE_SYSTEM_TESTS == true ]]; then echo "usagereports.enabled = 0" >> $userprops echo "CheckMantidVersion.OnStartup = 0" >> $userprops - SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} -l information --quiet --output-on-failure" + SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} --no-compress-output --schedule-random --repeat until-pass:3" if [[ ${JOB_NAME} == *pull_requests* ]]; then SYSTEM_TEST_OPTIONS+=" --exclude-in-pull-requests" fi - run_with_xvfb ctest -L SystemTest --no-compress-output -T Test -O test_logs/systest_$OSTYPE.log --schedule-random --repeat until-pass:3 $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS + run_with_xvfb ctest -L SystemTest -T Test -O test_logs/systest_$OSTYPE.log $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS fi From 59210a4c4bf58ea82d13211fde3a9500f36b8b85 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Tue, 12 Nov 2024 13:49:47 +0000 Subject: [PATCH 08/27] Allow systests to be skipped in PR builds RE #34850 --- buildconfig/CMake/PyUnitTest.cmake | 14 +++++++++++--- buildconfig/Jenkins/Conda/build | 4 ++++ buildconfig/Jenkins/Conda/run-tests | 4 ---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 10b42c268126..df87a7915a34 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -79,11 +79,19 @@ function(PYSYSTEMTEST_ADD_TEST) # Add all of the individual tests so that they can be run in parallel foreach(part ${ARGN}) set(_test_name ${part}) + if(NOT PR_JOB) + set(_system_test_options "-l information --quiet --output-on-failure") + else() + set(_system_test_options "-l information --quiet --output-on-failure --exclude-in-pull-requests") + endif() + if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name}) + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name} + ${_system_test_options} + ) else() - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} -l information - --quiet --output-on-failure + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} + ${_system_test_options} ) endif() diff --git a/buildconfig/Jenkins/Conda/build b/buildconfig/Jenkins/Conda/build index 9e4834c5c305..1c4cac1a0253 100755 --- a/buildconfig/Jenkins/Conda/build +++ b/buildconfig/Jenkins/Conda/build @@ -38,6 +38,10 @@ if [[ $OSTYPE == "msys"* ]]; then BUILD_OPTIONS="$BUILD_OPTIONS --config Release" fi +if [[ ${JOB_NAME} == *pull_requests* ]]; then + EXTRA_CMAKE_FLAGS+=" -DPR_JOB=True" +fi + # Run CMake using preset and variables cmake --preset=${CMAKE_PRESET} ${MANTID_DATA_STORE_CMAKE} ${EXTRA_CMAKE_FLAGS} $WORKSPACE diff --git a/buildconfig/Jenkins/Conda/run-tests b/buildconfig/Jenkins/Conda/run-tests index fc497ecb6c6a..e8e65d256b7d 100755 --- a/buildconfig/Jenkins/Conda/run-tests +++ b/buildconfig/Jenkins/Conda/run-tests @@ -115,9 +115,5 @@ if [[ $ENABLE_SYSTEM_TESTS == true ]]; then SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} --no-compress-output --schedule-random --repeat until-pass:3" - if [[ ${JOB_NAME} == *pull_requests* ]]; then - SYSTEM_TEST_OPTIONS+=" --exclude-in-pull-requests" - fi - run_with_xvfb ctest -L SystemTest -T Test -O test_logs/systest_$OSTYPE.log $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS fi From f811335149fb7afb54e898ba51095be2ae73a9ec Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Tue, 12 Nov 2024 17:36:01 +0000 Subject: [PATCH 09/27] Only configure systest CMake with framework RE #34850 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e49082b51c3..544affd5b4b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,7 @@ endif() if(BUILD_MANTIDFRAMEWORK) add_subdirectory(scripts) + add_subdirectory(Testing/SystemTests/tests) endif() # Docs requirements @@ -211,7 +212,6 @@ endif() # System test targets add_subdirectory(Testing/SystemTests/scripts) -add_subdirectory(Testing/SystemTests/tests) if(COVERAGE) get_property(ALL_SRCS GLOBAL PROPERTY COVERAGE_SRCS) From 042735fdfbe542d5a78ee8b93bca6c5a4cbd0a6f Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Wed, 13 Nov 2024 09:22:42 +0000 Subject: [PATCH 10/27] Output failure information from ctest RE #34850 --- buildconfig/Jenkins/Conda/run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconfig/Jenkins/Conda/run-tests b/buildconfig/Jenkins/Conda/run-tests index e8e65d256b7d..ffa8124d1878 100755 --- a/buildconfig/Jenkins/Conda/run-tests +++ b/buildconfig/Jenkins/Conda/run-tests @@ -113,7 +113,7 @@ if [[ $ENABLE_SYSTEM_TESTS == true ]]; then echo "usagereports.enabled = 0" >> $userprops echo "CheckMantidVersion.OnStartup = 0" >> $userprops - SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} --no-compress-output --schedule-random --repeat until-pass:3" + SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} --no-compress-output --schedule-random --repeat until-pass:3 --output-on-failure" run_with_xvfb ctest -L SystemTest -T Test -O test_logs/systest_$OSTYPE.log $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS fi From e32588d12ce624a1d09a403e1e5702d44c153c3f Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Wed, 13 Nov 2024 11:41:22 +0000 Subject: [PATCH 11/27] Fix logging level issue on jenkins RE #34850 --- buildconfig/CMake/PyUnitTest.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index df87a7915a34..9cf3b4e48211 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -80,18 +80,18 @@ function(PYSYSTEMTEST_ADD_TEST) foreach(part ${ARGN}) set(_test_name ${part}) if(NOT PR_JOB) - set(_system_test_options "-l information --quiet --output-on-failure") + set(_system_test_options "") else() - set(_system_test_options "-l information --quiet --output-on-failure --exclude-in-pull-requests") + set(_system_test_options "--exclude-in-pull-requests") endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name} - ${_system_test_options} + --output-on-failure -l information ${_system_test_options} ) else() - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} - ${_system_test_options} + add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} --output-on-failure + -l information ${_system_test_options} ) endif() From 8005155c18eab44da2aa6b7d1f777a25e49b9eb3 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Fri, 15 Nov 2024 12:31:36 +0000 Subject: [PATCH 12/27] Remove BaseClass tests RE #34850 --- Testing/SystemTests/tests/framework/CMakeLists.txt | 3 --- .../tests/framework/PolarizationCorrections/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index f8b1a4c17b4e..93e43a9a54b4 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -7,7 +7,6 @@ set(SYSTEST_NAMES AlgorithmMatrixWorkspaceValidateInputsTest AlgorithmMDWorkspaceValidateInputsTest AlgorithmTableWorkspaceValidateInputsTest - AlgorithmValidateInputsTestBase AlgorithmWorkspaceGroupValidateInputsTest AlignAndFocusPowderFromFilesTest AlignComponentsTest @@ -116,7 +115,6 @@ set(SYSTEST_NAMES ISISMuonAnalysis ISISMuonAnalysisGrouping ISISReflectometryAutoreductionTest - ISISReflectometryWorkflowBase ISISReflectometryWorkflowPreprocessingTest ISISReflectometryWorkflowSlicingTest ISISReflInstrumentIDFTest @@ -126,7 +124,6 @@ set(SYSTEST_NAMES LiquidsReflectometryReductionNoScalingTest LiquidsReflectometryReductionTest LiquidsReflectometryReductionWithBackgroundTest - LoadAndCheckBase LoadCIFTest LoadElementalAnalysisTest LoadEmbeddedInstrumentInfo diff --git a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt index 7e23808e9711..59bb8e3607ec 100644 --- a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt @@ -1,7 +1,7 @@ # System tests for the Polarization Corrections algorithms. set(SYSTEST_NAMES DepolarizedAnalyserTransmissionTest FlipperEfficiencyTest HeliumAnalyserEfficiencyTest - PolarizerEfficiencyTest SANSPolarizationCorrectionsBase + PolarizerEfficiencyTest ) pysystemtest_add_test(${SYSTEST_NAMES}) From 698d086cab0880fece3e9c86f101504a48056fc8 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 18 Nov 2024 11:38:29 +0000 Subject: [PATCH 13/27] Don't compress the end of the test where the failure is RE #34850 --- buildconfig/Jenkins/Conda/run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconfig/Jenkins/Conda/run-tests b/buildconfig/Jenkins/Conda/run-tests index ffa8124d1878..c618dd25f975 100755 --- a/buildconfig/Jenkins/Conda/run-tests +++ b/buildconfig/Jenkins/Conda/run-tests @@ -115,5 +115,5 @@ if [[ $ENABLE_SYSTEM_TESTS == true ]]; then SYSTEM_TEST_OPTIONS="-j${BUILD_THREADS_SYSTEM_TESTS} --no-compress-output --schedule-random --repeat until-pass:3 --output-on-failure" - run_with_xvfb ctest -L SystemTest -T Test -O test_logs/systest_$OSTYPE.log $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS + run_with_xvfb ctest -L SystemTest --test-output-truncation middle -T Test -O test_logs/systest_$OSTYPE.log $SYSTEM_TEST_OPTIONS $WINDOWS_TEST_OPTIONS fi From 18032f6584f11fc26e89af8e7b6fc3e7e7386207 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 25 Nov 2024 14:15:46 +0000 Subject: [PATCH 14/27] Fix no tests found failures RE #34850 --- Testing/SystemTests/tests/framework/CMakeLists.txt | 4 ---- .../SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt | 2 -- Testing/SystemTests/tests/framework/OFFSPECLoadingTest.py | 6 ++++++ Testing/SystemTests/tests/framework/SaveNexusTest.py | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index 93e43a9a54b4..ad2ed6e2810d 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -92,10 +92,6 @@ set(SYSTEST_NAMES InterfaceDocumentationTest INTERLoadingTest INTERReductionTest - ISIS_LETReduction - ISIS_MAPS_DGSReduction - ISIS_MariReduction - ISIS_MERLINReduction ISIS_PowderGemTest ISIS_PowderHRPDTest ISIS_PowderOsirisTest diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt index 3a19d59f024a..450cc019e48a 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt @@ -1,7 +1,5 @@ # System tests for ISIS SANS. -set(SYSTEST_NAMES isis_sans_system_test) - add_subdirectory(LARMOR) add_subdirectory(LOQ) add_subdirectory(SANS2D) diff --git a/Testing/SystemTests/tests/framework/OFFSPECLoadingTest.py b/Testing/SystemTests/tests/framework/OFFSPECLoadingTest.py index 2f2254230abc..d7b09d708149 100644 --- a/Testing/SystemTests/tests/framework/OFFSPECLoadingTest.py +++ b/Testing/SystemTests/tests/framework/OFFSPECLoadingTest.py @@ -13,12 +13,18 @@ class OFFSPECLoadingTest(LoadAndCheckBase): Test File loading and basic data integrity checks of OFFSPEC data in Mantid. """ + def __init__(self): + LoadAndCheckBase.__init__(self) + def get_raw_workspace_filename(self): return "OFFSPEC00010791.raw" def get_nexus_workspace_filename(self): return "OFFSPEC00010791.nxs" + def get_expected_instrument_name(self): + return "OFFSPEC" + def get_expected_number_of_periods(self): return 2 diff --git a/Testing/SystemTests/tests/framework/SaveNexusTest.py b/Testing/SystemTests/tests/framework/SaveNexusTest.py index d460c36d2b47..42651404fc5b 100644 --- a/Testing/SystemTests/tests/framework/SaveNexusTest.py +++ b/Testing/SystemTests/tests/framework/SaveNexusTest.py @@ -11,6 +11,7 @@ import os import glob import tempfile +import systemtesting temp_dir = tempfile.gettempdir() EXPECTED_EXT = ".expected" @@ -57,7 +58,7 @@ direc = config["instrumentDefinition.directory"] -class LoadAndSaveLotsOfInstruments(object): +class LoadAndSaveLotsOfInstruments(systemtesting.MantidSystemTest): def __getDataFileList__(self): # get a list of directories to look in print("Looking for instrument definition files in: %s" % direc) From fa2de273f7f8ace91c8874d681d1cb047a0043d2 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 25 Nov 2024 17:04:51 +0000 Subject: [PATCH 15/27] Remove skipped tests RE #34850 --- Testing/SystemTests/tests/framework/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index ad2ed6e2810d..0b429fe402c7 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -10,13 +10,13 @@ set(SYSTEST_NAMES AlgorithmWorkspaceGroupValidateInputsTest AlignAndFocusPowderFromFilesTest AlignComponentsTest - ARCSReductionTest + # ARCSReductionTest # Test skipped due to NaN Comparison. See Issue #38088 BASISTest BayesQuasiTest BilbySANSDataProcessorTest - BuildSQWTest + # BuildSQWTest # Tests skipped due to missing data. CalMuonDeadTimeTest - CNCSReductionTest + # CNCSReductionTest # All tests skipped due to NaN Comparisons. See Issue #38088 CodeConventions CompareMDWorkspacesTest complexShapeAbsorptionsTest @@ -63,7 +63,7 @@ set(SYSTEST_NAMES GenerateLogbookTest GetEiT0atSNSSystemTest GetQsInQENSDataSystemTest - GSASIIRefineFitPeaksTest + # GSASIIRefineFitPeaksTest # Skipped due to missing GSASII Path HB3AWorkflowTests HFIRBackgroundAPIv2 HFIREffAPIv2 @@ -131,7 +131,7 @@ set(SYSTEST_NAMES LoadVesuvioTest LoadWANDSCDTest LRPrimaryFractionTest - LRReductionWithReferenceTest + # LRReductionWithReferenceTest # Skipped due to missing import. LRScalingFactorsTest MagnetismReflectometryReductionTest MaxEntTest @@ -217,7 +217,7 @@ set(SYSTEST_NAMES VesuvioLoadingTest WeightedLeastSquaresTest WishAnalysis - WishCalibrate + # WishCalibrate # Skipped since 2017 WishDiffuseScattering WishMasking ) From 68600a9203d7d5c4fb1cfca120a1925da2990977 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Tue, 26 Nov 2024 10:19:18 +0000 Subject: [PATCH 16/27] Fix missing required files RE #34850 --- Testing/SystemTests/tests/framework/CMakeLists.txt | 2 +- .../tests/framework/ISISIndirectDiffractionReductionTest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index 0b429fe402c7..b6f8f7a8a6ab 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -47,7 +47,7 @@ set(SYSTEST_NAMES EQSANSBeamCenterAPIv2 EQSANSDarkCurrentAPIv2 EQSANSEffAPIv2 - EQSANSFlatTestAPIv2 + # EQSANSFlatTestAPIv2 # Skipped due to missing sensitivity correction file EQSANSIQOutputAPIv2 EQSANSNormalisationAPIv2 EQSANSProcessedEffAPIv2 diff --git a/Testing/SystemTests/tests/framework/ISISIndirectDiffractionReductionTest.py b/Testing/SystemTests/tests/framework/ISISIndirectDiffractionReductionTest.py index 1aafd1da43e3..cb4582160759 100644 --- a/Testing/SystemTests/tests/framework/ISISIndirectDiffractionReductionTest.py +++ b/Testing/SystemTests/tests/framework/ISISIndirectDiffractionReductionTest.py @@ -11,7 +11,7 @@ class ISISIndirectDiffractionReductionTest(MantidSystemTest): def requiredFiles(self): - return ["osi89813.raw", "osiris_041_RES10.cal", "OSIRIS89813_diffspec_red.nxs"] + return ["osi89813.raw", "osiris_041_RES10.cal"] def runTest(self): ISISIndirectDiffractionReduction( From fa2f59e9779d01cb5ef8ea790e67172250d36721 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Wed, 27 Nov 2024 10:18:06 +0000 Subject: [PATCH 17/27] Avoid duplication of framework systests RE #34850 --- Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt index 450cc019e48a..a070837b12ac 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/CMakeLists.txt @@ -5,5 +5,3 @@ add_subdirectory(LOQ) add_subdirectory(SANS2D) add_subdirectory(WORKFLOWS) add_subdirectory(ZOOM) - -pysystemtest_add_test(${SYSTEST_NAMES}) From ce3b1ae08e540e7833ab910254c4353e0a712027 Mon Sep 17 00:00:00 2001 From: Remi Perenon <107944543+perenon@users.noreply.github.com> Date: Fri, 27 Dec 2024 22:08:28 +0100 Subject: [PATCH 18/27] Fixing DrillProcess system test --- .../tests/framework/DrillProcessTest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Testing/SystemTests/tests/framework/DrillProcessTest.py b/Testing/SystemTests/tests/framework/DrillProcessTest.py index c7008a0b4ddc..8fc89cf87549 100644 --- a/Testing/SystemTests/tests/framework/DrillProcessTest.py +++ b/Testing/SystemTests/tests/framework/DrillProcessTest.py @@ -61,7 +61,7 @@ def editCell(self, row, column, text): def editSettings(self, settingValues, mDialog): """ Edit the settings window. This method will edit all the provided - settings and set them to their correcponding value. + settings and set them to their corresponding value. Args: settingValues (dict(str:str)): setting name and value to be set @@ -83,16 +83,19 @@ def editSettings(self, settingValues, mDialog): QTest.keyClicks(widgets[name], value) QTest.keyClick(widgets[name], Qt.Key_Tab) elif isinstance(widgets[name], QComboBox): - v = widgets[name].view() + w = widgets[name] m = widgets[name].model() for i in range(m.rowCount()): index = m.index(i, 0) text = index.data(Qt.DisplayRole) - if text == name: - v.scrollTo(index) - pos = index.center() - Qt.mouseClick(v.viewport(), Qt.LeftButton, 0, pos) + if text == value: + w.setCurrentIndex(index.row()) break + # Former code based on QTest.mouseclick is not working, the view is updated but the widget is not + # if text == name: + # v.scrollTo(index) + # pos = index.center() + # Qt.mouseClick(v.viewport(), Qt.LeftButton, 0, pos) QTest.mouseClick(sw.okButton, Qt.LeftButton) def cleanup(self): From 7cc49880907a52aa5158ed012536b0c818b3ed94 Mon Sep 17 00:00:00 2001 From: Remi Perenon <107944543+perenon@users.noreply.github.com> Date: Mon, 30 Dec 2024 20:30:40 +0100 Subject: [PATCH 19/27] Fixing DrillProcess system test (2) --- Testing/SystemTests/tests/framework/DrillProcessTest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Testing/SystemTests/tests/framework/DrillProcessTest.py b/Testing/SystemTests/tests/framework/DrillProcessTest.py index 8fc89cf87549..25b540609b61 100644 --- a/Testing/SystemTests/tests/framework/DrillProcessTest.py +++ b/Testing/SystemTests/tests/framework/DrillProcessTest.py @@ -121,6 +121,7 @@ def runTest(self): "BeamRadius": "0.05,0.05,0.05", "CalculateResolution": "MildnerCarpenter", "TransmissionBeamRadius": "0.2", + "NormaliseBy": "Time", } ) From bee3a782085184c99ab3336cb77fef69e7891f8b Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 30 Jun 2025 17:06:20 +0100 Subject: [PATCH 20/27] Create a mini systest runner Designed to be lightweight and driven by ctest. RE #34850 --- .../lib/systemtests/systemtesting.py | 35 +- Testing/SystemTests/scripts/systestrunner.py | 112 +++++ .../tests/framework/CMakeLists.txt | 426 +++++++++--------- .../framework/ISIS/SANS/LARMOR/CMakeLists.txt | 4 +- .../framework/ISIS/SANS/LOQ/CMakeLists.txt | 24 +- .../framework/ISIS/SANS/SANS2D/CMakeLists.txt | 54 +-- .../ISIS/SANS/WORKFLOWS/CMakeLists.txt | 34 +- .../framework/ISIS/SANS/ZOOM/CMakeLists.txt | 16 +- .../PolarizationCorrections/CMakeLists.txt | 4 +- Testing/SystemTests/tests/qt/CMakeLists.txt | 6 +- buildconfig/CMake/PyUnitTest.cmake | 39 +- 11 files changed, 426 insertions(+), 328 deletions(-) create mode 100644 Testing/SystemTests/scripts/systestrunner.py diff --git a/Testing/SystemTests/lib/systemtests/systemtesting.py b/Testing/SystemTests/lib/systemtests/systemtesting.py index 5fb51ebf8ba9..8147caf83036 100644 --- a/Testing/SystemTests/lib/systemtests/systemtesting.py +++ b/Testing/SystemTests/lib/systemtests/systemtesting.py @@ -1161,7 +1161,7 @@ def loadTestsFromModule(self, filename): spec.loader.exec_module(mod) module_classes = dict(inspect.getmembers(mod, inspect.isclass)) - module_classes = [x for x in module_classes if self.isValidTestClass(module_classes[x]) and x != "MantidSystemTest"] + module_classes = [x for x in module_classes if isValidTestClass(module_classes[x]) and x != "MantidSystemTest"] for test_name in module_classes: tests.append(TestSuite(self._runner.getTestDir(), modname, test_name, filename)) module_loaded = True @@ -1176,21 +1176,6 @@ def loadTestsFromModule(self, filename): return module_loaded, tests - def isValidTestClass(self, class_obj): - """Returns true if the test is a valid test class. It is valid - if: the class subclassses MantidSystemTest and has no abstract methods - """ - if not issubclass(class_obj, MantidSystemTest): - return False - # Check if the get_reference_file is abstract or not - if hasattr(class_obj, "__abstractmethods__"): - if len(class_obj.__abstractmethods__) == 0: - return True - else: - return False - else: - return True - ######################################################################### # Class to handle the environment @@ -1321,6 +1306,24 @@ def restoreconfig(self): self.__moveFile(self.__userPropsFile, self.__userPropsFileSystest) self.__moveFile(self.__userPropsFileBackup, self.__userPropsFile) +######################################################################### +# Function to check if a given class object is a Mantid System Test +# that can be run by the TestRunner class. +######################################################################### +def isValidTestClass(class_obj): + """Returns true if the test is a valid test class. It is valid + if: the class subclassses MantidSystemTest and has no abstract methods + """ + if not issubclass(class_obj, MantidSystemTest): + return False + # Check if the get_reference_file is abstract or not + if hasattr(class_obj, "__abstractmethods__"): + if len(class_obj.__abstractmethods__) == 0: + return True + else: + return False + else: + return True ######################################################################### # Function to return a string describing the environment diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py new file mode 100644 index 000000000000..7fa0db38a59e --- /dev/null +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# Mantid Repository : https://github.com/mantidproject/mantid +# +# Copyright © 2025 ISIS Rutherford Appleton Laboratory UKRI, +# NScD Oak Ridge National Laboratory, European Spallation Source, +# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS +# SPDX - License - Identifier: GPL - 3.0 + + +import inspect +import os +import sys +import time +import importlib.util + +# Prevents errors in systemtests that use matplotlib directly +os.environ["MPLBACKEND"] = "Agg" + +######################################################################### +# Set up the command line options +######################################################################### + +start_time = time.time() + +DEFAULT_QT_API = "pyqt5" +THIS_MODULE_DIR = os.path.dirname(os.path.realpath(__file__)) +DEFAULT_FRAMEWORK_LOC = os.path.realpath(os.path.join(THIS_MODULE_DIR, "..", "lib", "systemtests")) +DATA_DIRS_LIST_PATH = os.path.join(THIS_MODULE_DIR, "datasearch-directories.txt") +SAVE_DIR_LIST_PATH = os.path.join(THIS_MODULE_DIR, "defaultsave-directory.txt") +DEFAULT_LOG_LEVEL = "information" +DEFAULT_ARCHIVE_SEARCH = True +DEFAULT_MAKE_PROP = True +DEFAULT_EXECUTABLE = sys.executable + + +def kill_children(processes): + for process in processes: + process.terminate() + # Exit with status 1 - NOT OK + sys.exit(1) + + +def main(argv): + # Set the Qt version to use during the system tests + os.environ["QT_API"] = DEFAULT_QT_API + + # import the system testing framework + sys.path.append(DEFAULT_FRAMEWORK_LOC) + import systemtesting + + # allow PythonInterface/test to be discoverable + sys.path.append(systemtesting.FRAMEWORK_PYTHONINTERFACE_TEST_DIR) + + ######################################################################### + # Configure mantid + ######################################################################### + + # Parse files containing the search and save directories, unless otherwise given + data_paths = DATA_DIRS_LIST_PATH + if data_paths is None or data_paths == "": + with open(DATA_DIRS_LIST_PATH, "r") as f_handle: + data_paths = f_handle.read().strip() + + with open(SAVE_DIR_LIST_PATH, "r") as f_handle: + save_dir = f_handle.read().strip() + + # Configure properties file + mtdconf = systemtesting.MantidFrameworkConfig( + loglevel=DEFAULT_LOG_LEVEL, data_dirs=data_paths, save_dir=save_dir, archivesearch=DEFAULT_ARCHIVE_SEARCH + ) + if DEFAULT_MAKE_PROP: + mtdconf.config() + + ######################################################################### + # Generate list of tests + ######################################################################### + + path_to_test = argv[1] + test_dir_name = os.path.dirname(path_to_test) + test_file_name = os.path.basename(path_to_test) + test_module_name = os.path.splitext(test_file_name)[0] + test_spec = importlib.util.spec_from_file_location(test_module_name, path_to_test) + test_module = importlib.util.module_from_spec(test_spec) + test_spec.loader.exec_module(test_module) + test_classes = dict(inspect.getmembers(test_module, inspect.isclass)) + + test_class_names = [test_class for test_class in test_classes if + systemtesting.isValidTestClass(test_classes[test_class])] + + if not test_class_names: + raise NameError(f"No test classes found in system test module: {test_module_name}.") + + runner = systemtesting.TestRunner( + executable=DEFAULT_EXECUTABLE, + # see InstallerTests.py for why lstrip is required + exec_args="--classic", + escape_quotes=True, + ) + + for test_class_name in test_class_names: + script_obj = systemtesting.TestScript(test_dir_name, test_module_name, test_class_name, False) + runner.start_in_current_process(script_obj) + + ######################################################################### + # Cleanup + ######################################################################### + + # Put the configuration back to its original state + mtdconf.restoreconfig() + + +if __name__ == "__main__": + main(sys.argv) diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index b6f8f7a8a6ab..3178de0ab5cc 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -1,228 +1,228 @@ # System tests for the Mantid Framework package. set(SYSTEST_NAMES - AbinsTest - AbsorptionCorrectionTest - AlgorithmDocumentationTest - AlgorithmMatrixWorkspaceValidateInputsTest - AlgorithmMDWorkspaceValidateInputsTest - AlgorithmTableWorkspaceValidateInputsTest - AlgorithmWorkspaceGroupValidateInputsTest - AlignAndFocusPowderFromFilesTest - AlignComponentsTest + AbinsTest.py + AbsorptionCorrectionTest.py + AlgorithmDocumentationTest.py + AlgorithmMatrixWorkspaceValidateInputsTest.py + AlgorithmMDWorkspaceValidateInputsTest.py + AlgorithmTableWorkspaceValidateInputsTest.py + AlgorithmWorkspaceGroupValidateInputsTest.py + AlignAndFocusPowderFromFilesTest.py + AlignComponentsTest.py # ARCSReductionTest # Test skipped due to NaN Comparison. See Issue #38088 - BASISTest - BayesQuasiTest - BilbySANSDataProcessorTest + BASISTest.py + BayesQuasiTest.py + BilbySANSDataProcessorTest.py # BuildSQWTest # Tests skipped due to missing data. - CalMuonDeadTimeTest + CalMuonDeadTimeTest.py # CNCSReductionTest # All tests skipped due to NaN Comparisons. See Issue #38088 - CodeConventions - CompareMDWorkspacesTest - complexShapeAbsorptionsTest - CompressEvents - ConvertHFIRSCDtoMDETest - ConvertMultipleRunsToSingleCrystalMDTest - ConvertQtoHKLMDHistoTest - ConvertToMDworkflow - ConvertWANDSCDtoQTest - ConvToMDCompareDefaultVsIndexing - CorelliPowderCalibrationTest - CountReflectionsTest - CRISPLoadingTest - CrystalFieldPythonInterface - D7AbsoluteCrossSectionsTest - D7YIGPositionCalibrationTest - Diffraction_Workflow_Test - DirectILLAutoProcessTest - DirectInelasticDiagnostic - DirectInelasticDiagnostic2 - DistributeProtonChargeTest - DocumentationTest - DOSTest - DrillProcessTest - ElasticEMUReductionTest - ElasticWindowMultipleTest - EnginXScriptTest - EQSANSBeamCenterAPIv2 - EQSANSDarkCurrentAPIv2 - EQSANSEffAPIv2 + CodeConventions.py + CompareMDWorkspacesTest.py + complexShapeAbsorptionsTest.py + CompressEvents.py + ConvertHFIRSCDtoMDETest.py + ConvertMultipleRunsToSingleCrystalMDTest.py + ConvertQtoHKLMDHistoTest.py + ConvertToMDworkflow.py + ConvertWANDSCDtoQTest.py + ConvToMDCompareDefaultVsIndexing.py + CorelliPowderCalibrationTest.py + CountReflectionsTest.py + CRISPLoadingTest.py + CrystalFieldPythonInterface.py + D7AbsoluteCrossSectionsTest.py + D7YIGPositionCalibrationTest.py + Diffraction_Workflow_Test.py + DirectILLAutoProcessTest.py + DirectInelasticDiagnostic.py + DirectInelasticDiagnostic2.py + DistributeProtonChargeTest.py + DocumentationTest.py + DOSTest.py + DrillProcessTest.py + ElasticEMUReductionTest.py + ElasticWindowMultipleTest.py + EnginXScriptTest.py + EQSANSBeamCenterAPIv2.py + EQSANSDarkCurrentAPIv2.py + EQSANSEffAPIv2.py # EQSANSFlatTestAPIv2 # Skipped due to missing sensitivity correction file - EQSANSIQOutputAPIv2 - EQSANSNormalisationAPIv2 - EQSANSProcessedEffAPIv2 - EQSANSSolidAPIv2 - EQSANSTOFStructureTest - EQSANSTransAPIv2 - ExecuteGeneratedPythonFitScriptTest - FilteredLoadvsLoadThenFilter - FilterEventsWithHighFirstIndexSplitter - FindSatellitePeaksTest - FittingDocumentationTest - FlatPlatePaalmanPingsCorrectionTest - GenerateLogbookTest - GetEiT0atSNSSystemTest - GetQsInQENSDataSystemTest + EQSANSIQOutputAPIv2.py + EQSANSNormalisationAPIv2.py + EQSANSProcessedEffAPIv2.py + EQSANSSolidAPIv2.py + EQSANSTOFStructureTest.py + EQSANSTransAPIv2.py + ExecuteGeneratedPythonFitScriptTest.py + FilteredLoadvsLoadThenFilter.py + FilterEventsWithHighFirstIndexSplitter.py + FindSatellitePeaksTest.py + FittingDocumentationTest.py + FlatPlatePaalmanPingsCorrectionTest.py + GenerateLogbookTest.py + GetEiT0atSNSSystemTest.py + GetQsInQENSDataSystemTest.py # GSASIIRefineFitPeaksTest # Skipped due to missing GSASII Path - HB3AWorkflowTests - HFIRBackgroundAPIv2 - HFIREffAPIv2 - HFIRReductionAPIv2 - HFIRTestsAPIv2 - HFIRTransAPIv2 - HYSPECReductionTest - ILLDetectorEfficiencyCorUserTest - ILLDirectGeometryReductionTest - ILLIndirectEnergyTransferBATS - ILLIndirectReductionFWS - ILLIndirectReductionQENS - ILLPowderD2BEfficiencyTest - ILLPowderDetectorScanTest - ILLPowderEfficiencyClosureTest - ILLPowderEfficiencyTest - ILLPowderLoadDetectorScanTest - ILLPowderParameterScanTest - ILLReflAutoProcessTest - ILLSANSMultiProcessTest - IndirectDiffractionTests - IndirectQuickRunTest - InelasticEMUReductionTest - IntegrateEllipsoidsTest - IntegratePeaksProfileFittingTest - InterfaceDocumentationTest - INTERLoadingTest - INTERReductionTest - ISIS_PowderGemTest - ISIS_PowderHRPDTest - ISIS_PowderOsirisTest - ISIS_PowderPearlTest - ISIS_PowderPolarisTest - ISIS_WISHPowderReductionTest - ISIS_WISHSingleCrystalReduction - ISISDirectInelastic - ISISDirectReductionComponents - ISISIndirectAnalysisTest - ISISIndirectBayesTest - ISISIndirectDiffractionReductionTest - ISISIndirectEnergyTransferTest - ISISIndirectInelastic - ISISIndirectSimulationTest - ISISLoadingEventData - ISISMuonAnalysis - ISISMuonAnalysisGrouping - ISISReflectometryAutoreductionTest - ISISReflectometryWorkflowPreprocessingTest - ISISReflectometryWorkflowSlicingTest - ISISReflInstrumentIDFTest - L2QScriptTest - LagrangeILLReductionTest - LinkedUBs_Test - LiquidsReflectometryReductionNoScalingTest - LiquidsReflectometryReductionTest - LiquidsReflectometryReductionWithBackgroundTest - LoadCIFTest - LoadElementalAnalysisTest - LoadEmbeddedInstrumentInfo - LoadExedTest - LoadLotsOfFiles - LoadLotsOfInstruments - LoadMuonNexusTest - LoadTest - LoadVesuvioTest - LoadWANDSCDTest - LRPrimaryFractionTest + HB3AWorkflowTests.py + HFIRBackgroundAPIv2.py + HFIREffAPIv2.py + HFIRReductionAPIv2.py + HFIRTestsAPIv2.py + HFIRTransAPIv2.py + HYSPECReductionTest.py + ILLDetectorEfficiencyCorUserTest.py + ILLDirectGeometryReductionTest.py + ILLIndirectEnergyTransferBATS.py + ILLIndirectReductionFWS.py + ILLIndirectReductionQENS.py + ILLPowderD2BEfficiencyTest.py + ILLPowderDetectorScanTest.py + ILLPowderEfficiencyClosureTest.py + ILLPowderEfficiencyTest.py + ILLPowderLoadDetectorScanTest.py + ILLPowderParameterScanTest.py + ILLReflAutoProcessTest.py + ILLSANSMultiProcessTest.py + IndirectDiffractionTests.py + IndirectQuickRunTest.py + InelasticEMUReductionTest.py + IntegrateEllipsoidsTest.py + IntegratePeaksProfileFittingTest.py + InterfaceDocumentationTest.py + INTERLoadingTest.py + INTERReductionTest.py + ISIS_PowderGemTest.py + ISIS_PowderHRPDTest.py + ISIS_PowderOsirisTest.py + ISIS_PowderPearlTest.py + ISIS_PowderPolarisTest.py + ISIS_WISHPowderReductionTest.py + ISIS_WISHSingleCrystalReduction.py + ISISDirectInelastic.py + ISISDirectReductionComponents.py + ISISIndirectAnalysisTest.py + ISISIndirectBayesTest.py + ISISIndirectDiffractionReductionTest.py + ISISIndirectEnergyTransferTest.py + ISISIndirectInelastic.py + ISISIndirectSimulationTest.py + ISISLoadingEventData.py + ISISMuonAnalysis.py + ISISMuonAnalysisGrouping.py + ISISReflectometryAutoreductionTest.py + ISISReflectometryWorkflowPreprocessingTest.py + ISISReflectometryWorkflowSlicingTest.py + ISISReflInstrumentIDFTest.py + L2QScriptTest.py + LagrangeILLReductionTest.py + LinkedUBs_Test.py + LiquidsReflectometryReductionNoScalingTest.py + LiquidsReflectometryReductionTest.py + LiquidsReflectometryReductionWithBackgroundTest.py + LoadCIFTest.py + LoadElementalAnalysisTest.py + LoadEmbeddedInstrumentInfo.py + LoadExedTest.py + LoadLotsOfFiles.py + LoadLotsOfInstruments.py + LoadMuonNexusTest.py + LoadTest.py + LoadVesuvioTest.py + LoadWANDSCDTest.py + LRPrimaryFractionTest.py # LRReductionWithReferenceTest # Skipped due to missing import. - LRScalingFactorsTest - MagnetismReflectometryReductionTest - MaxEntTest - MDNormBackgroundHYSPECTest - MDNormCORELLITest - MDNormHYSPECTest - MDWorkspaceTests - MonteCarloAbsorptionCorrTest - MRFilterCrossSectionsTest - MultiThreadedLoadNeXusTest - MuonFFTTest - MuonKerenFittingTest - MuonLoadersSignatureTest - MuonMaxEntTest - MuonProcessTest - NOMADTest - OFFSPECLoadingTest - OSIRISDiffractionReductionTest - PaalmanPingsMonteCarloAbsorptionTest - PelicanCrystalProcessingTest - PelicanReductionTest - POLDIAnalyseResidualsTest - POLDIAutoCorrelationTest - POLDICreatePeaksFromCellTest - POLDIDataAnalysisTest - PolDiffILLReductionTest - POLDIFitPeaks1DTest - POLDIFitPeaks2DTest - POLDILoadRunsTest - POLDIMergeTest - POLDIPeakSearchTest - POLDITruncateDataTest - PolrefExample - POLREFLoadingTest - PowderDiffProfileCalibrateTest - PowderReduceP2DTest - PredictPeaksTest - PythonChannels - QENSGlobalFitTeixeiraWaterSQE - ReduceOneSCD_Run - ReflectometryFloodCorrection - ReflectometryISIS - ReflectometryISIS_v2 - ReflectometryISISSumBanksTest - ReflectometryQuickCombineMulti - ReflectometryQuickMultiDetector - ReflectometryQuickPointDetector - ReflectometryQuickPointDetectorMakeTransmission - RefRoi - RelectometryInstrumentSignedThetaTest - ReuseExistingCalibration - SANSILLAbsoluteScale2Test - SANSILLAbsoluteScaleTest - SANSILLAutoProcessTest - SANSILLReduction2Test - SANSILLReductionTest - SaveISISReflectometryORSOTest - SaveLoadNexusProcessed - SaveNexusTest - SEQUOIAreduction - SimulatedDensityOfStatesTest - SingleCrystalAbsorptionTest - SingleCrystalDiffuseReductionTest - SingleCrystalPeaksTest - SNAPRedux - SNSConvertToMDTest - SNSPowderRedux - SortHKLTest - SpaceGroupFactoryTest - SpaceGroupReflectionConditionsTest - SpaceGroupUnitCellTest - SphinxWarnings - SplineSmoothingTest - StepScan - SurfLoadingTest - SXDAnalysis - TOPAZPeakFinding - UnweightedLeastSquaresTest - ValidateInstrumentDir - VesuvioCommandsTest - VesuvioCorrectionsTest - VesuvioFittingTest - VesuvioLoadingTest - WeightedLeastSquaresTest - WishAnalysis + LRScalingFactorsTest.py + MagnetismReflectometryReductionTest.py + MaxEntTest.py + MDNormBackgroundHYSPECTest.py + MDNormCORELLITest.py + MDNormHYSPECTest.py + MDWorkspaceTests.py + MonteCarloAbsorptionCorrTest.py + MRFilterCrossSectionsTest.py + MultiThreadedLoadNeXusTest.py + MuonFFTTest.py + MuonKerenFittingTest.py + MuonLoadersSignatureTest.py + MuonMaxEntTest.py + MuonProcessTest.py + NOMADTest.py + OFFSPECLoadingTest.py + OSIRISDiffractionReductionTest.py + PaalmanPingsMonteCarloAbsorptionTest.py + PelicanCrystalProcessingTest.py + PelicanReductionTest.py + POLDIAnalyseResidualsTest.py + POLDIAutoCorrelationTest.py + POLDICreatePeaksFromCellTest.py + POLDIDataAnalysisTest.py + PolDiffILLReductionTest.py + POLDIFitPeaks1DTest.py + POLDIFitPeaks2DTest.py + POLDILoadRunsTest.py + POLDIMergeTest.py + POLDIPeakSearchTest.py + POLDITruncateDataTest.py + PolrefExample.py + POLREFLoadingTest.py + PowderDiffProfileCalibrateTest.py + PowderReduceP2DTest.py + PredictPeaksTest.py + PythonChannels.py + QENSGlobalFitTeixeiraWaterSQE.py + ReduceOneSCD_Run.py + ReflectometryFloodCorrection.py + ReflectometryISIS.py + ReflectometryISIS_v2.py + ReflectometryISISSumBanksTest.py + ReflectometryQuickCombineMulti.py + ReflectometryQuickMultiDetector.py + ReflectometryQuickPointDetector.py + ReflectometryQuickPointDetectorMakeTransmission.py + RefRoi.py + RelectometryInstrumentSignedThetaTest.py + ReuseExistingCalibration.py + SANSILLAbsoluteScale2Test.py + SANSILLAbsoluteScaleTest.py + SANSILLAutoProcessTest.py + SANSILLReduction2Test.py + SANSILLReductionTest.py + SaveISISReflectometryORSOTest.py + SaveLoadNexusProcessed.py + SaveNexusTest.py + SEQUOIAreduction.py + SimulatedDensityOfStatesTest.py + SingleCrystalAbsorptionTest.py + SingleCrystalDiffuseReductionTest.py + SingleCrystalPeaksTest.py + SNAPRedux.py + SNSConvertToMDTest.py + SNSPowderRedux.py + SortHKLTest.py + SpaceGroupFactoryTest.py + SpaceGroupReflectionConditionsTest.py + SpaceGroupUnitCellTest.py + SphinxWarnings.py + SplineSmoothingTest.py + StepScan.py + SurfLoadingTest.py + SXDAnalysis.py + TOPAZPeakFinding.py + UnweightedLeastSquaresTest.py + ValidateInstrumentDir.py + VesuvioCommandsTest.py + VesuvioCorrectionsTest.py + VesuvioFittingTest.py + VesuvioLoadingTest.py + WeightedLeastSquaresTest.py + WishAnalysis.py # WishCalibrate # Skipped since 2017 - WishDiffuseScattering - WishMasking + WishDiffuseScattering.py + WishMasking.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework ${SYSTEST_NAMES}) add_subdirectory(ISIS/SANS) add_subdirectory(PolarizationCorrections) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt index 114fb2504b89..7c073ccd0475 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt @@ -1,7 +1,7 @@ # System tests related to the LARMOR instrument at ISIS. -set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML SANSLARMORMultiPeriod SANSLARMORMultiPeriod_V2 - SANSLARMORMultiPeriodAddFiles SANSLARMORMultiPeriodAddFilesTest_V2 +set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML.py SANSLARMORMultiPeriod SANSLARMORMultiPeriod_V2.py + SANSLARMORMultiPeriodAddFiles.py SANSLARMORMultiPeriodAddFilesTest_V2.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt index fd1c4a7f2d5a..6596f173385a 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt @@ -1,18 +1,18 @@ # System tests related to the LOQ instrument at ISIS. set(SYSTEST_NAMES - LOQReloadWorkspaces - SANSLOQAddBatch - SANSLOQBatch - SANSLOQBatch_V2 - SANSLOQCan2D - SANSLOQCan2D_TOML - SANSLOQCan2D_V2 - SANSLOQCentreNoGrav - SANSLOQLegacyUserFile - SANSLOQReductionGUI - SANSLOQReductionGUITest_V2 - SANSLOQTransFitWorkspace2D + LOQReloadWorkspaces.py + SANSLOQAddBatch.py + SANSLOQBatch.py + SANSLOQBatch_V2.py + SANSLOQCan2D.py + SANSLOQCan2D_TOML.py + SANSLOQCan2D_V2.py + SANSLOQCentreNoGrav.py + SANSLOQLegacyUserFile.py + SANSLOQReductionGUI.py + SANSLOQReductionGUITest_V2.py + SANSLOQTransFitWorkspace2D.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt index c099095104d7..5760c626eaa6 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt @@ -1,33 +1,33 @@ # System tests related to the SANS2D instrument at ISIS. set(SYSTEST_NAMES - SANS2D_empty_cycle_22_02 - SANS2D_GDW20_4m_cycle_22_02 - SANS2D_GDW20_12m_cycle_22_02 - SANS2D_glassy_carbon_cycle_22_02 - SANS2DBatch - SANS2DBatchTest_V2 - SANS2DFrontNoGrav - SANS2DFrontNoGrav_V2 - SANS2DLimitEventsTime - SANS2DLimitEventsTime_V2 - SANS2DMultiPeriod - SANS2DMultiPeriod_V2 - SANS2DMultiPeriodAddFiles - SANS2DMultiPeriodAddFilesTest_V2 - SANS2DReductionGUI - SANS2DReductionGUI_V2 - SANS2DReductionGUIAdded - SANS2DReductionGUIAddedTest_V2 - SANS2DReductionGUITest_V2 - SANS2DReloadWorkspaces - SANS2DSearchCentreGUI - SANS2DSlicing - SANS2DSlicingTest_V2 - SANS2DTubeCalibrationTest - SANS2DTubeMergeTest - SANS2DWaveloops - SANS2DWaveloopsTest_V2 + SANS2D_empty_cycle_22_02.py + SANS2D_GDW20_4m_cycle_22_02.py + SANS2D_GDW20_12m_cycle_22_02.py + SANS2D_glassy_carbon_cycle_22_02.py + SANS2DBatch.py + SANS2DBatchTest_V2.py + SANS2DFrontNoGrav.py + SANS2DFrontNoGrav_V2.py + SANS2DLimitEventsTime.py + SANS2DLimitEventsTime_V2.py + SANS2DMultiPeriod.py + SANS2DMultiPeriod_V2.py + SANS2DMultiPeriodAddFiles.py + SANS2DMultiPeriodAddFilesTest_V2.py + SANS2DReductionGUI.py + SANS2DReductionGUI_V2.py + SANS2DReductionGUIAdded.py + SANS2DReductionGUIAddedTest_V2.py + SANS2DReductionGUITest_V2.py + SANS2DReloadWorkspaces.py + SANS2DSearchCentreGUI.py + SANS2DSlicing.py + SANS2DSlicingTest_V2.py + SANS2DTubeCalibrationTest.py + SANS2DTubeMergeTest.py + SANS2DWaveloops.py + SANS2DWaveloopsTest_V2.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt index 886a05b6dd99..8635f814c851 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt @@ -1,23 +1,23 @@ # System tests related to the SANS Workflows. set(SYSTEST_NAMES - SANSBatchReductionTest - SANSBeamCentreFinderCoreTest - SANSCentreSample - SANSDarkRunSubtractionTest - SANSDiagnosticPageTest - SANSFileChecking - SANSLoadersTest - SANSLoadTest - SANSLOWCentreNoGrav_V2 - SANSMergedDetectorsTest - SANSMergedDetectorsTest_V2 - SANSQResolutionTest - SANSReductionCoreTest - SANSSaveTest - SANSSingleReductionTest - SANSUtilityTest - SANSWorkspaceTypeTest + SANSBatchReductionTest.py + SANSBeamCentreFinderCoreTest.py + SANSCentreSample.py + SANSDarkRunSubtractionTest.py + SANSDiagnosticPageTest.py + SANSFileChecking.py + SANSLoadersTest.py + SANSLoadTest.py + SANSLOWCentreNoGrav_V2.py + SANSMergedDetectorsTest.py + SANSMergedDetectorsTest_V2.py + SANSQResolutionTest.py + SANSReductionCoreTest.py + SANSSaveTest.py + SANSSingleReductionTest.py + SANSUtilityTest.py + SANSWorkspaceTypeTest.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt index 3c11a8684375..a8e2d6f35c15 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt @@ -1,14 +1,14 @@ # System tests related to the ZOOM instrument at ISIS. set(SYSTEST_NAMES - SANSZOOMLegacyUserFileTest - SANSZOOMTomlFileConversion - SANSZOOMTomlFileTest - SANSZOOMWavLoopsTest - ZOOMLegacyUserFileTest - ZOOMTomlFileTest - ZOOMTransEventData - ZOOMWavLoopsTest + SANSZOOMLegacyUserFileTest.py + SANSZOOMTomlFileConversion.py + SANSZOOMTomlFileTest.py + SANSZOOMWavLoopsTest.py + ZOOMLegacyUserFileTest.py + ZOOMTomlFileTest.py + ZOOMTransEventData.py + ZOOMWavLoopsTest.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt index 59bb8e3607ec..abfbae28f33e 100644 --- a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt @@ -1,7 +1,7 @@ # System tests for the Polarization Corrections algorithms. -set(SYSTEST_NAMES DepolarizedAnalyserTransmissionTest FlipperEfficiencyTest HeliumAnalyserEfficiencyTest - PolarizerEfficiencyTest +set(SYSTEST_NAMES DepolarizedAnalyserTransmissionTest.py FlipperEfficiencyTest.py HeliumAnalyserEfficiencyTest.py + PolarizerEfficiencyTest.py ) pysystemtest_add_test(${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/qt/CMakeLists.txt b/Testing/SystemTests/tests/qt/CMakeLists.txt index 0c63434e791c..73729182f0a2 100644 --- a/Testing/SystemTests/tests/qt/CMakeLists.txt +++ b/Testing/SystemTests/tests/qt/CMakeLists.txt @@ -1,9 +1,9 @@ # System Tests for the mantid qt package -set(SYSTEST_NAMES CppInterfacesStartupTest FitScriptGeneratorStartupTest PythonInterfacesStartupTest - SliceViewerIntegrationTest WorkbenchStartupTest +set(SYSTEST_NAMES CppInterfacesStartupTest.py FitScriptGeneratorStartupTest.py PythonInterfacesStartupTest.py + SliceViewerIntegrationTest.py WorkbenchStartupTest.py ) if(ENABLE_WORKBENCH) - pysystemtest_add_test(${SYSTEST_NAMES}) + pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} qt ${SYSTEST_NAMES}) endif() diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 9cf3b4e48211..d44e1a4adde1 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -74,34 +74,17 @@ endfunction() # PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module # This adds the named system test do they can be run individually -function(PYSYSTEMTEST_ADD_TEST) - - # Add all of the individual tests so that they can be run in parallel - foreach(part ${ARGN}) - set(_test_name ${part}) - if(NOT PR_JOB) - set(_system_test_options "") - else() - set(_system_test_options "--exclude-in-pull-requests") - endif() - - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update.bat -R ${_test_name} - --output-on-failure -l information ${_system_test_options} - ) - else() - add_test(NAME ${_test_name} COMMAND ${CMAKE_BINARY_DIR}/systemtest_no_update -R ${_test_name} --output-on-failure - -l information ${_system_test_options} - ) - endif() - - set_tests_properties(${_test_name} PROPERTIES LABELS "SystemTest") - - if(PYUNITTEST_RUN_SERIAL) - set_tests_properties(${_test_name} PROPERTIES RUN_SERIAL 1) - endif() - - endforeach(part ${ARGN}) +function(PYSYSTEMTEST_ADD_TEST _test_src_dir _testname_prefix) + if(NOT PYUNITTEST_RUNNER) + set(PYUNITTEST_RUNNER ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) + pyunittest_add_test(${ARGV}) + unset(PYUNITTEST_RUNNER) + else() + set(_temp_unit_runner ${PYUNITTEST_RUNNER}) + set(PYUNITTEST_RUNNER ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) + pyunittest_add_test(${ARGV}) + set(PYUNITTEST_RUNNER ${_temp_unit_runner}) + endif() endfunction() # Defines a macro to check that each file contains a call to unittest.main() The arguments should be the source From 4bc6dc1ba4e20e27204e151c6d44405694aa5497 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Fri, 4 Jul 2025 17:49:28 +0100 Subject: [PATCH 21/27] Fix the SANS systests RE #34850 --- Testing/SystemTests/scripts/systestrunner.py | 2 ++ .../SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt | 2 +- .../tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod.py | 2 +- .../framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFiles.py | 2 +- .../ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFilesTest_V2.py | 2 +- .../framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod_V2.py | 2 +- .../ISIS/SANS/LARMOR/SANSLARMOR_multiperiod_event_files_TOML.py | 2 +- .../SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt | 2 +- .../tests/framework/ISIS/SANS/LOQ/LOQReloadWorkspaces.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQAddBatch.py | 2 +- .../SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQBatch_V2.py | 2 +- .../SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_TOML.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_V2.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQCentreNoGrav.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQLegacyUserFile.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUI.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUITest_V2.py | 2 +- .../tests/framework/ISIS/SANS/LOQ/SANSLOQTransFitWorkspace2D.py | 2 +- .../SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt | 2 +- .../SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatch.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DBatchTest_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFiles.py | 2 +- .../ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFilesTest_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAdded.py | 2 +- .../ISIS/SANS/SANS2D/SANS2DReductionGUIAddedTest_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI_V2.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DReloadWorkspaces.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DSearchCentreGUI.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DSlicing.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DSlicingTest_V2.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2DTubeCalibrationTest.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DTubeMergeTest.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloops.py | 2 +- .../tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloopsTest_V2.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2D_GDW20_12m_cycle_22_02.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py | 2 +- .../framework/ISIS/SANS/SANS2D/SANS2D_empty_cycle_22_02.py | 2 +- .../ISIS/SANS/SANS2D/SANS2D_glassy_carbon_cycle_22_02.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSBatchReductionTest.py | 2 +- .../ISIS/SANS/WORKFLOWS/SANSBeamCentreFinderCoreTest.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSCentreSample.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSDarkRunSubtractionTest.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSDiagnosticPageTest.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSFileChecking.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSLOWCentreNoGrav_V2.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadersTest.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest_V2.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSQResolutionTest.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py | 2 +- .../framework/ISIS/SANS/WORKFLOWS/SANSSingleReductionTest.py | 2 +- .../tests/framework/ISIS/SANS/WORKFLOWS/SANSUtilityTest.py | 2 +- .../SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt | 2 +- Testing/SystemTests/tests/framework/LoadTest.py | 2 +- .../tests/framework/PolarizationCorrections/CMakeLists.txt | 2 +- 66 files changed, 67 insertions(+), 65 deletions(-) diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py index 7fa0db38a59e..653f52e05586 100644 --- a/Testing/SystemTests/scripts/systestrunner.py +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -24,6 +24,7 @@ DEFAULT_QT_API = "pyqt5" THIS_MODULE_DIR = os.path.dirname(os.path.realpath(__file__)) DEFAULT_FRAMEWORK_LOC = os.path.realpath(os.path.join(THIS_MODULE_DIR, "..", "lib", "systemtests")) +SANS_TEST_LOC = os.path.realpath(os.path.join(THIS_MODULE_DIR, "..", "tests", "framework", "ISIS", "SANS")) DATA_DIRS_LIST_PATH = os.path.join(THIS_MODULE_DIR, "datasearch-directories.txt") SAVE_DIR_LIST_PATH = os.path.join(THIS_MODULE_DIR, "defaultsave-directory.txt") DEFAULT_LOG_LEVEL = "information" @@ -50,6 +51,7 @@ def main(argv): # allow PythonInterface/test to be discoverable sys.path.append(systemtesting.FRAMEWORK_PYTHONINTERFACE_TEST_DIR) + sys.path.append(SANS_TEST_LOC) ######################################################################### # Configure mantid ######################################################################### diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt index 7c073ccd0475..5466728b3e00 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt @@ -4,4 +4,4 @@ set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML.py SANSLARMORMultiPeri SANSLARMORMultiPeriodAddFiles.py SANSLARMORMultiPeriodAddFilesTest_V2.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.ISIS.SANS.LARMOR ${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod.py index 0f03e5020c18..1ec506f6e59d 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod.py @@ -8,7 +8,7 @@ # test batch mode with sans2d and selecting a period in batch mode import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService from ISISCommandInterface import AssignSample, Detector, LARMOR, MaskFile, Set1D from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFiles.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFiles.py index 1574c76a7eff..ee25a6ca7b33 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFiles.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFiles.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import os import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.simpleapi import DeleteWorkspace diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFilesTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFilesTest_V2.py index dee9e34ba3b6..f177d5db9133 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFilesTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriodAddFilesTest_V2.py @@ -9,7 +9,7 @@ import systemtesting import os -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.api import AnalysisDataService from sans.command_interface.ISISCommandInterface import ( diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod_V2.py index 35fcaf9fd3a5..9b3f422f0958 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMORMultiPeriod_V2.py @@ -7,7 +7,7 @@ # pylint: disable=no-init,too-few-public-methods import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService from sans.command_interface.ISISCommandInterface import Set1D, Detector, MaskFile, AssignSample, WavRangeReduction, LARMOR diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMOR_multiperiod_event_files_TOML.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMOR_multiperiod_event_files_TOML.py index dadfe7f527c1..ff8853fde967 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMOR_multiperiod_event_files_TOML.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/SANSLARMOR_multiperiod_event_files_TOML.py @@ -8,7 +8,7 @@ import systemtesting import os -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.api import AnalysisDataService from sans.command_interface.ISISCommandInterface import ( diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt index 6596f173385a..b3fa08c74fe3 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/CMakeLists.txt @@ -15,4 +15,4 @@ set(SYSTEST_NAMES SANSLOQTransFitWorkspace2D.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.ISIS.SANS.LOQ ${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/LOQReloadWorkspaces.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/LOQReloadWorkspaces.py index 6cd51c3b6fef..3dcdd7615c01 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/LOQReloadWorkspaces.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/LOQReloadWorkspaces.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=invalid-name,no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import ( AssignCan, AssignSample, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQAddBatch.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQAddBatch.py index 3fbe16220210..dee5693a7f3e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQAddBatch.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQAddBatch.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=no-init,invalid-name,attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import Load from mantid.api import FileFinder from mantid import config diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch.py index 7d58267556e2..a9580e6819e8 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import LoadNexus, Plus from mantid import config, FileFinder from ISISCommandInterface import Detector, Gravity, LOQ, MaskFile, Set1D diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch_V2.py index b5e29f3e6395..cc9ab4fde80c 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQBatch_V2.py @@ -9,7 +9,7 @@ import systemtesting import os.path -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.api import FileFinder from mantid.simpleapi import LoadNexus, Plus diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D.py index 666ce8d9c8aa..1e074fc336c2 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import AssignCan, AssignSample, Detector, Gravity, LOQ, MaskFile, Set2D, SetDetectorOffsets, WavRangeReduction # Test is giving odd results on Linux, but only this 2D one. diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_TOML.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_TOML.py index 32924f6a88a3..2409c9caff3e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_TOML.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_TOML.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting import mantid # noqa -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( LOQ, Set2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_V2.py index 635804dba9e8..c4bca6535025 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCan2D_V2.py @@ -8,7 +8,7 @@ import systemtesting import mantid # noqa -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( LOQ, Set2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCentreNoGrav.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCentreNoGrav.py index 536edefba6ce..09ae8e765701 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCentreNoGrav.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQCentreNoGrav.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import ( AssignCan, AssignSample, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQLegacyUserFile.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQLegacyUserFile.py index 4217cd75ab75..159d2239d53c 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQLegacyUserFile.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQLegacyUserFile.py @@ -7,7 +7,7 @@ import systemtesting from mantid import FileFinder from sans.common.enums import SANSInstrument -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import LOQ, UseCompatibilityMode, BatchReduce from mantid.simpleapi import GroupWorkspaces diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUI.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUI.py index 47efe78ace60..5ebed0059779 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUI.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUI.py @@ -7,7 +7,7 @@ # pylint: disable=attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import FileFinder from mantid.kernel import config import ISISCommandInterface as i diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUITest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUITest_V2.py index e0921df906a5..58513c0cfb67 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUITest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQReductionGUITest_V2.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from sans.command_interface.ISISCommandInterface import UseCompatibilityMode, LOQ, MaskFile, BatchReduce from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQTransFitWorkspace2D.py b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQTransFitWorkspace2D.py index 106f600d3461..fbf1e2cd57f3 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQTransFitWorkspace2D.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LOQ/SANSLOQTransFitWorkspace2D.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import DeleteWorkspace, RenameWorkspace from ISISCommandInterface import ( AssignCan, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt index 5760c626eaa6..6dc31ad104d4 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/CMakeLists.txt @@ -30,4 +30,4 @@ set(SYSTEST_NAMES SANS2DWaveloopsTest_V2.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.ISIS.SANS.SANS2D ${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatch.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatch.py index 11172fabd438..d3884d824ecb 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatch.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatch.py @@ -7,7 +7,7 @@ # pylint: disable=no-init,attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import mtd, FileFinder from mantid.kernel import config from mantid.simpleapi import DeleteWorkspace, Load diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatchTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatchTest_V2.py index 04fa5dff9c34..049919738299 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatchTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DBatchTest_V2.py @@ -7,7 +7,7 @@ # pylint: disable=no-init,attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid import config from mantid.api import FileFinder diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav.py index 0eb83eee55ef..7b5de9f280d1 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import AssignSample, Gravity, MaskFile, SANS2D, Set1D, SetDetectorOffsets, WavRangeReduction from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav_V2.py index d8ad135be181..7e72a09e9d94 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DFrontNoGrav_V2.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting import mantid # noqa -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, MaskFile, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime.py index 3861561288a6..309fe773addc 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import AssignSample, MaskFile, SANS2D, WavRangeReduction from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime_V2.py index 7bb2d8489db2..4aa8334c4f8e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DLimitEventsTime_V2.py @@ -8,7 +8,7 @@ import systemtesting import mantid # noqa -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import SANS2D, MaskFile, AssignSample, WavRangeReduction, UseCompatibilityMode from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod.py index 10815220fb0e..b7bb5e0b2858 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod.py @@ -8,7 +8,7 @@ # test batch mode with sans2d and selecting a period in batch mode import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import AssignSample, Detector, Gravity, MaskFile, SANS2D, Set1D, WavRangeReduction from SANSBatchMode import BatchReduce from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFiles.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFiles.py index 92ec7d1a4428..a31d9ef34152 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFiles.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFiles.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import os import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid import config from ISISCommandInterface import AssignSample, DefaultTrans, Detector, Gravity, MaskFile, SANS2D, Set1D, WavRangeReduction diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFilesTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFilesTest_V2.py index f497a82ef5c7..61070cea3536 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFilesTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriodAddFilesTest_V2.py @@ -9,7 +9,7 @@ import systemtesting import os -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod_V2.py index 6aca5e1b915b..87b1c935c1de 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DMultiPeriod_V2.py @@ -7,7 +7,7 @@ # pylint: disable=no-init,too-few-public-methods import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService, FileFinder from sans.command_interface.ISISCommandInterface import ( diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI.py index 553d7bfd7302..4a06634799a4 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI.py @@ -20,7 +20,7 @@ """ import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import FileFinder from mantid.kernel import config from mantid.simpleapi import RenameWorkspace diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAdded.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAdded.py index 89ea19ae4613..42b879c8ca64 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAdded.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAdded.py @@ -5,7 +5,7 @@ # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=invalid-name -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import mtd from mantid.kernel import config from mantid.simpleapi import DeleteWorkspace, RenameWorkspace diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAddedTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAddedTest_V2.py index c02955bc7d5e..ab610e6e1ba4 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAddedTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUIAddedTest_V2.py @@ -14,7 +14,7 @@ import systemtesting import os -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService from mantid.kernel import config from mantid.simpleapi import DeleteWorkspace diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI_V2.py index 12ae40233a48..8955625d1d44 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReductionGUI_V2.py @@ -11,7 +11,7 @@ """ import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.simpleapi import RenameWorkspace from sans.command_interface.ISISCommandInterface import ( diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReloadWorkspaces.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReloadWorkspaces.py index 921a65d5b8a4..ef9e6ca96424 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReloadWorkspaces.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DReloadWorkspaces.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=invalid-name,no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import mtd from mantid.kernel import config from mantid.simpleapi import CloneWorkspace, Load, LoadNexus, MoveInstrumentComponent, RenameWorkspace diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSearchCentreGUI.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSearchCentreGUI.py index be5cf9d789a2..1ead1d15b5f3 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSearchCentreGUI.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSearchCentreGUI.py @@ -13,7 +13,7 @@ import isis_reduction_steps import SANS2DReductionGUI as sansgui -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.common.enums import SANSInstrument diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicing.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicing.py index b261da95ad1a..818082388f9d 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicing.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicing.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import mtd, RenameWorkspace, FileFinder import ISISCommandInterface as i diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicingTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicingTest_V2.py index 1b8890e80186..84890fbc3365 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicingTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DSlicingTest_V2.py @@ -7,7 +7,7 @@ # pylint: disable=invalid-name,attribute-defined-outside-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService, FileFinder from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeCalibrationTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeCalibrationTest.py index 3278a2b6180f..ead458f7f875 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeCalibrationTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeCalibrationTest.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.common.enums import SANSInstrument from mantid.api import AnalysisDataService diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeMergeTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeMergeTest.py index c5069361086d..c9a3f661231c 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeMergeTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DTubeMergeTest.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.common.enums import SANSInstrument from mantid.simpleapi import SANSTubeMerge diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloops.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloops.py index 1ce287c99c08..fc745aba8495 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloops.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloops.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import ( AssignCan, AssignSample, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloopsTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloopsTest_V2.py index 213c32c94367..6ac60eb45c82 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloopsTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2DWaveloopsTest_V2.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, MaskFile, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_12m_cycle_22_02.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_12m_cycle_22_02.py index 4fda09b3a586..7fcf92a5a076 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_12m_cycle_22_02.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_12m_cycle_22_02.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py index d81ef810bac9..8b1bec97dbf1 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import platform import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_empty_cycle_22_02.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_empty_cycle_22_02.py index 943fd9222db1..ac1ad60c8168 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_empty_cycle_22_02.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_empty_cycle_22_02.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_glassy_carbon_cycle_22_02.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_glassy_carbon_cycle_22_02.py index d86d971eaf7e..e7b9539cf54e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_glassy_carbon_cycle_22_02.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_glassy_carbon_cycle_22_02.py @@ -6,7 +6,7 @@ # SPDX - License - Identifier: GPL - 3.0 + import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( SANS2D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt index 8635f814c851..a100d9679078 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/CMakeLists.txt @@ -20,4 +20,4 @@ set(SYSTEST_NAMES SANSWorkspaceTypeTest.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.ISIS.SANS.WORKFLOWS ${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBatchReductionTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBatchReductionTest.py index 4d001a22b27a..3430782f20f0 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBatchReductionTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBatchReductionTest.py @@ -10,7 +10,7 @@ import systemtesting from systemtesting import MantidSystemTest -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid import config from mantid.api import AnalysisDataService diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBeamCentreFinderCoreTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBeamCentreFinderCoreTest.py index c24abff7fbfa..78dcab4d8b1d 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBeamCentreFinderCoreTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSBeamCentreFinderCoreTest.py @@ -11,7 +11,7 @@ import systemtesting import mantid -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AlgorithmManager from sans.state.Serializer import Serializer diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSCentreSample.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSCentreSample.py index 887b50a3426f..b2fbdf38f411 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSCentreSample.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSCentreSample.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import ( AssignSample, Detector, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDarkRunSubtractionTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDarkRunSubtractionTest.py index 71d824e7f09d..60daf1c178e6 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDarkRunSubtractionTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDarkRunSubtractionTest.py @@ -10,7 +10,7 @@ # pylint: disable=too-many-public-methods import unittest import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AlgorithmManager from mantid.kernel import config from isis_reduction_steps import DarkRunSubtraction diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDiagnosticPageTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDiagnosticPageTest.py index 84c906b4f4aa..aa4250887c2e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDiagnosticPageTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSDiagnosticPageTest.py @@ -13,7 +13,7 @@ import systemtesting import mantid -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.gui_logic.presenter.diagnostic_presenter import DiagnosticsPagePresenter from sans.state.StateObjects.StateData import get_data_builder diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSFileChecking.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSFileChecking.py index 5926d698dfc1..6272ae49cf18 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSFileChecking.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSFileChecking.py @@ -12,7 +12,7 @@ import unittest import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import ExperimentInfo from mantid.kernel import config import SANSUtility as su diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLOWCentreNoGrav_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLOWCentreNoGrav_V2.py index b50f86b155f0..881a16aab3a5 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLOWCentreNoGrav_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLOWCentreNoGrav_V2.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting import mantid # noqa -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from sans.command_interface.ISISCommandInterface import ( LOQ, Set1D, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py index 0191dd6345e0..6c6cdf910871 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadTest.py @@ -8,7 +8,7 @@ import unittest import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.dataobjects import Workspace2D, EventWorkspace from mantid.api import AnalysisDataService, AlgorithmManager diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadersTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadersTest.py index 98fe472d5491..a74ad25f0d92 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadersTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSLoadersTest.py @@ -14,7 +14,7 @@ import os import unittest import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import config from mantid.simpleapi import Load import isis_reduction_steps as steps diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest.py index 5ce770c522a9..fdc179bc851e 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest.py @@ -5,7 +5,7 @@ # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=invalid-name -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import DeleteWorkspace, mtd import ISISCommandInterface as i import systemtesting diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest_V2.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest_V2.py index 4e3f4b373984..ec9521e4d9cb 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest_V2.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSMergedDetectorsTest_V2.py @@ -7,7 +7,7 @@ # pylint: disable=invalid-name import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.simpleapi import DeleteWorkspace, mtd from sans.command_interface.ISISCommandInterface import ( SANS2DTUBES, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSQResolutionTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSQResolutionTest.py index 724c665cfff1..850935c9fd4a 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSQResolutionTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSQResolutionTest.py @@ -7,7 +7,7 @@ # pylint: disable=no-init import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from ISISCommandInterface import ( set_q_resolution_a1, set_q_resolution_a2, diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py index e2ac7645f88c..cb42e54f1123 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSReductionCoreTest.py @@ -11,7 +11,7 @@ import systemtesting import mantid -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AlgorithmManager from sans.state.Serializer import Serializer diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSSingleReductionTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSSingleReductionTest.py index 177642f6714a..023679c1e791 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSSingleReductionTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSSingleReductionTest.py @@ -11,7 +11,7 @@ import systemtesting from systemtesting import MantidSystemTest -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid import config from mantid.api import AlgorithmManager, WorkspaceGroup from sans.common.constants import EMPTY_NAME diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSUtilityTest.py b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSUtilityTest.py index 7300212c96c9..394c32c60083 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSUtilityTest.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/WORKFLOWS/SANSUtilityTest.py @@ -7,7 +7,7 @@ # pylint: disable=invalid-name,no-init,too-few-public-methods import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.kernel import logger from mantid.simpleapi import Load import SANSUtility as su diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt index a8e2d6f35c15..be2566b3a9ee 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/ZOOM/CMakeLists.txt @@ -11,4 +11,4 @@ set(SYSTEST_NAMES ZOOMWavLoopsTest.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.ISIS.SANS.ZOOM ${SYSTEST_NAMES}) diff --git a/Testing/SystemTests/tests/framework/LoadTest.py b/Testing/SystemTests/tests/framework/LoadTest.py index 7386a0f9aa21..04bcc8c1c09c 100644 --- a/Testing/SystemTests/tests/framework/LoadTest.py +++ b/Testing/SystemTests/tests/framework/LoadTest.py @@ -12,7 +12,7 @@ """ import systemtesting -from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest +from isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService, IEventWorkspace, MatrixWorkspace, WorkspaceGroup from mantid.simpleapi import Load diff --git a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt index abfbae28f33e..8918a97f166f 100644 --- a/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/PolarizationCorrections/CMakeLists.txt @@ -4,4 +4,4 @@ set(SYSTEST_NAMES DepolarizedAnalyserTransmissionTest.py FlipperEfficiencyTest.p PolarizerEfficiencyTest.py ) -pysystemtest_add_test(${SYSTEST_NAMES}) +pysystemtest_add_test(${CMAKE_CURRENT_SOURCE_DIR} framework.PolarizationCorrections ${SYSTEST_NAMES}) From 50946ecd34ae990a593e2c75f8e53a1b294feba7 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 7 Jul 2025 11:35:38 +0100 Subject: [PATCH 22/27] Refactor test adding methods RE #34850 --- buildconfig/CMake/PyUnitTest.cmake | 49 ++++++++++++++++-------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index d44e1a4adde1..6df201d1c8fc 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -5,6 +5,31 @@ # test. This directory is added to the PYTHONPATH when tests are executed _testname_prefix :: A prefix for each test # that is added to ctest, the name will be ${_testname_prefix}_TestName ${ARGN} :: List of test files function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) + if(NOT PYUNITTEST_RUNNER) + set(_test_runner_module ${CMAKE_SOURCE_DIR}/Framework/PythonInterface/test/testhelpers/testrunner.py) + else() + set(_test_runner_module ${PYUNITTEST_RUNNER}) + endif() + + py_add_test("UnitTest" ${_test_runner_module} ${ARGV}) + +endfunction() + +# PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module +# This adds the named system test do they can be run individually +function(PYSYSTEMTEST_ADD_TEST _test_src_dir _testname_prefix) + if(NOT PYSYSTEMTEST_RUNNER) + set(_systest_runner ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) + else() + set(_systest_runner ${PYSYSTEMTEST_RUNNER}) + endif() + py_add_test("SystemTest" ${_systest_runner} ${ARGV}) + +endfunction() + +# PY_ADD_TEST is used by the above test-adding methods. It SHOULD NOT be used directly in CMakeLists.txt files. Use +# PYSYSTEMTEST_ADD_TEST or PYUNITTEST_ADD_TEST instead. +function(PY_ADD_TEST _test_type _test_runner_module _test_src_dir _testname_prefix) # Property for the module directory if(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR MATCHES "Xcode") set(_module_dir ${CMAKE_BINARY_DIR}/bin/$) @@ -12,12 +37,6 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) set(_module_dir ${CMAKE_BINARY_DIR}/bin) endif() - if(NOT PYUNITTEST_RUNNER) - set(_test_runner_module ${CMAKE_SOURCE_DIR}/Framework/PythonInterface/test/testhelpers/testrunner.py) - else() - set(_test_runner_module ${PYUNITTEST_RUNNER}) - endif() - # Environment if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set(_python_path ${_test_src_dir};${PYUNITTEST_PYTHONPATH_EXTRA};$ENV{PYTHONPATH};${_module_dir}) @@ -63,7 +82,7 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) # Set the PYTHONPATH so that the built modules can be found set_tests_properties( ${_pyunit_separate_name} PROPERTIES ENVIRONMENT "${_test_environment}" TIMEOUT ${TESTING_TIMEOUT} LABELS - "UnitTest" + ${_test_type} ) if(PYUNITTEST_RUN_SERIAL) set_tests_properties(${_pyunit_separate_name} PROPERTIES RUN_SERIAL 1) @@ -71,22 +90,6 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) endforeach(part ${ARGN}) endfunction() -# PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module -# This adds the named system test do they can be run individually - -function(PYSYSTEMTEST_ADD_TEST _test_src_dir _testname_prefix) - if(NOT PYUNITTEST_RUNNER) - set(PYUNITTEST_RUNNER ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) - pyunittest_add_test(${ARGV}) - unset(PYUNITTEST_RUNNER) - else() - set(_temp_unit_runner ${PYUNITTEST_RUNNER}) - set(PYUNITTEST_RUNNER ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) - pyunittest_add_test(${ARGV}) - set(PYUNITTEST_RUNNER ${_temp_unit_runner}) - endif() -endfunction() - # Defines a macro to check that each file contains a call to unittest.main() The arguments should be the source # directory followed by the test files as list, e.g. check_tests_valid ( ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_FILES} ) # From 01f6aa53fecd934ce4f4d069a04920188723a6a7 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 7 Jul 2025 12:12:56 +0100 Subject: [PATCH 23/27] Remove the no-update scripts RE #34850 --- Testing/SystemTests/scripts/CMakeLists.txt | 7 -- .../scripts/systemtest_no_update.bat.in | 77 ------------------- .../scripts/systemtest_no_update.in | 75 ------------------ buildconfig/CMake/PyUnitTest.cmake | 4 +- 4 files changed, 2 insertions(+), 161 deletions(-) delete mode 100644 Testing/SystemTests/scripts/systemtest_no_update.bat.in delete mode 100755 Testing/SystemTests/scripts/systemtest_no_update.in diff --git a/Testing/SystemTests/scripts/CMakeLists.txt b/Testing/SystemTests/scripts/CMakeLists.txt index 3c938a477861..6b6d284366b0 100644 --- a/Testing/SystemTests/scripts/CMakeLists.txt +++ b/Testing/SystemTests/scripts/CMakeLists.txt @@ -38,10 +38,3 @@ if(MSVC) else() configure_file(${CMAKE_CURRENT_LIST_DIR}/systemtest.in ${CMAKE_BINARY_DIR}/systemtest @ONLY) endif() -if(MSVC) - configure_file( - ${CMAKE_CURRENT_LIST_DIR}/systemtest_no_update.bat.in ${CMAKE_BINARY_DIR}/systemtest_no_update.bat @ONLY - ) -else() - configure_file(${CMAKE_CURRENT_LIST_DIR}/systemtest_no_update.in ${CMAKE_BINARY_DIR}/systemtest_no_update @ONLY) -endif() diff --git a/Testing/SystemTests/scripts/systemtest_no_update.bat.in b/Testing/SystemTests/scripts/systemtest_no_update.bat.in deleted file mode 100644 index 1b667fd1491c..000000000000 --- a/Testing/SystemTests/scripts/systemtest_no_update.bat.in +++ /dev/null @@ -1,77 +0,0 @@ -:: Mantid Repository : https://github.com/mantidproject/mantid -:: -:: Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, -:: NScD Oak Ridge National Laboratory, European Spallation Source, -:: Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS -:: SPDX - License - Identifier: GPL - 3.0 + -@echo off -:: Wrapper script to launch the system tests for a development build. -:: -:: It uses the python, with the mantid framework on the pythonpath, to run the tests. -:: All arguments to this script are forwarded to the test runner. - -set PYTHON_EXE=@PYTHON_EXECUTABLE@ -set RUNNER_SCRIPT=@SYSTEMTESTS_RUNNER_SCRIPT@ -set MULTI_CONFIG_GENERATOR=@MULTI_CONFIG_GENERATOR@ -set BIN_DIR=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ - - -:: Print usage -if [%1]==[-h] ( - goto usage - goto end -) - -:: Are there enough arguments -if "%MULTI_CONFIG_GENERATOR%" == "true" ( - if [%1] EQU [-C] ( - if [%2] NEQ [] ( - set PYTHONPATH=%PYTHONPATH%;%BIN_DIR%\%2\ - ) else ( - echo -C requires a config argument - echo. - echo Use -h for full usage - goto error - ) - ) else ( - echo Multi-configuration build requires -C ^ to specify test configuration - echo. - echo Use -h for full usage - goto error - ) -) else ( - if [%1] EQU [-C] ( - echo Ninja builds do not require you to specify a configuration -C. - echo. - echo Use -h for full usage - goto error - ) else ( - set PYTHONPATH=%PYTHONPATH%;%BIN_DIR%\ - ) -) - -:: Execute -echo. -echo Running tests... -if "%MULTI_CONFIG_GENERATOR%" == "true" ( - %PYTHON_EXE% %RUNNER_SCRIPT% --executable=%PYTHON_EXE% --exec-args= %3 %4 %5 %6 %7 %8 %9 -) else ( - %PYTHON_EXE% %RUNNER_SCRIPT% --executable=%PYTHON_EXE% --exec-args= %1 %2 %3 %4 %5 %6 %7 -) -goto end - -:: -------- Functions --------- - -:usage -echo systemtest.bat -C ^ ^[arg1^] ^[arg2^] ... -echo. -echo ^ is one ^[Release^|Debug^|RelWithDebInfo^|DebugWithRelRuntime^|MinSizeRelease^] -echo All arguments after ^ are passed to the runSystemTest.py script -%PYTHON_EXE% %RUNNER_SCRIPT% -h -goto:eof - -:end -exit /b 0 - -:error -exit /b 1 diff --git a/Testing/SystemTests/scripts/systemtest_no_update.in b/Testing/SystemTests/scripts/systemtest_no_update.in deleted file mode 100755 index 84bca029af15..000000000000 --- a/Testing/SystemTests/scripts/systemtest_no_update.in +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Mantid Repository : https://github.com/mantidproject/mantid -# -# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, -# NScD Oak Ridge National Laboratory, European Spallation Source, -# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS -# SPDX - License - Identifier: GPL - 3.0 + -# Wrapper script to launch the system tests for a development build. -# -# It uses the python launch script to run the tests. All arguments to -# this script are forwarded to the test runner. - -@JEMALLOC_DEFINITIONS@ - -PYTHON_EXE=@PYTHON_EXECUTABLE@ -RUNNER_SCRIPT=@SYSTEMTESTS_RUNNER_SCRIPT@ -MULTI_CONFIG_GENERATOR=@MULTI_CONFIG_GENERATOR@ -BIN_DIR=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@ - -function usage() { - if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then - echo "systemtest -C [arg1] [arg2] ..." - echo - echo " is one [Release|Debug|RelWithDebInfo|MinSizeRelease]" - echo "All arguments after are passed to the runSystemTest.py script" - else - echo "systemtest [arg1] [arg2] ..." - echo - echo "All arguments are passed to the runSystemTest.py script" - fi - $PYTHON_EXE $RUNNER_SCRIPT -h -} - -# Sets the LOACL_PYTHONPATH variable -function setup_python_path() { - if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then - if [ "$1" == "-C" ]; then - if [ -n "$2" ]; then - LOCAL_PYTHONPATH=$BIN_DIR/$2/ - else - echo "-C requires a config argument" - usage - exit 1 - fi - else - echo "Multi-configuration build requires -C to specify test configuration" - usage - exit 1 - fi - else - LOCAL_PYTHONPATH=$BIN_DIR/ - fi -} - -if [ "$1" == "-h" ]; then - usage - exit 0 -fi - -# For multi-config generators the bin folder has a config-dependent subdirectory -LOCAL_PYTHONPATH="" -setup_python_path $1 $2 -CMAKE_TARGET_ARG="" -if [ "$MULTI_CONFIG_GENERATOR" == "true" ]; then - shift 2 - CMAKE_TARGET_ARG="-target" -fi - -# Execute -echo -echo "Running tests..." -LD_PRELOAD=${LOCAL_PRELOAD} \ - PYTHONPATH=${LOCAL_PYTHONPATH} \ - python3 $RUNNER_SCRIPT \ - --executable="python3" --exec-args= "$@" diff --git a/buildconfig/CMake/PyUnitTest.cmake b/buildconfig/CMake/PyUnitTest.cmake index 6df201d1c8fc..493dfc74074d 100644 --- a/buildconfig/CMake/PyUnitTest.cmake +++ b/buildconfig/CMake/PyUnitTest.cmake @@ -15,8 +15,8 @@ function(PYUNITTEST_ADD_TEST _test_src_dir _testname_prefix) endfunction() -# PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the unittest module -# This adds the named system test do they can be run individually +# PYSYSTEMTEST_ADD_TEST (public macro to add system tests) Adds a set of python tests based upon the MantidSystemTest +# class. This adds the system test modules (files), rather than the classes, but will run every class in the module. function(PYSYSTEMTEST_ADD_TEST _test_src_dir _testname_prefix) if(NOT PYSYSTEMTEST_RUNNER) set(_systest_runner ${CMAKE_SOURCE_DIR}/Testing/SystemTests/scripts/systestrunner.py) From 269943b5be7628ffe832581eab1ce141e3471f4d Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 7 Jul 2025 17:55:03 +0100 Subject: [PATCH 24/27] Allow tests to fail RE #34850 --- Testing/SystemTests/scripts/systestrunner.py | 16 +++++++++++++++- .../framework/ISIS/SANS/LARMOR/CMakeLists.txt | 2 +- Testing/Temporary/CTestCostData.txt | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Testing/Temporary/CTestCostData.txt diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py index 653f52e05586..cf9bff400951 100644 --- a/Testing/SystemTests/scripts/systestrunner.py +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -98,9 +98,19 @@ def main(argv): escape_quotes=True, ) + results = dict() for test_class_name in test_class_names: script_obj = systemtesting.TestScript(test_dir_name, test_module_name, test_class_name, False) - runner.start_in_current_process(script_obj) + results[test_class_name] = runner.start_in_current_process(script_obj) + + ######################################################################### + # Process Results + ######################################################################### + + failure = False + exit_codes = list(results.values()) + if any(exit_code[0] is not systemtesting.TestRunner.SUCCESS_CODE for exit_code in exit_codes): + failure = True ######################################################################### # Cleanup @@ -109,6 +119,10 @@ def main(argv): # Put the configuration back to its original state mtdconf.restoreconfig() + if failure: + # The lack of details here is due to ctest handling the stdout dump on failures. + raise RuntimeError() + if __name__ == "__main__": main(sys.argv) diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt index 5466728b3e00..5fe85d29c780 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/LARMOR/CMakeLists.txt @@ -1,6 +1,6 @@ # System tests related to the LARMOR instrument at ISIS. -set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML.py SANSLARMORMultiPeriod SANSLARMORMultiPeriod_V2.py +set(SYSTEST_NAMES SANSLARMOR_multiperiod_event_files_TOML.py SANSLARMORMultiPeriod.py SANSLARMORMultiPeriod_V2.py SANSLARMORMultiPeriodAddFiles.py SANSLARMORMultiPeriodAddFilesTest_V2.py ) diff --git a/Testing/Temporary/CTestCostData.txt b/Testing/Temporary/CTestCostData.txt new file mode 100644 index 000000000000..ed97d539c095 --- /dev/null +++ b/Testing/Temporary/CTestCostData.txt @@ -0,0 +1 @@ +--- From 15fc44ffbc295f23be161b5b69e47741c2a2bee0 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Tue, 22 Jul 2025 10:56:16 +0100 Subject: [PATCH 25/27] Fix data paths RE #34850 --- Testing/SystemTests/scripts/systestrunner.py | 10 ++++------ Testing/SystemTests/tests/framework/LoadTest.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py index cf9bff400951..393b5b8debdc 100644 --- a/Testing/SystemTests/scripts/systestrunner.py +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -56,11 +56,9 @@ def main(argv): # Configure mantid ######################################################################### - # Parse files containing the search and save directories, unless otherwise given - data_paths = DATA_DIRS_LIST_PATH - if data_paths is None or data_paths == "": - with open(DATA_DIRS_LIST_PATH, "r") as f_handle: - data_paths = f_handle.read().strip() + # Parse files containing the search and save directories + with open(DATA_DIRS_LIST_PATH, "r") as f_handle: + data_paths = f_handle.read().strip() with open(SAVE_DIR_LIST_PATH, "r") as f_handle: save_dir = f_handle.read().strip() @@ -86,7 +84,7 @@ def main(argv): test_classes = dict(inspect.getmembers(test_module, inspect.isclass)) test_class_names = [test_class for test_class in test_classes if - systemtesting.isValidTestClass(test_classes[test_class])] + systemtesting.isValidTestClass(test_classes[test_class]) and test_class != "MantidSystemTest"] if not test_class_names: raise NameError(f"No test classes found in system test module: {test_module_name}.") diff --git a/Testing/SystemTests/tests/framework/LoadTest.py b/Testing/SystemTests/tests/framework/LoadTest.py index 04bcc8c1c09c..7386a0f9aa21 100644 --- a/Testing/SystemTests/tests/framework/LoadTest.py +++ b/Testing/SystemTests/tests/framework/LoadTest.py @@ -12,7 +12,7 @@ """ import systemtesting -from isis_sans_system_test import ISISSansSystemTest +from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest from mantid.api import AnalysisDataService, IEventWorkspace, MatrixWorkspace, WorkspaceGroup from mantid.simpleapi import Load From ba28bf27af045e3d1f730d6c6d3ce71b4d55ca3d Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Wed, 23 Jul 2025 16:13:24 +0100 Subject: [PATCH 26/27] Output more useful information on failures RE #34850 --- .../lib/systemtests/systemtesting.py | 34 +++++++++++-------- Testing/SystemTests/scripts/systestrunner.py | 15 +++++--- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Testing/SystemTests/lib/systemtests/systemtesting.py b/Testing/SystemTests/lib/systemtests/systemtesting.py index 8147caf83036..051714ba5ffb 100644 --- a/Testing/SystemTests/lib/systemtests/systemtesting.py +++ b/Testing/SystemTests/lib/systemtests/systemtesting.py @@ -814,21 +814,7 @@ def execute(self, runner, exclude_in_pr_builds): self._result.date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") self._result.addItem(["test_date", self._result.date]) - if retcode == TestRunner.SUCCESS_CODE: - status = "success" - elif retcode == TestRunner.GENERIC_FAIL_CODE: - # This is most likely an algorithm failure, but it's not certain - status = "algorithm failure" - elif retcode == TestRunner.VALIDATION_FAIL_CODE: - status = "failed validation" - elif retcode == TestRunner.SEGFAULT_CODE: - status = "crashed" - elif retcode == TestRunner.SKIP_TEST: - status = "skipped" - elif retcode < 0: - status = "hung" - else: - status = "unknown" + status = exit_code_to_str(retcode) # Check return code and add result self._result.status = status if status in ["success", "skipped"] else "failed" @@ -1306,6 +1292,24 @@ def restoreconfig(self): self.__moveFile(self.__userPropsFile, self.__userPropsFileSystest) self.__moveFile(self.__userPropsFileBackup, self.__userPropsFile) +def exit_code_to_str(exit_code): + if exit_code < 0: + return "hung" + match exit_code: + case TestRunner.SUCCESS_CODE: + return "success" + case TestRunner.GENERIC_FAIL_CODE: + # This is most likely an algorithm failure, but it's not certain + return "algorithm failure" + case TestRunner.VALIDATION_FAIL_CODE: + return "failed validation" + case TestRunner.SEGFAULT_CODE: + return "crashed" + case TestRunner.SKIP_TEST: + return "skipped" + case _: + return"unknown" + ######################################################################### # Function to check if a given class object is a Mantid System Test # that can be run by the TestRunner class. diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py index 393b5b8debdc..844581739116 100644 --- a/Testing/SystemTests/scripts/systestrunner.py +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -12,6 +12,8 @@ import time import importlib.util +from collections import OrderedDict + # Prevents errors in systemtests that use matplotlib directly os.environ["MPLBACKEND"] = "Agg" @@ -96,7 +98,7 @@ def main(argv): escape_quotes=True, ) - results = dict() + results = OrderedDict() for test_class_name in test_class_names: script_obj = systemtesting.TestScript(test_dir_name, test_module_name, test_class_name, False) results[test_class_name] = runner.start_in_current_process(script_obj) @@ -106,8 +108,7 @@ def main(argv): ######################################################################### failure = False - exit_codes = list(results.values()) - if any(exit_code[0] is not systemtesting.TestRunner.SUCCESS_CODE for exit_code in exit_codes): + if any(exit_code is not systemtesting.TestRunner.SUCCESS_CODE for (exit_code, _) in results.values()): failure = True ######################################################################### @@ -118,8 +119,12 @@ def main(argv): mtdconf.restoreconfig() if failure: - # The lack of details here is due to ctest handling the stdout dump on failures. - raise RuntimeError() + results_string = f"FAILURE REPORT FOR TESTS IN {test_file_name}:\n" + for class_name, (exit_code, stdout) in results.items(): + results_string += f"{class_name}: {systemtesting.exit_code_to_str(exit_code)}\n" + if exit_code is not systemtesting.TestRunner.SUCCESS_CODE: + results_string += f"Stdout: {stdout}\n" + raise RuntimeError(results_string) if __name__ == "__main__": From 55767221313bea090772a412723d62cca77b59a5 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Thu, 24 Jul 2025 09:39:20 +0100 Subject: [PATCH 27/27] Skipped != failed RE #34850 --- Testing/SystemTests/scripts/systestrunner.py | 4 +++- Testing/SystemTests/tests/framework/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Testing/SystemTests/scripts/systestrunner.py b/Testing/SystemTests/scripts/systestrunner.py index 844581739116..946e33ce32e4 100644 --- a/Testing/SystemTests/scripts/systestrunner.py +++ b/Testing/SystemTests/scripts/systestrunner.py @@ -108,7 +108,9 @@ def main(argv): ######################################################################### failure = False - if any(exit_code is not systemtesting.TestRunner.SUCCESS_CODE for (exit_code, _) in results.values()): + if any(exit_code is not systemtesting.TestRunner.SUCCESS_CODE and + exit_code is not systemtesting.TestRunner.SKIP_TEST + for (exit_code, _) in results.values()): failure = True ######################################################################### diff --git a/Testing/SystemTests/tests/framework/CMakeLists.txt b/Testing/SystemTests/tests/framework/CMakeLists.txt index 3178de0ab5cc..b9fba21b2e84 100644 --- a/Testing/SystemTests/tests/framework/CMakeLists.txt +++ b/Testing/SystemTests/tests/framework/CMakeLists.txt @@ -1,4 +1,5 @@ -# System tests for the Mantid Framework package. +# System tests for the Mantid Framework package. Files that contain only base classes, and no actual tests, should not +# be added to this list. set(SYSTEST_NAMES AbinsTest.py @@ -38,7 +39,6 @@ set(SYSTEST_NAMES DirectInelasticDiagnostic.py DirectInelasticDiagnostic2.py DistributeProtonChargeTest.py - DocumentationTest.py DOSTest.py DrillProcessTest.py ElasticEMUReductionTest.py