browserstack-cypress-cli 1.36.19 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.coderabbit.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
inheritance: true
|
|
2
|
+
reviews:
|
|
3
|
+
review_details: true
|
|
4
|
+
request_changes_workflow: true
|
|
5
|
+
auto_review:
|
|
6
|
+
enabled: true
|
|
7
|
+
knowledge_base:
|
|
8
|
+
code_guidelines:
|
|
9
|
+
filePatterns:
|
|
10
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/rules/**/*.md"
|
|
11
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/agents/*review*.md"
|
|
12
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/skills/*review*/**/*.md"
|
|
13
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/knowledge/*.md"
|
|
14
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/knowledge/automate/**/*.md"
|
|
15
|
+
- "browserstack/browserstack-ai-harness:stacks/stack-domain-browserstack-cypress-cli/knowledge/docs/**/*.md"
|
|
@@ -27,7 +27,10 @@ jobs:
|
|
|
27
27
|
|
|
28
28
|
container:
|
|
29
29
|
# A Docker image with Semgrep installed. Do not change this.
|
|
30
|
-
|
|
30
|
+
# Pinned to a digest for supply-chain integrity (APS-19017 / INF-007).
|
|
31
|
+
# returntocorp/semgrep:1.166.0 resolved 2026-09-16.
|
|
32
|
+
image: returntocorp/semgrep:1.166.0@sha256:c180f0c93a17b420c0af5006214a29d3c747c5459c732b740191adf657dd0068
|
|
33
|
+
|
|
31
34
|
# Skip any PR created by dependabot to avoid permission issues:
|
|
32
35
|
if: (github.actor != 'dependabot[bot]')
|
|
33
36
|
|
package/bin/commands/runs.js
CHANGED
|
@@ -212,7 +212,7 @@ module.exports = function run(args, rawArgs) {
|
|
|
212
212
|
logger.debug("Completed setting the configs");
|
|
213
213
|
|
|
214
214
|
if(!isBrowserstackInfra) {
|
|
215
|
-
if(process.env.BS_TESTOPS_BUILD_COMPLETED) {
|
|
215
|
+
if(process.env.BS_TESTOPS_BUILD_COMPLETED === "true") {
|
|
216
216
|
setEventListeners(bsConfig);
|
|
217
217
|
}
|
|
218
218
|
|
|
@@ -226,7 +226,7 @@ module.exports = function run(args, rawArgs) {
|
|
|
226
226
|
if(process.env.BROWSERSTACK_TEST_ACCESSIBILITY === 'true') {
|
|
227
227
|
setAccessibilityEventListeners(bsConfig);
|
|
228
228
|
}
|
|
229
|
-
if(process.env.BS_TESTOPS_BUILD_COMPLETED) {
|
|
229
|
+
if(process.env.BS_TESTOPS_BUILD_COMPLETED === "true") {
|
|
230
230
|
setEventListeners(bsConfig);
|
|
231
231
|
}
|
|
232
232
|
markBlockEnd('validateConfig');
|
|
@@ -4,7 +4,8 @@ const { readCypressConfigFile } = require('./readCypressConfigUtil');
|
|
|
4
4
|
|
|
5
5
|
const logger = require("./logger").winstonLogger,
|
|
6
6
|
Constants = require("./constants"),
|
|
7
|
-
Utils = require("./utils")
|
|
7
|
+
Utils = require("./utils"),
|
|
8
|
+
testhubUtils = require("../testhub/utils");
|
|
8
9
|
|
|
9
10
|
const caps = (bsConfig, zip) => {
|
|
10
11
|
return new Promise(function (resolve, reject) {
|
|
@@ -131,6 +132,18 @@ const caps = (bsConfig, zip) => {
|
|
|
131
132
|
obj.run_settings = JSON.stringify(bsConfig.run_settings);
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
// The only route by which a cypress session can name its TestHub build: every session
|
|
136
|
+
// this build spawns inherits these caps. Written unconditionally so an empty uuid records
|
|
137
|
+
// that build start ran and had nothing to name, which an absent key cannot express.
|
|
138
|
+
// "null" is the sentinel a failed build start leaves behind, not a uuid.
|
|
139
|
+
const testhubBuildUuid = process.env.BROWSERSTACK_TESTHUB_UUID;
|
|
140
|
+
obj.testhubBuildUuid = Utils.isUndefined(testhubBuildUuid) || testhubBuildUuid === "null"
|
|
141
|
+
? ""
|
|
142
|
+
: testhubBuildUuid;
|
|
143
|
+
obj.buildProductMap = testhubUtils.getProductMap(bsConfig);
|
|
144
|
+
|
|
145
|
+
logger.debug(`TestHub build uuid stamped on caps: ${obj.testhubBuildUuid || "<empty>"}`);
|
|
146
|
+
|
|
134
147
|
obj.cypress_cli_user_agent = Utils.getUserAgent();
|
|
135
148
|
|
|
136
149
|
logger.info(`Cypress CLI User Agent: ${obj.cypress_cli_user_agent}`);
|
|
@@ -41,9 +41,9 @@ class TestHubHandler {
|
|
|
41
41
|
const response = await nodeRequest( "POST", TESTHUB_CONSTANTS.TESTHUB_BUILD_API, data, config);
|
|
42
42
|
const launchData = this.extractDataFromResponse(user_config, data, response, config);
|
|
43
43
|
} catch (error) {
|
|
44
|
-
|
|
44
|
+
logger.debug(`EXCEPTION IN BUILD START EVENT : ${error}`);
|
|
45
|
+
testhubUtils.handleErrorForObservability(error.success === false ? error : null);
|
|
45
46
|
if (error.success === false) { // non 200 response
|
|
46
|
-
testhubUtils.logBuildError(error);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
|
package/bin/testhub/utils.js
CHANGED
|
@@ -88,6 +88,10 @@ exports.setTestObservabilityVariables = (
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
exports.handleErrorForObservability = (error = null) => {
|
|
91
|
+
// Downstream reads isTestObservabilitySession(), not these ids, to decide whether
|
|
92
|
+
// observability is live. extractDataFromResponse clears it inline for a 2xx carrying
|
|
93
|
+
// success=false; this covers the paths that never get a usable response at all.
|
|
94
|
+
process.env.BROWSERSTACK_TEST_OBSERVABILITY = "false";
|
|
91
95
|
process.env.BROWSERSTACK_TESTHUB_UUID = "null";
|
|
92
96
|
process.env.BROWSERSTACK_TESTHUB_JWT = "null";
|
|
93
97
|
process.env.BS_TESTOPS_BUILD_COMPLETED = "false";
|
|
@@ -164,7 +168,7 @@ exports.handleErrorForAccessibility = (user_config, error = null) => {
|
|
|
164
168
|
};
|
|
165
169
|
|
|
166
170
|
exports.logBuildError = (error, product = "") => {
|
|
167
|
-
if (error
|
|
171
|
+
if (isUndefined(error)) {
|
|
168
172
|
logger.error(`${product.toUpperCase()} Build creation failed`);
|
|
169
173
|
|
|
170
174
|
return;
|