Skip to content

Commit

Permalink
test: for the PilotWrapper tests use the artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jul 11, 2024
1 parent 03c556d commit a55d36d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/pilotWrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,29 @@ 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 \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
$url --output Pilot_${{ matrix.pilot_branch }}.zip
file_type=$(file --mime-type -b Pilot_${{ matrix.pilot_branch }}.zip)
if [ "$file_type" != "application/zip" ]; then
echo "The downloaded file is not a ZIP file. File type: $file_type"
exit 1
fi
mkdir -p ${{ matrix.pilot_branch }}/pilot
cp Pilot_${{ matrix.pilot_branch }}.zip ${{ matrix.pilot_branch }}/pilot
cd ${{ 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 }}/${{ matrix.pilot_branch }}
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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:
Expand Down

0 comments on commit a55d36d

Please sign in to comment.