test: save trace in job CI artifacts directory when ui e2e tests fails#1204
test: save trace in job CI artifacts directory when ui e2e tests fails#1204rsoaresd merged 5 commits intocodeready-toolchain:masterfrom
Conversation
WalkthroughAdds a CI-specific override in testsupport/sandbox-ui/trace.go to set tracePath to Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Test as Test Runner
participant Env as Environment
participant Trace as trace.go
Test->>Trace: Start trace for <test>
Trace->>Env: Read CI, ARTIFACT_DIR, RUNNING_IN_CONTAINER
alt CI == "true"
Note over Trace: CI override (new)
Trace->>Trace: tracePath = ARTIFACT_DIR/sandbox-ui/trace/trace-<test>.zip
else RUNNING_IN_CONTAINER is set
Note over Trace: Container path (no leading slash)
Trace->>Trace: tracePath = trace/trace-<test>.zip
else
Note over Trace: Default filesystem path
Trace->>Trace: tracePath = ../../trace/trace-<test>.zip
end
Test->>Trace: Stop/Save trace
Trace-->>Test: Uses computed tracePath (unchanged flow)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
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. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
testsupport/sandbox-ui/trace.go (1)
35-43: Create the trace directory before saving the trace to avoid failures.
Tracing().Stop(tracePath)will fail if the parent dir doesn't exist. Create it proactively.Apply:
t.Cleanup(func() { if t.Failed() { + // ensure target dir exists + if mkErr := os.MkdirAll(filepath.Dir(tracePath), 0o755); mkErr != nil { + t.Logf("failed to create trace dir: %v", mkErr) + } if err := context.Tracing().Stop(tracePath); err != nil { t.Logf("failed to save trace: %v", err) } else { t.Logf("saved trace to %s", tracePath) } } })
🧹 Nitpick comments (1)
testsupport/sandbox-ui/trace.go (1)
27-29: Same absolute-path bug in container path resolution.
fmt.Sprintf("/trace/…")makes the path absolute and ignoresE2E_REPO_PATH. Align with the CI fix.Suggested change (outside the changed hunk):
traceDir := filepath.Join(os.Getenv("E2E_REPO_PATH"), "trace") tracePath = filepath.Join(traceDir, fmt.Sprintf("trace-%s.zip", testName))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
make/test.mk(1 hunks)test/e2e/sandbox-ui/activities_page_test.go(1 hunks)testsupport/sandbox-ui/trace.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Unit Tests
- GitHub Check: GolangCI Lint
- GitHub Check: Build & push Developer Sandbox UI image for UI e2e tests
- GitHub Check: Build & push operator bundles for e2e tests
🔇 Additional comments (1)
make/test.mk (1)
45-45: test-ui-e2e target exists — no action required.
Defined and marked .PHONY in make/sandbox-ui.mk (around lines 194–195).
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, fbm3307, MatousJobanek, rajivnathan, rsoaresd, xcoulon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest similar to flakiness that we discussed on https://redhat-internal.slack.com/archives/CHK0J6HT6/p1758276534724369 |



Description
We need to save trace in the job CI artifacts directory when ui e2e tests fail, to have the prints of the ui to debug the failed test
Summary by CodeRabbit