Skip to content

Commit

Permalink
test: always adding 1 job for DIRAC.Jenkins.ch
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Oct 4, 2023
1 parent dac6814 commit e6d1522
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/DIRAC/tests/Utilities/testJobDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
6 changes: 5 additions & 1 deletion tests/System/unitTestUserJobs.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit e6d1522

Please sign in to comment.