feat: split gotestsum logs into per-test files#19575
Merged
Conversation
dc5f232 to
754ef3d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #19575 +/- ##
==========================================
- Coverage 75.5% 75.5% -0.1%
==========================================
Files 675 675
Lines 71562 71562
==========================================
- Hits 54071 54059 -12
- Misses 17347 17359 +12
Partials 144 144
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Base automatically changed from
aj/chore/migrate-op-reth-makefiles-to-just
to
develop
March 17, 2026 03:29
Add two scripts under ops/scripts/: - split-test-logs.sh: takes a gotestsum JSON log file and splits it into one log file per test, organized as per-test/<package>/<TestName>.log next to the source JSON file. - gotestsum-split.sh: drop-in gotestsum wrapper that runs gotestsum, then calls split-test-logs.sh. Preserves gotestsum's exit code so splits happen even on test failure. If --jsonfile isn't provided, adds one automatically (tmp/testlogs/log.json) so per-test logs are always generated. All gotestsum invocations in justfiles and CI config now use the wrapper. The one exception is the xargs-based parallel sharding in kona action tests, which calls gotestsum directly (since xargs invokes it multiple times appending to one jsonfile) and then calls split-test-logs.sh once at the end. Per-test logs land under tmp/testlogs/per-test/ which is already captured by existing CircleCI store_artifacts steps. Also migrates rust/op-reth/crates/tests from plain `go test` to gotestsum via the wrapper for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
754ef3d to
76a171f
Compare
split-test-logs.sh now exits non-zero when the JSON file is missing or python3 is unavailable. gotestsum-split.sh propagates split failures (preferring the split exit code over gotestsum's if both fail). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SOURCE is rust/kona/tests, so the repo root is ../../../ not ../../. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
store_artifacts doesn't support glob patterns — `testlogs*.tar.gz` was treated as a literal filename, so no artifacts were ever captured for parallel go-tests jobs. Use a consistent `testlogs.tar.gz` name since the node index is already in the filenames inside the tarball. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
teddyknox
approved these changes
Mar 17, 2026
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 19, 2026
* feat: split gotestsum JSON logs into per-test files Add two scripts under ops/scripts/: - split-test-logs.sh: takes a gotestsum JSON log file and splits it into one log file per test, organized as per-test/<package>/<TestName>.log next to the source JSON file. - gotestsum-split.sh: drop-in gotestsum wrapper that runs gotestsum, then calls split-test-logs.sh. Preserves gotestsum's exit code so splits happen even on test failure. If --jsonfile isn't provided, adds one automatically (tmp/testlogs/log.json) so per-test logs are always generated. All gotestsum invocations in justfiles and CI config now use the wrapper. The one exception is the xargs-based parallel sharding in kona action tests, which calls gotestsum directly (since xargs invokes it multiple times appending to one jsonfile) and then calls split-test-logs.sh once at the end. Per-test logs land under tmp/testlogs/per-test/ which is already captured by existing CircleCI store_artifacts steps. Also migrates rust/op-reth/crates/tests from plain `go test` to gotestsum via the wrapper for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fail on split-test-logs.sh errors instead of silently ignoring split-test-logs.sh now exits non-zero when the JSON file is missing or python3 is unavailable. gotestsum-split.sh propagates split failures (preferring the split exit code over gotestsum's if both fail). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: correct script paths in kona tests justfile SOURCE is rust/kona/tests, so the repo root is ../../../ not ../../. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): use literal path for store_artifacts in go-tests job store_artifacts doesn't support glob patterns — `testlogs*.tar.gz` was treated as a literal filename, so no artifacts were ever captured for parallel go-tests jobs. Use a consistent `testlogs.tar.gz` name since the node index is already in the filenames inside the tarball. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 23, 2026
* feat: split gotestsum JSON logs into per-test files Add two scripts under ops/scripts/: - split-test-logs.sh: takes a gotestsum JSON log file and splits it into one log file per test, organized as per-test/<package>/<TestName>.log next to the source JSON file. - gotestsum-split.sh: drop-in gotestsum wrapper that runs gotestsum, then calls split-test-logs.sh. Preserves gotestsum's exit code so splits happen even on test failure. If --jsonfile isn't provided, adds one automatically (tmp/testlogs/log.json) so per-test logs are always generated. All gotestsum invocations in justfiles and CI config now use the wrapper. The one exception is the xargs-based parallel sharding in kona action tests, which calls gotestsum directly (since xargs invokes it multiple times appending to one jsonfile) and then calls split-test-logs.sh once at the end. Per-test logs land under tmp/testlogs/per-test/ which is already captured by existing CircleCI store_artifacts steps. Also migrates rust/op-reth/crates/tests from plain `go test` to gotestsum via the wrapper for consistency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: fail on split-test-logs.sh errors instead of silently ignoring split-test-logs.sh now exits non-zero when the JSON file is missing or python3 is unavailable. gotestsum-split.sh propagates split failures (preferring the split exit code over gotestsum's if both fail). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: correct script paths in kona tests justfile SOURCE is rust/kona/tests, so the repo root is ../../../ not ../../. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(ci): use literal path for store_artifacts in go-tests job store_artifacts doesn't support glob patterns — `testlogs*.tar.gz` was treated as a literal filename, so no artifacts were ever captured for parallel go-tests jobs. Use a consistent `testlogs.tar.gz` name since the node index is already in the filenames inside the tarball. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds two scripts under
ops/scripts/:split-test-logs.sh— takes a gotestsum JSON log file and splits it into one.logfile per test, organized asper-test/<package>/<TestName>.lognext to the source JSON file.gotestsum-split.sh— drop-ingotestsumwrapper that runs gotestsum, then callssplit-test-logs.sh. Preserves gotestsum's exit code so splits happen even on test failure (when they're most useful). If--jsonfileisn't provided, adds one automatically (tmp/testlogs/log.json) so per-test logs are always generated.All gotestsum invocations in justfiles and CI config now use the wrapper. The one exception is the xargs-based parallel sharding in kona action tests, which calls gotestsum directly (xargs invokes it multiple times appending to one jsonfile) then calls
split-test-logs.shonce at the end.Per-test logs land under
tmp/testlogs/per-test/which is already captured by existing CircleCIstore_artifactssteps.Also migrates
rust/op-reth/crates/testsfrom plaingo testto gotestsum via the wrapper for consistency.Files touched
ops/scripts/split-test-logs.shops/scripts/gotestsum-split.shjustfile_go-tests-ci-internalandgo-tests-fraud-proofs-ciop-e2e/justfile_go_testvariablerust/kona/tests/justfilerust/op-reth/tests/justfiletest-e2e-sysgorust/op-reth/crates/tests/justfile.circleci/continue/main.ymlTest plan
split-test-logs.shcorrectly splits a gotestsum JSON file into per-test logs locallygotestsum-split.shauto-adds--jsonfilewhen not providedtestlogs/per-test/🤖 Generated with Claude Code