fix(browserstack-service): don't mark external-grid runs as Automate#8
Open
AakashHotchandani wants to merge 2 commits into
Open
fix(browserstack-service): don't mark external-grid runs as Automate#8AakashHotchandani wants to merge 2 commits into
AakashHotchandani wants to merge 2 commits into
Conversation
When the service runs on an external (non-BrowserStack) grid - e.g. Test Observability only, with credentials inside testObservabilityOptions - config.automate was still set to !appAutomate (true), so the build was reported with origin Automate even though it never ran on BrowserStack. Gate automate/app_automate on isBrowserstackInfra() (the same signal that already drives the browserstackAutomation field). External-grid runs now report automate:false / app_automate:false; on-BrowserStack runs are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
create-wdio
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browser-runner
@wdio/browserstack-service
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/globals
@wdio/jasmine-framework
@wdio/json-reporter
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/sauce-service
@wdio/shared-store-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/spec-reporter
@wdio/static-server-service
@wdio/sumologic-reporter
@wdio/testingbot-service
@wdio/types
@wdio/utils
@wdio/webdriver-mock-service
@wdio/xvfb
webdriver
webdriverio
commit: |
Bhargavi-BS
approved these changes
Jun 5, 2026
shivam5643
approved these changes
Jun 5, 2026
…or origin check Address review feedback: isBrowserstackInfra also inspects per-capability `hostname` overrides (multi-remote configs where only some capabilities target an external grid). The origin classification call omitted `caps`, so those overrides were ignored. Thread `capabilities` through, consistent with shouldAddServiceVersion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
1 task
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
@wdio/browserstack-serviceclassifies every non-App-Automate run as Automate:This never checks whether the session actually runs on BrowserStack. When a user runs on an external (non-BrowserStack) grid and uses the service only for Test Observability — the documented "tests running locally or elsewhere" flow, with
user/keyplaced insidetestObservabilityOptions—automateis still set totrue. That flows intogetProductMap(buildProductMap), and the build is attributed with origin Automate, even thoughbrowserstackAutomationis correctlyfalsein the very same build-start event.Reproducible build-start payload from such a run (web Chrome on an external CI grid):
This is a different axis from webdriverio#15267 (which fixed App-Automate ↔ Automate detection from capabilities). That change left
this.automate = !this.appAutomateuntouched, so external-grid web runs are still mislabeled.Fix
config.ts: theBrowserStackConfigconstructor /getInstancetake an optionalisBrowserStackInfra(defaulttrue, preserving behaviour for the existinggetInstance()retrieval callers).appAutomate/automateare gated on it:launcher.ts: passesisBrowserstackInfra(_config)— the same helper that already drives thebrowserstackAutomationfield viashouldAddServiceVersion— so the product map stays consistent with it.Result for an external-grid Test-Observability run:
{ observability: true, automate: false, app_automate: false }→ no longer attributed to Automate. On-BrowserStack Automate / App-Automate / TurboScale runs keepisBrowserStackInfra = trueand are unchanged. The credentials-in-testObservabilityOptionscase is covered becauseisBStackSessionisfalsewhen no rootuser/keyis present.Test plan
tests/config.test.tscases: external-grid web run →automate:false/app_automate:false; app caps off-infra → bothfalse; web run on-infra →automate:true(regression guard). Existing cases are unchanged (they rely on the defaultisBrowserStackInfra = true).vitestsuite /tsc/eslintwere not run in this environment (no disk space to install deps). Please rely on CI to validate.🤖 Generated with Claude Code