Skip to content

ci: make Go test failures visible and expose concurrency controls - #93

Merged
matthyx merged 1 commit into
mainfrom
ci/go-test-failure-reporting
Sep 14, 2026
Merged

matthyx merged 1 commit into
mainfrom
ci/go-test-failure-reporting

Conversation

@matthyx

@matthyx matthyx commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Go test failures in the shared PR workflow are difficult to find among large logs. In kubescape/storage#402, the latest failing run contains two named timing-test failures near 521 ms against a 500 ms limit, followed by a large watchdog dump from a passing test.

This change captures complete JSON and stderr, adds a job summary naming failed tests/packages with diagnostic excerpts, and uploads JSON, readable logs, and stderr on success or failure. It handles Go's build-event JSON as well as test events, so compiler failures remain visible. Unit and coverage jobs share the same steps through YAML anchors; their existing race/coverage modes and /e2e exclusion remain intact.

Two optional inputs, TEST_PARALLELISM (-parallel) and TEST_PACKAGE_PARALLELISM (-p), let callers limit runner contention. Both default to zero, preserving Go's existing defaults. Nonzero test/list exits still fail the job, with no retry or continue-on-error; -count=1 ensures fresh execution.

Merge order: this PR targets kubescape/workflows:main and can merge before storage#402, whose caller already uses this shared workflow at @main. Diagnostics take effect when that workflow revision is next resolved. Concurrency limits require an explicit caller opt-in; storage's timing-sensitive tests exist only on #402 and still need their own deterministic test changes. This PR does not claim to fix those assertions or relax their thresholds.

Validation

  • Eight stdlib Python regression tests execute the actual workflow scripts: real Go pass/subtest failure/TestMain failure/build failure/go-list failure; race/coverage/concurrency flags; package filtering and literal multiline arguments; escaped and bounded summaries; complete artifacts; interleaved compiler events.
  • Full storage#402 ./... run through the runner with -parallel 4 -p 2: passed (29 packages passed, 27 had no tests); summary generated successfully.
  • Independent code review: approved; shell syntax and git diff --check passed.
  • Actionlint passes with only its two existing undeclared GH_PERSONAL_ACCESS_TOKEN diagnostics filtered; the same diagnostics occur on unchanged main.

A dedicated PR check runs the regression harness without adding dependencies. GitHub-hosted execution of the changed workflow remains to be verified by this PR's checks.

Capture Go test JSON and stderr, summarize named and package/build failures,
and upload complete logs after both successful and failed unit/coverage runs.
Share the runner/report/upload steps with YAML anchors so both jobs preserve
the same failure handling. Keep race/coverage modes and e2e exclusions.

Expose optional package and test parallelism limits through the reusable
PR workflow without changing callers' default concurrency. Tests execute
with -count=1; failures remain blocking and are never retried automatically.

Exercise the actual inline scripts with dependency-free regression fixtures,
including compiler failures, TestMain exits, failed subtests, go-list errors,
flag forwarding, literal multiline patterns, and bounded escaped summaries.

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d519fa59-2d69-40fc-90c3-dd1ea8684325


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Summary:

  • License scan: failure
  • Credentials scan: failure
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: failure

1 similar comment
@github-actions

Copy link
Copy Markdown

Summary:

  • License scan: failure
  • Credentials scan: failure
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: failure

@matthyx
matthyx merged commit 7301cda into main Sep 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant