From 62646a6f04283364c2e70f8ca8a0c199c089ce11 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Thu, 11 Jul 2024 11:44:07 +0200 Subject: [PATCH] test: for the PilotWrapper tests use the artifacts --- .github/workflows/pilotWrapper.yml | 14 +++++++++++++- .../Test_GenerateAndExecutePilotWrapper.py | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pilotWrapper.yml b/.github/workflows/pilotWrapper.yml index eb0840af82d..c4330bfc02c 100644 --- a/.github/workflows/pilotWrapper.yml +++ b/.github/workflows/pilotWrapper.yml @@ -37,4 +37,16 @@ jobs: run: | cp tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py . eval "$(conda shell.bash hook)" && conda activate python_${{ matrix.python }} - python Test_GenerateAndExecutePilotWrapper.py file://${{ github.workspace }}/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py ${{ matrix.pilot_branch }} + # use github APIs to get the artifacts URLS from https://github.com/DIRACGrid/Pilot/, for those named Pilot_${{ matrix.pilot_branch }} + url=$(curl -s https://api.github.com/repos/DIRACGrid/Pilot/actions/artifacts | jq -r '.artifacts[] | select(.name == "Pilot_${{ matrix.pilot_branch }}") | .archive_download_url') + echo $url + + # download and unzip the url above + curl -L $url --output Pilot_${{ matrix.pilot_branch }}.zip + mkdir -P Pilot_${{ matrix.pilot_branch }}/pilot + cp Pilot_${{ matrix.pilot_branch }}.zip Pilot_${{ matrix.pilot_branch }}/pilot + cd Pilot_${{ matrix.pilot_branch }}/pilot + unzip Pilot_${{ matrix.pilot_branch }}.zip + cd ../.. + + python Test_GenerateAndExecutePilotWrapper.py file://${{ github.workspace }}/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py file://${{ github.workspace }}/Pilot_${{ matrix.pilot_branch }} diff --git a/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py b/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py index 653d5ad6d48..7c93b06d458 100644 --- a/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py +++ b/tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py @@ -39,7 +39,7 @@ rf = url_library_urlopen(sys.argv[1], context=context) else: rf = url_library_urlopen(sys.argv[1]) -pilotBranch = sys.argv[2] +locc = sys.argv[2] with open("PilotWrapper.py", "wb") as pj: pj.write(rf.read()) @@ -52,7 +52,7 @@ res = pilotWrapperScript( pilotOptions="--setup=CI -N ce.dirac.org -Q DIRACQUEUE -n DIRAC.CI.ORG --debug", - location="diracproject.web.cern.ch/diracproject/tars/Pilot/DIRAC/" + pilotBranch + "/,wrong.cern.ch", + location=locc + "/,wrong.cern.ch", ) with open("pilot-wrapper.sh", "wb") as pj: