Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pr-397.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wdio/browserstack-service": minor
---

- The service now records non-sensitive details about how your tests are run (Node version, WebdriverIO package versions, worker and retry settings, whether a debugger is attached) in its debug log and in the usage data it already sends to BrowserStack at the start and end of a run, to help BrowserStack support reproduce issues faster. Credentials, paths, URLs and environment values are never recorded; set `disableAutoCaptureLogs: true` in the service options to turn it off.
2 changes: 2 additions & 0 deletions packages/browserstack-service/src/cli/grpcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import PerformanceTester from '../instrumentation/performance/performance-tester
import { CLI_AUTH_TOKEN_ENV, CLI_AUTH_TOKEN_HEADER } from '../constants.js'
import * as PERFORMANCE_SDK_EVENTS from '../instrumentation/performance/constants.js'
import { BStackLogger } from './cliLogger.js'
import * as RunContext from './runContext.js'

const GRPC_MESSAGE_LIMIT = 20 * 1024 * 1024 // 20 MB in bytes

Expand Down Expand Up @@ -197,6 +198,7 @@ export class GrpcClient {
language: CLIUtils.getSdkLanguage(),
testFramework: testFrameworkDetail.name,
wdioConfig: wdioConfig,
...RunContext.startRequestFields(wdioConfig),
})
// Add clientWorkerId and platformIndex to request (proto fields 500 & 501)
;(request as unknown as Record<string, unknown>).clientWorkerId = clientWorkerId
Expand Down
3 changes: 3 additions & 0 deletions packages/browserstack-service/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type { BrowserstackConfig, BrowserstackOptions, LaunchResponse } from '..
import CrashReporter from '../crash-reporter.js'
import PercyModule from './modules/percyModule.js'
import APIUtils from './apiUtils.js'
import * as RunContext from './runContext.js'

/**
* BrowserstackCLI - Singleton class for managing CLI operations
Expand Down Expand Up @@ -127,6 +128,7 @@ export class BrowserstackCLI {
BStackLogger.warn(ACCESSIBILITY_BUILD_START_FAILED_WARNING)
}
this.isMainConnected = true
RunContext.configure('launcher', this.config, this.options, this.browserstackConfig)
}

/**
Expand Down Expand Up @@ -497,6 +499,7 @@ export class BrowserstackCLI {
this.logger.info(`Connected to bin session: ${JSON.stringify(redactedResponse)}`)
this.loadModules(response)
this.isChildConnected = true
RunContext.configure('child', this.config, this.options, this.browserstackConfig)
PerformanceTester.end(PerformanceEvents.SDK_CONNECT_BIN_SESSION)
} catch (error) {
PerformanceTester.end(PerformanceEvents.SDK_CONNECT_BIN_SESSION, false, util.format(error))
Expand Down
Loading
Loading