feat: central-user test metadata, GRR URL guard, build grouping identifier#72
Closed
ashish0305 wants to merge 2 commits into
Closed
feat: central-user test metadata, GRR URL guard, build grouping identifier#72ashish0305 wants to merge 2 commits into
ashish0305 wants to merge 2 commits into
Conversation
…ifier Port of ashish0305/webdriveriolc#1 ("support of setting metadata") to the extracted standalone service repo. Path mapping: packages/wdio-browserstack-service/src -> packages/browserstack-service/src. - Add BrowserStackSDK.setTestMetadata() + TestMetadata store, gated on the app_lcnc central user (BROWSERSTACK_CENTRAL_USER). Metadata is keyed per test-run uuid with a fallback, and attached to TestFramework events / the BTCER reporter payload. - Emit central-user keys in the TestHub product maps (adapted to the repo's LTS entries+filter shape so app_lcnc is always present). - APIUtils.updateURLSForGRR: validate the GRR URL set via a hasValidGRRUrls type guard and no-op (return false) when incomplete, preventing the TypeError -> prod-collector fallback. - Send grouping_identifier (BROWSERSTACK_BUILD_GROUPING_IDENTIFIER) on build launch. - Force result='skipped' for TestRunSkipped so downstream status is correct. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the central-user port; keeps src byte-faithful to ashish0305/webdriveriolc#1 and confines the fixes to tests. - getProductMap / funnel instrumentation now emit app_lcnc: false for every user (getCentralUser defaults to { app_lcnc: false }), so add the key to the expected product maps in testHub/utils and funnelInstrumentation specs. - onBeforeTest now reads args.instance to resolve the test-run uuid; give the onBeforeTest spec a mock instance (with getRef), matching the real event args (instance is always present for test events, as onAllTestEvents already assumes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
🔴 SDK PR Review gate is red. Pending:
It turns green once the latest SDK PR Review Agent run reports GTG on the current head commit. A native reviewer approval is separately required by branch protection before merge. |
Collaborator
Author
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.
What is this about?
Adds central-user test-metadata support to the BrowserStack WebdriverIO service, ported from ashish0305/webdriveriolc#1 into this extracted standalone repo (
packages/browserstack-service/src).BrowserStackSDK.setTestMetadata({ identifier, ... })public API backed by a per-test-runTestMetadatastore, gated on theapp_lcnccentral user (BROWSERSTACK_CENTRAL_USER). Metadata is attached to the TestFramework gRPC event and the reporter's BTCER payload.getCentralUser()central-user mode; its keys are merged into the TestHub product maps.APIUtils.updateURLSForGRRvalidates the GRR URL set via ahasValidGRRUrlstype guard and no-ops (returnsfalse) when incomplete — prevents the TypeError → prod-collector fallback.grouping_identifier(BROWSERSTACK_BUILD_GROUPING_IDENTIFIER) on build launch.result = 'skipped'forTestRunSkipped(mocha setsstate = 'pending').srcis byte-faithful to the source PR; existing specs were updated only for the newapp_lcncproduct-map key and theonBeforeTestinstance arg.Related Jira task/s
LCAM-1178 — BrowserStack SDK migration (WebdriverIO service). Port of ashish0305/webdriveriolc#1.
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
BrowserStackSDK.setTestMetadata()for central-user integrations.Release notes (internal): (required — engineer-facing; what actually changed / why)
packages/browserstack-service: central-user (app_lcnc) test-metadata store +BrowserStackSDK.setTestMetadata(), central-user keys in the TestHub product maps,hasValidGRRUrlsguard onupdateURLSForGRR,grouping_identifieron build launch, andTestRunSkipped→result='skipped'.entriesproduct-map shape, layered theapp_lcncinjection in front of the existingJSON.stringifyMap-replacer, and augmented the existingTestRunSkippedblock. UpdatedtestHub/utils,funnelInstrumentation, andtestHubModulespecs for the newapp_lcnckey /onBeforeTestinstance arg.Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.
🤖 Generated with Claude Code