Skip to content

Commit

Permalink
infra: Raise kstest errors in the permian step
Browse files Browse the repository at this point in the history
This makes it so that opening the GH web page automatically opens logs with
the actual errors. Previously, it showed only a cryptic message
"Runner return code: 1". and the actual errors were in a successfully
completed step.
  • Loading branch information
VladimirSlavik committed Sep 7, 2023
1 parent 1ef9461 commit 27db2cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/kickstart-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ jobs:
"kstestParams":{"platform":"${{ needs.pr-info.outputs.platform }}"}
}'
# Permian hides the exit code of launcher, so error out this step manually based on logs
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi
# Needed so that other jobs are able to clean the working dir
# FIXME: we should investigate running permian/launch sudo-less
- name: Make artefacts created by sudo cleanable
Expand All @@ -299,17 +307,6 @@ jobs:
kickstart-tests/data/additional_repo/*.rpm
permian/permian.log
# Permian hides the exit code of launcher
- name: Pass the launch script exit code
working-directory: ./permian
run: |
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi
- name: Set result status
if: always()
uses: octokit/[email protected]
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/kickstart-tests.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ jobs:
"kstestParams":{"platform":"${{ needs.pr-info.outputs.platform }}"}
}'

# Permian hides the exit code of launcher, so error out this step manually based on logs
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi

# Needed so that other jobs are able to clean the working dir
# FIXME: we should investigate running permian/launch sudo-less
- name: Make artefacts created by sudo cleanable
Expand All @@ -293,17 +301,6 @@ jobs:
kickstart-tests/data/additional_repo/*.rpm
permian/permian.log

# Permian hides the exit code of launcher
- name: Pass the launch script exit code
working-directory: ./permian
run: |
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi

- name: Set result status
if: always()
uses: octokit/[email protected]
Expand Down

0 comments on commit 27db2cd

Please sign in to comment.