Repository navigation
feat(otel): add a CLI that pushes artifacts manifests as OTLP spans - #555
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Works: same ids on re-push, CI parent and
Nit: |
94a51a5 to
c0341b3
Compare
c0341b3 to
f5e4399
Compare
[Medium impact] The PR adds an opt-in path for test data to reach an OpenTelemetry collector. Fix final-result selection for whole-spec retries before merging. Findings
SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Artifacts manifests] --> B[Check manifests and sampling]
B --> C[Compare final attempts]
C --> D[Prepare attempt spans]
E[Retained trace zips] -->|Optional| D
D --> F[Sequential OTLP batches]
F --> G[Collector]
Reviews (6) · Last reviewed commit: "fix(otel): link a session or spec zip to..." · Reviewed by Greptile |
| const attempt = finalAttemptOf(test) | ||
| return candidates.find((artifact) => retryOf(artifact) === attempt) |
There was a problem hiding this comment.
Retried tests lose replay links
Retained session- and spec-scope zips contain the final attempt but do not use a -retryN folder, so retryOf(artifact) returns 0. When the final attempt is greater than 0, this lookup selects nothing. As a result, --artifact-base-url silently omits devtools.artifact.url, leaving users without a replay link despite the retained zip.
Match shared artifacts by their scope and covered test. Keep exact-attempt matching for per-test zips.
f5e4399 to
db9942a
Compare
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A push above about 15,000 spans started more than 30 exports at once, the exporter refused the rest, and half the run was lost behind an exit code. Batches now go one at a time and a failure says how many spans arrived. Spans carry the session, browser, test uid and CI commit, branch and pipeline, and test.suite.name is relative to where the tests ran, so history matches across machines. A failure in one browser is no longer superseded by a later pass in another, a test with no outcome is pushed instead of dropped, and a malformed manifest names the field at fault. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he run Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An end-to-end run showed the attempt span marked failed with no error.message: mocha only sets the error on a test it reports as failed, and a retried attempt is never reported. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The reader accepts only manifestVersion 2, checks it before anything else, and no longer needs cwd. Sampling follows the parent unless --ignore-parent-sampling is given, and a manifest skipped for that reason is reported. Console text is exported only with --console-messages and is capped. A zip outside the manifest directory, by path or through a symlink, is not read. Manifests keep their own run ids, and a push of spans older than an hour says so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Only a per-test zip names its attempt in its folder. A session or spec zip covers every attempt of its tests, but was matched as attempt 0, so a test that passed on a retry got no replay link and nothing said so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
5ef75be to
384ce6f
Compare
| for (const finals of byTest.values()) { | ||
| for (const earlier of finals) { | ||
| if ( | ||
| earlier.state === STATE_FAILED && |
There was a problem hiding this comment.
Retried specs keep duplicate finals
When specFileRetries reruns a spec because one test failed, it also reruns tests that passed. These tests keep the same uid, run id and browser, but supersededFinals only clears the earlier final flag for failures. A test that passes twice gets two spans with devtools.test.final_attempt=true. A test that passes then fails gets conflicting final results. This breaks the documented filter for counting each test once.
Use the recorded spec attempt number to identify replaced results regardless of their earlier status, while keeping independent browser runs separate.
Stack
Part 3 of 4 of the OpenTelemetry export, replacing #485. Stacked on part 2.
What
A new package,
@wdio/opentelemetry, with awdio-otel pushCLI. It pushes the tests listed in artifacts manifests to an OTLP collector as spans.TRACEPARENT, each attempt is a child of the CI span instead.--trace-zipsreads the final attempt's trace zip and pushes its actions as child spans. An earlier attempt's zip is never used in place of the final one.retain-on-failureevery test still gets its span. A zip the policy dropped gets no link and no action spans.--artifact-base-urladds each zip's URL asdevtools.artifact.url.Verification
pnpm build,pnpm test(4159 passed, 4 skipped),pnpm lint(0 errors),pnpm docs:capabilities --checkand thepackages/oteltypecheck pass on this branch.packages/otel/distimports none of the private workspace packages.🤖 Generated with Claude Code