Skip to content

Commit

Permalink
.github/workflows: Pretty print failed runs
Browse files Browse the repository at this point in the history
This prints the name and url of each test for easier reading.
Also prints the link to the catalog table at the end.

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
Reviewed-by: Alexander Jung <alex@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1423
  • Loading branch information
craciunoiuc authored and razvand committed May 23, 2024
1 parent b56cfb0 commit 51f1953
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,23 +254,31 @@ jobs:
for _ in {1..60}; do
# If there are more than 100 tests, the list will be truncated
# TODO(craciunoiuc): Implement pagination or filter only for not concluded tests
joutput=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --created "$today" --json displayTitle,conclusion,createdAt);
joutput=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --created "$today" --json name,url,displayTitle,conclusion,createdAt);
# Check all the tests if they are successful
# If there is a failure, the workflow will fail-fast
# Filter out tests that were created after $start and before stop and pick only the ones that have the displayTitle==core_merge
fail_output=$(echo "$joutput" | jq -r -c -M --arg start "$start" --arg stop "$stop" '.[] | select(.createdAt <= $stop) | select(.createdAt >= $start) | select(.displayTitle == "core_merge") | select(.conclusion == "failure")');
if [ -n "$fail_output" ]; then
echo "There are failed tests:";
jq "$fail_output";
echo "$fail_output" | while read -r i; do
name=$(echo "$i" | jq -r -c -M '.name');
url=$(echo "$i" | jq -r -c -M '.url');
echo "❌ $name";
echo " $url";
echo "";
done
echo "Inspect the whole test suite at:"
echo "https://github.com/unikraft/catalog?tab=readme-ov-file#library"
exit 1;
fi
# If there are tests that are on-going still, we will wait for them to finish
# Filter out tests that were created after $start and before stop and pick only the ones that have the displayTitle==core_merge
ongoing_output=$(echo "$joutput" | jq -r -c -M --arg start "$start" --arg stop "$stop" '.[] | select(.createdAt <= $stop) | select(.createdAt >= $start) | select(.displayTitle == "core_merge") | select(.conclusion == "")')
if [ -z "$ongoing_output" ]; then
echo "All tests have finished successfully";
echo "All tests have finished successfully";
exit 0;
fi
Expand Down

0 comments on commit 51f1953

Please sign in to comment.