From e6d15221926856f6cff041eb56e7c940665ed8e7 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Wed, 4 Oct 2023 16:01:39 +0200 Subject: [PATCH] test: always adding 1 job for DIRAC.Jenkins.ch --- src/DIRAC/tests/Utilities/testJobDefinitions.py | 16 ++++++++++++++++ tests/System/unitTestUserJobs.py | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) 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"])