diff --git a/src/DIRAC/tests/Utilities/testJobDefinitions.py b/src/DIRAC/tests/Utilities/testJobDefinitions.py index 3e7e44e0492..cf6fe309076 100644 --- a/src/DIRAC/tests/Utilities/testJobDefinitions.py +++ b/src/DIRAC/tests/Utilities/testJobDefinitions.py @@ -65,6 +65,22 @@ def helloWorld(): return endOfAllJobs(J) +def helloWorldJenkins(): + """simple hello world job to Jenkins""" + + J = baseToAllJobs("helloWorldJenkins") + try: + J.setInputSandbox([find_all("exe-script.py", rootPath, "DIRAC/tests/Workflow")[0]]) + except IndexError: + 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.setExecutable("exe-script.py", "", "helloWorld.log") + J.setDestination("DIRAC.Jenkins.ch") + return endOfAllJobs(J) + + def helloWorldCERN(): """simple hello world job to CERN""" diff --git a/tests/System/unitTestUserJobs.py b/tests/System/unitTestUserJobs.py index 137ac708c41..c874ea85137 100644 --- a/tests/System/unitTestUserJobs.py +++ b/tests/System/unitTestUserJobs.py @@ -1,8 +1,8 @@ """ Collection of user jobs for testing purposes """ # pylint: disable=wrong-import-position, invalid-name -import unittest import time +import unittest import DIRAC @@ -37,6 +37,10 @@ def test_submit(self): self.assertTrue(res["OK"]) jobsSubmittedList.append(res["Value"]) + res = helloWorldJenkins() + self.assertTrue(res["OK"]) + jobsSubmittedList.append(res["Value"]) + res = helloWorldCERN() self.assertTrue(res["OK"]) jobsSubmittedList.append(res["Value"])