From 4578b136a0c8d94f12fa9f886fbd3c8afd57c09d Mon Sep 17 00:00:00 2001 From: Andrei Tsaregorodtsev Date: Fri, 12 Jun 2026 17:29:04 +0200 Subject: [PATCH 1/3] fix: do not create workflow code --- src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py index 9e4e5e84b9b..b8591c5c197 100755 --- a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py +++ b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py @@ -43,8 +43,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"] From 9cf3749f4c418f5f3de4f1c3c8dd2dba90812d59 Mon Sep 17 00:00:00 2001 From: Andrei Tsaregorodtsev Date: Tue, 25 Aug 2026 15:54:40 +0200 Subject: [PATCH 2/3] fix: add System test for dirac-jobexec with generic WF parameters --- tests/System/test_wf_job.py | 29 +++++++++++++++++++++++++++++ tests/System/wms_scripts.sh | 1 + 2 files changed, 30 insertions(+) create mode 100644 tests/System/test_wf_job.py diff --git a/tests/System/test_wf_job.py b/tests/System/test_wf_job.py new file mode 100644 index 00000000000..c4bcd1c4af9 --- /dev/null +++ b/tests/System/test_wf_job.py @@ -0,0 +1,29 @@ +#!/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 !") diff --git a/tests/System/wms_scripts.sh b/tests/System/wms_scripts.sh index 37b4f284e55..a678b86d83b 100755 --- a/tests/System/wms_scripts.sh +++ b/tests/System/wms_scripts.sh @@ -15,6 +15,7 @@ declare -a commands=( 'dirac-wms-get-normalized-queue-length ce503.cern.ch/condor' 'dirac-wms-get-queue-normalization ce503.cern.ch/condor' 'dirac-wms-select-jobs --Status=Running' +'test_wf_job.py' ) echo " " From e7e235cd5afcfd8032cf84fcfcb2d4873b362023 Mon Sep 17 00:00:00 2001 From: Andrei Tsaregorodtsev Date: Tue, 25 Aug 2026 15:57:07 +0200 Subject: [PATCH 3/3] fix: use /usr/bin/env to get the python interpretor --- tests/System/test_wf_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/test_wf_job.py b/tests/System/test_wf_job.py index c4bcd1c4af9..f0eee801004 100644 --- a/tests/System/test_wf_job.py +++ b/tests/System/test_wf_job.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python # Test the possibility to use general workflow parameters as variables # in the job description