Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ repos:
src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py|
tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py
)$
language_version: python3.11

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
Expand Down
2 changes: 0 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def jobexec(jobxml, wfParameters):
sys.exit(1)
workflow = fromXMLFile(jobfile)
gLogger.debug(workflow)
code = workflow.createCode()
gLogger.debug(code)
jobID = 0
if "JOBID" in os.environ:
jobID = os.environ["JOBID"]
Expand Down
29 changes: 29 additions & 0 deletions tests/System/test_wf_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python
# Test the possibility to use general workflow parameters as variables
# in the job description

import subprocess
import shlex
import sys
from pathlib import Path
from DIRAC.Interfaces.API.Job import Job

job = Job()

job.setExecutable("/bin/ls")
job.setExecutable("/bin/echo", arguments="@{InputData}")

file = Path("jobDescription.xml")
file.write_text(job.workflow.toXML())

status = subprocess.call(shlex.split("dirac-jobexec jobDescription.xml -p InputData='{input_file_1,input_file_2}'"))
if status:
sys.exit(status)

file = Path("Script2_echo.log")
content = file.read_text()
if not "input_file_1;input_file_2" in content:
print("Test failed !")
sys.exit(-1)

print("Test successful !")
1 change: 1 addition & 0 deletions tests/System/wms_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare -a commands=(
'dirac-wms-get-wn-parameters --Site=LCG.CERN.cern --Name=ce503.cern.ch --Queue=condor'
'dirac-admin-site-info LCG.CERN.cern'
'dirac-wms-select-jobs --Status=Running'
'test_wf_job.py'
)

echo " "
Expand Down
Loading