ci: make Go test failures visible and expose concurrency controls - #93
Merged
Merged
Conversation
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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
|
Summary:
|
1 similar comment
|
Summary:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/e2eexclusion remain intact.Two optional inputs,
TEST_PARALLELISM(-parallel) andTEST_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 orcontinue-on-error;-count=1ensures fresh execution.Merge order: this PR targets
kubescape/workflows:mainand 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
./...run through the runner with-parallel 4 -p 2: passed (29 packages passed, 27 had no tests); summary generated successfully.git diff --checkpassed.GH_PERSONAL_ACCESS_TOKENdiagnostics filtered; the same diagnostics occur on unchangedmain.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.