-
Notifications
You must be signed in to change notification settings - Fork 132
ci(l1): fail L1 job if hive tests fail #4827
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
Changes from all commits
6c2a849
71798a1
f6fbd90
9370a21
6e884bd
b27761b
9dae1ce
49ef6d7
dce2e92
39503f8
018e9ab
bbb45fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,192 @@ | ||||||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||||||
|
|
||||||||||||||||||
| # Verifies Hive JSON results, prints failing tests, copies related logs, | ||||||||||||||||||
| # and updates the GitHub summary to surface the failures in the workflow UI. | ||||||||||||||||||
|
|
||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||
|
|
||||||||||||||||||
| if ! command -v jq >/dev/null 2>&1; then | ||||||||||||||||||
| echo "jq is required to parse Hive results but was not found in PATH" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| results_dir="${1:-src/results}" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ ! -d "$results_dir" ]; then | ||||||||||||||||||
| echo "Hive results directory '${results_dir}' not found" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| if ! results_dir="$(cd "${results_dir}" >/dev/null 2>&1 && pwd -P)"; then | ||||||||||||||||||
| echo "Failed to resolve absolute path for Hive results directory" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| results_parent="$(dirname "${results_dir}")" | ||||||||||||||||||
| workspace_logs_dir="" | ||||||||||||||||||
| if [ -d "${results_parent}/workspace/logs" ]; then | ||||||||||||||||||
| workspace_logs_dir="$(cd "${results_parent}/workspace/logs" >/dev/null 2>&1 && pwd -P)" | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| shopt -s nullglob | ||||||||||||||||||
| json_files=("${results_dir}"/*.json) | ||||||||||||||||||
| shopt -u nullglob | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ ${#json_files[@]} -eq 0 ]; then | ||||||||||||||||||
| echo "No Hive JSON result files found in ${results_dir}" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| failures=0 | ||||||||||||||||||
| failed_logs_root="${results_dir}/failed_logs" | ||||||||||||||||||
| rm -rf "${failed_logs_root}" | ||||||||||||||||||
| mkdir -p "${failed_logs_root}" | ||||||||||||||||||
|
|
||||||||||||||||||
| for json_file in "${json_files[@]}"; do | ||||||||||||||||||
| if [[ "${json_file}" == *"hive.json" ]]; then | ||||||||||||||||||
| continue | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| suite_name="$(jq -r '.name // empty' "${json_file}")" | ||||||||||||||||||
| failed_cases="$(jq '[.testCases[]? | select(.summaryResult.pass != true)] | length' "${json_file}")" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ "${failed_cases}" -gt 0 ]; then | ||||||||||||||||||
| echo "Detected ${failed_cases} failing test case(s) in ${suite_name:-$(basename "${json_file}")}" | ||||||||||||||||||
| failure_list="$( | ||||||||||||||||||
| jq -r ' | ||||||||||||||||||
| .testCases[]? | ||||||||||||||||||
| | select(.summaryResult.pass != true) | ||||||||||||||||||
| | . as $case | ||||||||||||||||||
| | ($case.summaryResult // {}) as $summary | ||||||||||||||||||
| | ($summary.message // $summary.reason // $summary.error // "") as $message | ||||||||||||||||||
| | (if $summary.log? | ||||||||||||||||||
| then "log lines " | ||||||||||||||||||
| + (($summary.log.begin // "?") | tostring) | ||||||||||||||||||
| + "-" | ||||||||||||||||||
| + (($summary.log.end // "?") | tostring) | ||||||||||||||||||
| else "" | ||||||||||||||||||
| end) as $log_hint | ||||||||||||||||||
| | (if $message != "" then $message else $log_hint end) as $detail | ||||||||||||||||||
| | (if $case.clientInfo? | ||||||||||||||||||
| then ($case.clientInfo | ||||||||||||||||||
| | to_entries | ||||||||||||||||||
| | map((.value.name // .key) + ": " + (.value.logFile // "unknown log")) | ||||||||||||||||||
| | join("; ")) | ||||||||||||||||||
| else "" | ||||||||||||||||||
| end) as $clients | ||||||||||||||||||
| | "- " + ($case.name // "unknown test") | ||||||||||||||||||
| + (if $detail != "" then ": " + $detail else "" end) | ||||||||||||||||||
| + (if $clients != "" then " (client logs: " + $clients + ")" else "" end) | ||||||||||||||||||
| ' "${json_file}" | ||||||||||||||||||
| )" | ||||||||||||||||||
|
|
||||||||||||||||||
| printf '%s\n' "${failure_list}" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then | ||||||||||||||||||
| { | ||||||||||||||||||
| echo "### Hive failures: ${suite_name:-$(basename "${json_file}" .json)}" | ||||||||||||||||||
| printf '%s\n' "${failure_list}" | ||||||||||||||||||
| echo | ||||||||||||||||||
| } >> "${GITHUB_STEP_SUMMARY}" | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| suite_slug_raw="${suite_name:-$(basename "${json_file}" .json)}" | ||||||||||||||||||
| suite_slug="$(printf '%s' "${suite_slug_raw}" | tr '[:upper:]' '[:lower:]')" | ||||||||||||||||||
| suite_slug="$(printf '%s' "${suite_slug}" | sed -E 's/[^a-z0-9._-]+/-/g')" | ||||||||||||||||||
| suite_slug="${suite_slug#-}" | ||||||||||||||||||
| suite_slug="${suite_slug%-}" | ||||||||||||||||||
|
Comment on lines
+94
to
+97
|
||||||||||||||||||
| suite_slug="$(printf '%s' "${suite_slug_raw}" | tr '[:upper:]' '[:lower:]')" | |
| suite_slug="$(printf '%s' "${suite_slug}" | sed -E 's/[^a-z0-9._-]+/-/g')" | |
| suite_slug="${suite_slug#-}" | |
| suite_slug="${suite_slug%-}" | |
| suite_slug="${suite_slug_raw,,}" # lowercase | |
| suite_slug="${suite_slug//[^a-z0-9._-]/-}" # replace non-matching chars with '-' | |
| suite_slug="${suite_slug#-}" # trim leading dash | |
| suite_slug="${suite_slug%-}" # trim trailing dash |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The find command with basename could be inefficient for large directory trees. Consider using more specific search patterns or limiting search depth if the log structure is known.
| found_log="$(find "${search_root}" -type f -name "$(basename "${log_rel}")" -print -quit 2>/dev/null || true)" | |
| found_log="$(find "${search_root}" -maxdepth 2 -type f -name "$(basename "${log_rel}")" -print -quit 2>/dev/null || true)" |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,6 +64,7 @@ jobs: | |||||||||
| make test | ||||||||||
|
|
||||||||||
|
||||||||||
| # EF tests are skipped for merge group events to reduce CI load and avoid redundant test runs, | |
| # since merge group events are used for speculative merges and do not require full EF test coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eth-syncing is now failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment mentioning this?
MegaRedHand marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there were some regressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script searches for the log files of failed tests and updates them to an artifact