Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test summary jobs to sharktank and shortfin workflows. #695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
26 changes: 20 additions & 6 deletions .github/workflows/ci-libshortfin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ name: CI - shortfin
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/ci-libshortfin.yml'
- 'shortfin/**'
push:
branches:
- main
paths:
- '.github/workflows/ci-libshortfin.yml'
- 'shortfin/**'

permissions:
contents: read
Expand Down Expand Up @@ -152,3 +146,23 @@ jobs:
run: |
ctest --timeout 30 --output-on-failure --test-dir build
pytest -s --durations=10
# Depends on all other jobs to provide an aggregate job status.
ci_libshortfin_summary:
if: always()
runs-on: ubuntu-24.04
needs:
- build-and-test
steps:
- name: Getting failed jobs
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
echo "failed-jobs=${FAILED_JOBS}" >> $GITHUB_OUTPUT
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi
Comment on lines +157 to +168
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This failed jobs list code is forked from IREE. We could simplify for cases where there is only one job or we aren't using the GITHUB_OUTPUT (e.g. to send an alert to an external service).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there are plans to send it out via GITHUB_OUTPUT thus simplifying sounds good to me and if really needed we know where to fork the complexity from 😄

21 changes: 21 additions & 0 deletions .github/workflows/ci-sharktank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,24 @@ jobs:
run: |
pytest -v sharktank/ -m punet_quick \
--durations=0

# Depends on other jobs to provide an aggregate job status.
# TODO(#584): move test_with_data and test_integration to a pkgci integration test workflow?
ci_sharktank_summary:
if: always()
runs-on: ubuntu-24.04
needs:
- test
steps:
- name: Getting failed jobs
run: |
echo '${{ toJson(needs) }}'
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
| jq --raw-output \
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
)"
echo "failed-jobs=${FAILED_JOBS}" >> $GITHUB_OUTPUT
if [[ "${FAILED_JOBS}" != "" ]]; then
echo "The following jobs failed: ${FAILED_JOBS}"
exit 1
fi
Loading