feat: live Test Reporting ingestion in TestReportingClient; report CI results to TRA - #34
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
Replaces the JUnit upload. Reports CI/PR/commit info and per-test errors and stack traces. Note: builds/start currently returns 400 against the live API. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
…ort logs and errors from CI Ingestion endpoints (start/finish build, test and hook runs, build logs) live on collector-observability.browserstack.com, not api-automation. Adds an sdkIngest base URL (ingestBaseUrl option) and has the CI reporter send console output, failure stack traces and unhandled errors as build logs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
shirish87
had a problem deploying
to
BrowserStackEnv
October 4, 2026 20:29 — with
GitHub Actions
Error
The documented ext/v1 ingestion endpoints reject basic auth on the collector. Use the flow the BrowserStack SDKs use: POST /api/v2/builds (basic auth) returns a build id and JWT, events go to /api/v1/batch with the JWT, then the build is stopped. Reverts the earlier sdkIngest base URL change. Adds unit tests and a live end-to-end test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
The package builds declarations without Node types; use core's auth helpers (btoa-based) instead of process.env and Buffer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
shirish87
had a problem deploying
to
BrowserStackEnv
October 4, 2026 20:45 — with
GitHub Actions
Error
…on link and screenshots TestReportingClient's startBuild/startTestRun/finishTestRun/hook/addBuildLogs/finishBuild now use the collector protocol the BrowserStack SDKs use (build start returns a JWT, events go to /api/v1/batch, build stop), keeping their signatures. Adds linkTestRunSession (CBTSessionCreated) and addTestScreenshots, as WebdriverIO sends them. Drops the separate ingest client. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
shirish87
marked this pull request as ready for review
October 4, 2026 20:48
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB
This branch was successfully deployed
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.
Requested by Shirish · project thread
Before:
TestReportingClient's ingestion methods (startBuild,startTestRun,finishTestRun, hooks,addBuildLogs,finishBuild) did not work against the live service, and CI test results lived only in GitHub Actions logs.After: those methods work live with their existing signatures, and this repo's CI streams its own test results to BrowserStack Test Reporting & Analytics (dogfooding). Each CI job shows up as a build named
CI #<run> (<branch>) [<os>], with each test reported as it runs, including failure messages, stack traces, console output, unhandled errors, and CI, PR and commit info.Why: the documented
ext/v1ingestion endpoints reject basic auth on the collector. The working protocol is the one BrowserStack's SDKs (e.g. WebdriverIO) use:POST /api/v2/buildsreturns a build id and a JWT, events go to/api/v1/batch, andPUT /api/v1/builds/{id}/stopends the build.How:
TestReportingClientoverrides the ingestion methods (same signatures) using that protocol. It adds aningestBaseUrloption and two calls taken from WebdriverIO:linkTestRunSession(CBTSessionCreated) andaddTestScreenshots.scripts/ci-report/tra-reporter.mjsis a vitest reporter built on those methods. It is best-effort: errors are logged and swallowed, and it is disabled when credentials are absent (fork PRs), so BrowserStack being unreachable cannot fail CI.main.ymlruns it in the Linux SDK job and the macOS/Windows CLI jobs via--reporter=./scripts/ci-report/tra-reporter.mjswithTRA_LABEL.publish-docsdependencies and cli-e2e tests are untouched.Tests: unit tests for the ingestion methods and the reporter, plus a live end-to-end test (skipped without credentials) that reports a passed and a failed test and reads the counts back. The old mocked
ext/v1start/finish tests were replaced.Not done: Test Management reporting.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WUdwzfDSUhTEqqEWDhi6tB