From 678ef626f2461de3bc84c8130f144c5e4a73005b Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Fri, 7 Mar 2025 15:37:56 +0100 Subject: [PATCH] fix: few test simplifications --- src/DIRAC/Core/scripts/dirac_install_db.py | 6 +-- .../tests/Utilities/testJobDefinitions.py | 50 ++++++++----------- tests/CI/run_tests.sh | 8 +-- tests/Jenkins/dirac_ci.sh | 13 ++--- tests/Workflow/Integration/Test_UserJobs.py | 32 +++++------- .../Regression/Test_RegressionUserJobs.py | 10 ++-- 6 files changed, 49 insertions(+), 70 deletions(-) diff --git a/src/DIRAC/Core/scripts/dirac_install_db.py b/src/DIRAC/Core/scripts/dirac_install_db.py index b66f10c526f..a032aa5709f 100755 --- a/src/DIRAC/Core/scripts/dirac_install_db.py +++ b/src/DIRAC/Core/scripts/dirac_install_db.py @@ -26,12 +26,12 @@ def main(): for db in args: result = gComponentInstaller.installDatabase(db) if not result["OK"]: - gLogger.error(f"ERROR: failed to correctly install {db}", result["Message"]) + gLogger.error(f"Failed to correctly install {db}:", result["Message"]) DIRACExit(1) extension, system = result["Value"] result = gComponentInstaller.addDatabaseOptionsToCS(gConfig, system, db, overwrite=True) if not result["OK"]: - gLogger.error(f"ERROR: failed to add database options to CS: {result['Message']}") + gLogger.error("Failed to add database options to CS:", result["Message"]) DIRACExit(1) if db != "InstalledComponentsDB": @@ -46,7 +46,7 @@ def main(): result = MonitoringUtilities.monitorInstallation("DB", system, db, user=user) if not result["OK"]: - gLogger.error(f"ERROR: failed to register installation in database: {result['Message']}") + gLogger.error("Failed to register installation in database:", result["Message"]) DIRACExit(1) diff --git a/src/DIRAC/tests/Utilities/testJobDefinitions.py b/src/DIRAC/tests/Utilities/testJobDefinitions.py index 6c7156e97ee..65c5e3ad7c2 100644 --- a/src/DIRAC/tests/Utilities/testJobDefinitions.py +++ b/src/DIRAC/tests/Utilities/testJobDefinitions.py @@ -59,7 +59,7 @@ def helloWorld(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") return endOfAllJobs(J) @@ -74,7 +74,7 @@ def helloWorldJenkins(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("DIRAC.Jenkins.ch") return endOfAllJobs(J) @@ -90,9 +90,7 @@ def helloWorld_input(): try: J.setInputSandbox([find_all("exe-script-with-input.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox( - [find_all("exe-script-with-input.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]] - ) + J.setInputSandbox([find_all("exe-script-with-input.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script-with-input.py", "", "helloWorld.log") return endOfAllJobs(J) @@ -108,11 +106,7 @@ def helloWorld_input_single(): J.setInputSandbox([find_all("exe-script-with-input-single-location.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins J.setInputSandbox( - [ - find_all( - "exe-script-with-input-single-location.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow" - )[0] - ] + [find_all("exe-script-with-input-single-location.py", "/home/dirac", "DIRAC/tests/Workflow")[0]] ) J.setExecutable("exe-script-with-input-single-location.py", "", "helloWorld.log") return endOfAllJobs(J) @@ -128,7 +122,7 @@ def helloWorldCERN(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.CERN.cern") return endOfAllJobs(J) @@ -144,7 +138,7 @@ def helloWorldNCBJ(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.NCBJ.pl") return endOfAllJobs(J) @@ -160,7 +154,7 @@ def helloWorldGRIDKA(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.GRIDKA.de") return endOfAllJobs(J) @@ -176,7 +170,7 @@ def helloWorldRAL(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.RAL.uk") return endOfAllJobs(J) @@ -192,7 +186,7 @@ def helloWorldPIC(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.PIC.es") return endOfAllJobs(J) @@ -208,7 +202,7 @@ def helloWorldRALPP(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.UKI-SOUTHGRID-RALPP.uk") return endOfAllJobs(J) @@ -224,7 +218,7 @@ def helloWorldGRIF(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("LCG.GRIF.fr") return endOfAllJobs(J) @@ -240,7 +234,7 @@ def helloWorldSSHBatch(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("DIRAC.Jenkins_SSHBatch.ch") return endOfAllJobs(J) @@ -256,7 +250,7 @@ def helloWorldARM(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setDestination("DIRAC.ARM.ch") return endOfAllJobs(J) @@ -272,7 +266,7 @@ def helloWorldCloudCE(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setExecutable("exe-script.py", "", "helloWorldCloud.log") J.setDestinationCE("stealthcloud.ic.ac.uk", "LCG.UKI-LT2-IC-HEP.uk") return endOfAllJobs(J) @@ -288,7 +282,7 @@ def mpJob(): try: J.setInputSandbox([find_all("mpTest.py", ".", "DIRAC/tests/Utilities")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("mpTest.py", os.environ["WORKSPACE"], "DIRAC/tests/Utilities")[0]]) + J.setInputSandbox([find_all("mpTest.py", "/home/dirac", "DIRAC/tests/Utilities")[0]]) J.setExecutable("mpTest.py") J.setTag(["4Processors", "MultiProcessor"]) @@ -305,7 +299,7 @@ def mp3Job(): try: J.setInputSandbox([find_all("mpTest.py", ".", "DIRAC/tests/Utilities")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("mpTest.py", os.environ["WORKSPACE"], "DIRAC/tests/Utilities")[0]]) + J.setInputSandbox([find_all("mpTest.py", "/home/dirac", "DIRAC/tests/Utilities")[0]]) J.setExecutable("mpTest.py") J.setNumberOfProcessors(numberOfProcessors=3) @@ -322,7 +316,7 @@ def min2max4Job(): try: J.setInputSandbox([find_all("mpTest.py", ".", "DIRAC/tests/Utilities")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("mpTest.py", os.environ["WORKSPACE"], "DIRAC/tests/Utilities")[0]]) + J.setInputSandbox([find_all("mpTest.py", "/home/dirac", "DIRAC/tests/Utilities")[0]]) J.setExecutable("mpTest.py") J.setNumberOfProcessors(minNumberOfProcessors=2, maxNumberOfProcessors=4) @@ -339,7 +333,7 @@ def wholeNodeJob(): try: J.setInputSandbox([find_all("mpTest.py", ".", "DIRAC/tests/Utilities")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("mpTest.py", os.environ["WORKSPACE"], "DIRAC/tests/Utilities")[0]]) + J.setInputSandbox([find_all("mpTest.py", "/home/dirac", "DIRAC/tests/Utilities")[0]]) J.setExecutable("mpTest.py") J.setTag(["WholeNode", "MultiProcessor"]) @@ -356,7 +350,7 @@ def parametricJob(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setParameterSequence("args", ["one", "two", "three"]) J.setParameterSequence("iargs", [1, 2, 3]) J.setExecutable("exe-script.py", arguments=": testing %(args)s %(iargs)s", logFile="helloWorld_%n.log") @@ -373,7 +367,7 @@ def parametricJobInputData(): try: J.setInputSandbox([find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]]) except IndexError: # we are in Jenkins - J.setInputSandbox([find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]]) + J.setInputSandbox([find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]]) J.setParameterSequence("args", ["one", "two", "three"]) J.setParameterSequence("iargs", [1, 2, 3]) J.setParameterSequence( @@ -404,7 +398,7 @@ def jobWithOutput(): try: inp2 = [find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]] except IndexError: # we are in Jenkins - inp2 = [find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]] + inp2 = [find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]] J.setInputSandbox(inp1 + inp2) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setOutputData([timenow + "testFileUpload.txt"]) @@ -434,7 +428,7 @@ def jobWithOutputs(): try: inp2 = [find_all("exe-script.py", ".", "DIRAC/tests/Workflow")[0]] except IndexError: # we are in Jenkins - inp2 = [find_all("exe-script.py", os.environ["WORKSPACE"], "DIRAC/tests/Workflow")[0]] + inp2 = [find_all("exe-script.py", "/home/dirac", "DIRAC/tests/Workflow")[0]] J.setInputSandbox(inp1 + inp2) J.setExecutable("exe-script.py", "", "helloWorld.log") J.setOutputData([timenow + "testFileUpload.txt"], outputSE=["RAL-SE", "IN2P3-SE"]) diff --git a/tests/CI/run_tests.sh b/tests/CI/run_tests.sh index b7040539a62..66bcbe42a71 100755 --- a/tests/CI/run_tests.sh +++ b/tests/CI/run_tests.sh @@ -25,7 +25,7 @@ echo -e "*** $(date -u) **** Starting integration tests on ${INSTALLTYPE} ****\n if [[ "$INSTALLTYPE" == "server" ]]; then # shellcheck source=/dev/null - source "$WORKSPACE/ServerInstallDIR/bashrc" + source /home/dirac/ServerInstallDIR/bashrc # If not unset, assert will not trigger unset PYTHONOPTIMIZE # shellcheck disable=SC2034 @@ -34,14 +34,14 @@ if [[ "$INSTALLTYPE" == "server" ]]; then ERR=0 for repo_path in "${TESTREPO[@]}"; do # TODO: The tests should be refactored to remove the need for this - cp -r "${repo_path}/tests" "$WORKSPACE/ServerInstallDIR/$(basename "${repo_path}")" + cp -r "${repo_path}/tests" "/home/dirac/ServerInstallDIR/$(basename "${repo_path}")" done for repo_path in "${TESTREPO[@]}"; do source "${repo_path}/tests/Integration/all_integration_server_tests.sh" done elif [[ "$INSTALLTYPE" == "client" ]]; then # shellcheck source=/dev/null - source "$WORKSPACE/ClientInstallDIR/bashrc" + source /home/dirac/ClientInstallDIR/bashrc # If not unset, assert will not trigger unset PYTHONOPTIMIZE set -o pipefail @@ -52,7 +52,7 @@ elif [[ "$INSTALLTYPE" == "client" ]]; then elif [[ "$INSTALLTYPE" == "pilot" ]]; then # shellcheck source=/dev/null - source "$WORKSPACE/bashrc" + source /home/dirac/bashrc # If not unset, assert will not trigger unset PYTHONOPTIMIZE set -o pipefail diff --git a/tests/Jenkins/dirac_ci.sh b/tests/Jenkins/dirac_ci.sh index e9bf3e61562..306597b0781 100644 --- a/tests/Jenkins/dirac_ci.sh +++ b/tests/Jenkins/dirac_ci.sh @@ -18,7 +18,6 @@ # # === optional environment variables: # -# WORKSPACE (/home/dirac) # DEBUG (set it to whatever value to turn on debug messages) # # DIRAC_RELEASE (for installing a specific release) @@ -52,18 +51,12 @@ else DEBUG='-dd' fi -if [[ "$WORKSPACE" ]]; then - echo "==> We are in Jenkins I guess" -else - WORKSPACE=$PWD -fi - # Creating default structure -mkdir -p "$WORKSPACE/TestCode" # Where the test code resides +mkdir -p /home/dirac/TestCode # Where the test code resides TESTCODE=${_} -mkdir -p "$WORKSPACE/ServerInstallDIR" # Where servers are installed +mkdir -p /home/dirac/ServerInstallDIR # Where servers are installed SERVERINSTALLDIR=${_} -mkdir -p "$WORKSPACE/ClientInstallDIR" # Where clients are installed +mkdir -p /home/dirac/ClientInstallDIR # Where clients are installed CLIENTINSTALLDIR=${_} # Location of the CFG file to be used (this can be replaced by the extensions) diff --git a/tests/Workflow/Integration/Test_UserJobs.py b/tests/Workflow/Integration/Test_UserJobs.py index 296b14976a8..e8df2eeeed8 100644 --- a/tests/Workflow/Integration/Test_UserJobs.py +++ b/tests/Workflow/Integration/Test_UserJobs.py @@ -34,10 +34,10 @@ def setUp(self): self.mpExe = find_all("mpTest.py", rootPath, "/DIRAC/tests/Utilities")[0] self.mpExeFlex = find_all("mpTest-flexible.py", rootPath, "/DIRAC/tests/Utilities")[0] except IndexError: # we are in Jenkins - self.exeScriptLocation = find_all("exe-script.py", os.environ["WORKSPACE"], integration_test_dir)[0] - self.helloWorld = find_all("helloWorld.py", os.environ["WORKSPACE"], integration_test_dir)[0] - self.mpExe = find_all("mpTest.py", os.environ["WORKSPACE"], "/DIRAC/tests/Utilities")[0] - self.mpExeFlex = find_all("mpTest-flexible.py", os.environ["WORKSPACE"], "/DIRAC/tests/Utilities")[0] + self.exeScriptLocation = find_all("exe-script.py", "/home/dirac", integration_test_dir)[0] + self.helloWorld = find_all("helloWorld.py", "/home/dirac", integration_test_dir)[0] + self.mpExe = find_all("mpTest.py", "/home/dirac", "/DIRAC/tests/Utilities")[0] + self.mpExeFlex = find_all("mpTest-flexible.py", "/home/dirac", "/DIRAC/tests/Utilities")[0] gLogger.setLevel("DEBUG") @@ -51,7 +51,7 @@ def test_execute(self): j.setLogLevel("DEBUG") try: # This is the standard location in Jenkins - j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + j.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") @@ -90,7 +90,7 @@ def test_execute(self): job.setLogLevel("DEBUG") try: # This is the standard location in Jenkins - job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + job.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): job.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) job.setConfigArgs("pilot.cfg") @@ -125,7 +125,7 @@ def test_execute_success(self): job.setLogLevel("DEBUG") try: # This is the standard location in Jenkins - job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + job.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): job.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) job.setConfigArgs("pilot.cfg") @@ -144,8 +144,7 @@ def test_execute(self): job.setExecutable("/bin/ls", "-l") job.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + job.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): job.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) job.setConfigArgs("pilot.cfg") @@ -163,8 +162,7 @@ def test_execute(self): job.setExecutable("/bin/ls", "-l") job.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + job.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): job.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) job.setConfigArgs("pilot.cfg") @@ -186,8 +184,7 @@ def test_fixed(self): j.setNumberOfProcessors(4) # This requires a fixed number of processors j.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + j.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") @@ -213,8 +210,7 @@ def test_min2(self): j.setNumberOfProcessors(minNumberOfProcessors=2) # This requires at least 2 processors j.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + j.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") @@ -232,8 +228,7 @@ def test_min2max4(self): j.setNumberOfProcessors(minNumberOfProcessors=2, maxNumberOfProcessors=4) # This requires 2 to 4 processors j.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + j.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") @@ -251,8 +246,7 @@ def test_min1(self): j.setNumberOfProcessors(minNumberOfProcessors=1) # This requires 1 to infinite processors j.setLogLevel("DEBUG") try: - # This is the standard location in Jenkins - j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"])[0]) + j.setInputSandbox(find_all("pilot.cfg", "/home/dirac")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") diff --git a/tests/Workflow/Regression/Test_RegressionUserJobs.py b/tests/Workflow/Regression/Test_RegressionUserJobs.py index cd1f20b7645..bbedb6e22d0 100644 --- a/tests/Workflow/Regression/Test_RegressionUserJobs.py +++ b/tests/Workflow/Regression/Test_RegressionUserJobs.py @@ -30,8 +30,8 @@ def setUp(self): exeScriptLoc = find_all("exe-script.py", rootPath, "/DIRAC/tests/Workflow")[0] helloWorldLoc = find_all("helloWorld.py", rootPath, "/DIRAC/tests/Workflow")[0] except IndexError: # we are in Jenkins - exeScriptLoc = find_all("exe-script.py", os.environ["WORKSPACE"], "/DIRAC/tests/Workflow")[0] - helloWorldLoc = find_all("helloWorld.py", os.environ["WORKSPACE"], "/DIRAC/tests/Workflow")[0] + exeScriptLoc = find_all("exe-script.py", "/home/dirac", "/DIRAC/tests/Workflow")[0] + helloWorldLoc = find_all("helloWorld.py", "/home/dirac", "/DIRAC/tests/Workflow")[0] shutil.copyfile(exeScriptLoc, "./exe-script.py") shutil.copyfile(helloWorldLoc, "./helloWorld.py") @@ -39,9 +39,7 @@ def setUp(self): try: helloWorldXMLLocation = find_all("helloWorld.xml", rootPath, "/DIRAC/tests/Workflow/Regression")[0] except IndexError: # we are in Jenkins - helloWorldXMLLocation = find_all( - "helloWorld.xml", os.environ["WORKSPACE"], "/DIRAC/tests/Workflow/Regression" - )[0] + helloWorldXMLLocation = find_all("helloWorld.xml", "/home/dirac", "/DIRAC/tests/Workflow/Regression")[0] self.j_u_hello = Job(helloWorldXMLLocation) self.j_u_hello.setConfigArgs("pilot.cfg") @@ -50,7 +48,7 @@ def setUp(self): helloWorldXMLFewMoreLocation = find_all("helloWorld.xml", rootPath, "/DIRAC/tests/Workflow/Regression")[0] except IndexError: # we are in Jenkins helloWorldXMLFewMoreLocation = find_all( - "helloWorld.xml", os.environ["WORKSPACE"], "/DIRAC/tests/Workflow/Regression" + "helloWorld.xml", "/home/dirac", "/DIRAC/tests/Workflow/Regression" )[0] self.j_u_helloPlus = Job(helloWorldXMLFewMoreLocation)