Skip to content

Commit

Permalink
test: adding support for GA
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Mar 22, 2024
1 parent 8955aac commit 26641dc
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions tests/Workflow/Integration/Test_UserJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def setUp(self):
self.helloWorld = find_all("helloWorld.py", rootPath, integration_test_dir)[0]
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
except IndexError:
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
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]
Expand All @@ -51,7 +53,8 @@ def test_execute(self):
j.setExecutable(self.exeScriptLocation)
j.setLogLevel("DEBUG")
try:
# This is the standard location in Jenkins
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
j.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand Down Expand Up @@ -90,7 +93,8 @@ def test_execute(self):
job.setCPUTime(12345)
job.setLogLevel("DEBUG")
try:
# This is the standard location in Jenkins
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
job.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand Down Expand Up @@ -125,7 +129,8 @@ def test_execute_success(self):
job.setCPUTime(12345)
job.setLogLevel("DEBUG")
try:
# This is the standard location in Jenkins
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
job.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand All @@ -145,7 +150,8 @@ def test_execute(self):
job.setExecutable("/bin/ls", "-l")
job.setLogLevel("DEBUG")
try:
# This is the standard location in Jenkins
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
job.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
job.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand All @@ -166,7 +172,8 @@ 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
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
j.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand All @@ -193,7 +200,8 @@ 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
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
j.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand All @@ -212,7 +220,8 @@ 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
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
j.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand All @@ -231,7 +240,8 @@ 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
if "GITHUB_WORKSPACE" in os.environ:
os.environ["WORKSPACE"] = os.environ["GITHUB_WORKSPACE"]
j.setInputSandbox(find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
except (IndexError, KeyError):
j.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
Expand Down

0 comments on commit 26641dc

Please sign in to comment.