@wdio/browserstack-service 9.27.0 → 9.27.2
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/build/bstackLogger.d.ts +1 -0
- package/build/bstackLogger.d.ts.map +1 -1
- package/build/cleanup.js +215 -72
- package/build/cli/cliUtils.d.ts +3 -2
- package/build/cli/cliUtils.d.ts.map +1 -1
- package/build/cli/frameworks/wdioMochaTestFramework.d.ts.map +1 -1
- package/build/cli/grpcClient.d.ts.map +1 -1
- package/build/cli/index.d.ts +5 -0
- package/build/cli/index.d.ts.map +1 -1
- package/build/config.d.ts +1 -1
- package/build/config.d.ts.map +1 -1
- package/build/constants.d.ts +4 -0
- package/build/constants.d.ts.map +1 -1
- package/build/crash-reporter.d.ts +1 -1
- package/build/crash-reporter.d.ts.map +1 -1
- package/build/index.js +410 -130
- package/build/instrumentation/performance/performance-tester.d.ts.map +1 -1
- package/build/launcher.d.ts +1 -0
- package/build/launcher.d.ts.map +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/testHub/utils.d.ts +2 -2
- package/build/testHub/utils.d.ts.map +1 -1
- package/build/types.d.ts +8 -0
- package/build/types.d.ts.map +1 -1
- package/build/util.d.ts +1 -0
- package/build/util.d.ts.map +1 -1
- package/package.json +8 -9
package/build/bstackLogger.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare class BStackLogger {
|
|
|
2
2
|
static logFilePath: string;
|
|
3
3
|
static logFolderPath: string;
|
|
4
4
|
private static logFileStream;
|
|
5
|
+
private static redactCredentials;
|
|
5
6
|
static logToFile(logMessage: string, logLevel: string): void;
|
|
6
7
|
private static formatLog;
|
|
7
8
|
static info(message: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bstackLogger.d.ts","sourceRoot":"","sources":["../src/bstackLogger.ts"],"names":[],"mappings":"AAWA,qBAAa,YAAY;IACrB,OAAc,WAAW,SAAsC;IAC/D,OAAc,aAAa,SAAmC;IAC9D,OAAO,CAAC,MAAM,CAAC,aAAa,CAAuB;IAEnD,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"bstackLogger.d.ts","sourceRoot":"","sources":["../src/bstackLogger.ts"],"names":[],"mappings":"AAWA,qBAAa,YAAY;IACrB,OAAc,WAAW,SAAsC;IAC/D,OAAc,aAAa,SAAmC;IAC9D,OAAO,CAAC,MAAM,CAAC,aAAa,CAAuB;IAEnD,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAMhC,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAerD,OAAO,CAAC,MAAM,CAAC,SAAS;WAIV,IAAI,CAAC,OAAO,EAAE,MAAM;WAMpB,KAAK,CAAC,OAAO,EAAE,MAAM;WAMrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;WAUtC,IAAI,CAAC,OAAO,EAAE,MAAM;WAMpB,KAAK,CAAC,OAAO,EAAE,MAAM;WAMrB,WAAW;WAOX,YAAY;WAMZ,gBAAgB;CAKjC"}
|
package/build/cleanup.js
CHANGED
|
@@ -8,7 +8,6 @@ import path6 from "node:path";
|
|
|
8
8
|
import util3 from "node:util";
|
|
9
9
|
import gitRepoInfo from "git-repo-info";
|
|
10
10
|
import gitconfig from "gitconfiglocal";
|
|
11
|
-
import { FormData } from "formdata-node";
|
|
12
11
|
import { performance as performance2 } from "node:perf_hooks";
|
|
13
12
|
|
|
14
13
|
// src/logPatcher.ts
|
|
@@ -71,7 +70,7 @@ import logger from "@wdio/logger";
|
|
|
71
70
|
// package.json
|
|
72
71
|
var package_default = {
|
|
73
72
|
name: "@wdio/browserstack-service",
|
|
74
|
-
version: "9.
|
|
73
|
+
version: "9.27.1",
|
|
75
74
|
description: "WebdriverIO service for better Browserstack integration",
|
|
76
75
|
author: "Adam Bjerstedt <abjerstedt@gmail.com>",
|
|
77
76
|
homepage: "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browserstack-service",
|
|
@@ -118,12 +117,11 @@ var package_default = {
|
|
|
118
117
|
"browserstack-local": "^1.5.1",
|
|
119
118
|
chalk: "^5.3.0",
|
|
120
119
|
"csv-writer": "^1.6.0",
|
|
121
|
-
"formdata-node": "5.0.1",
|
|
122
120
|
"git-repo-info": "^2.1.1",
|
|
123
121
|
gitconfiglocal: "^2.1.0",
|
|
124
122
|
glob: "^11.0.0",
|
|
125
|
-
tar: "^7.5.
|
|
126
|
-
undici: "^6.
|
|
123
|
+
tar: "^7.5.11",
|
|
124
|
+
undici: "^6.24.0",
|
|
127
125
|
uuid: "^11.1.0",
|
|
128
126
|
webdriverio: "workspace:*",
|
|
129
127
|
"winston-transport": "^4.5.0",
|
|
@@ -149,6 +147,7 @@ var consoleHolder = Object.assign({}, console);
|
|
|
149
147
|
var APP_ALLY_ISSUES_ENDPOINT = "api/v1/issues";
|
|
150
148
|
var APP_ALLY_ISSUES_SUMMARY_ENDPOINT = "api/v1/issues-summary";
|
|
151
149
|
var BSTACK_SERVICE_VERSION = bstackServiceVersion;
|
|
150
|
+
var BROWSERSTACK_TEST_PLAN_ID = "BROWSERSTACK_TEST_PLAN_ID";
|
|
152
151
|
var LOGS_FILE = "logs/bstack-wdio-service.log";
|
|
153
152
|
var SMART_SELECTION_MODE_RELEVANT_FIRST = "relevantFirst";
|
|
154
153
|
var SMART_SELECTION_MODE_RELEVANT_ONLY = "relevantOnly";
|
|
@@ -162,6 +161,7 @@ var BROWSERSTACK_ACCESSIBILITY = "BROWSERSTACK_ACCESSIBILITY";
|
|
|
162
161
|
var BROWSERSTACK_OBSERVABILITY = "BROWSERSTACK_OBSERVABILITY";
|
|
163
162
|
var MAX_GIT_META_DATA_SIZE_IN_BYTES = 64 * 1024;
|
|
164
163
|
var GIT_META_DATA_TRUNCATED = "...[TRUNCATED]";
|
|
164
|
+
var BINARY_BUSY_ERROR_CODES = ["ETXTBSY", "EBUSY"];
|
|
165
165
|
var WDIO_NAMING_PREFIX = "WebdriverIO-";
|
|
166
166
|
var UPDATED_CLI_ENDPOINT = "sdk/v1/update_cli";
|
|
167
167
|
|
|
@@ -171,14 +171,18 @@ var BStackLogger = class {
|
|
|
171
171
|
static logFilePath = path.join(process.cwd(), LOGS_FILE);
|
|
172
172
|
static logFolderPath = path.join(process.cwd(), "logs");
|
|
173
173
|
static logFileStream;
|
|
174
|
+
static redactCredentials(logMessage) {
|
|
175
|
+
return logMessage.replace(/(["']?(?:username|userName|accesskey|accessKey|user|key)["']?\s*[:=]\s*["']?)([^"'\s,}]+)/gi, "$1").replace(/([?&](?:username|userName|access_key|accesskey|accessKey|user|key)=)([^&#\s]+)/gi, "$1");
|
|
176
|
+
}
|
|
174
177
|
static logToFile(logMessage, logLevel) {
|
|
175
178
|
try {
|
|
179
|
+
const redactedMessage = this.redactCredentials(logMessage);
|
|
176
180
|
if (!this.logFileStream) {
|
|
177
181
|
this.ensureLogsFolder();
|
|
178
182
|
this.logFileStream = fs.createWriteStream(this.logFilePath, { flags: "a" });
|
|
179
183
|
}
|
|
180
184
|
if (this.logFileStream && this.logFileStream.writable) {
|
|
181
|
-
this.logFileStream.write(this.formatLog(
|
|
185
|
+
this.logFileStream.write(this.formatLog(redactedMessage, logLevel));
|
|
182
186
|
}
|
|
183
187
|
} catch (error) {
|
|
184
188
|
log.debug(`Failed to log to file. Error ${error}`);
|
|
@@ -189,28 +193,33 @@ var BStackLogger = class {
|
|
|
189
193
|
`;
|
|
190
194
|
}
|
|
191
195
|
static info(message) {
|
|
192
|
-
this.
|
|
193
|
-
|
|
196
|
+
const redactedMessage = this.redactCredentials(message);
|
|
197
|
+
this.logToFile(redactedMessage, "info");
|
|
198
|
+
log.info(redactedMessage);
|
|
194
199
|
}
|
|
195
200
|
static error(message) {
|
|
196
|
-
this.
|
|
197
|
-
|
|
201
|
+
const redactedMessage = this.redactCredentials(message);
|
|
202
|
+
this.logToFile(redactedMessage, "error");
|
|
203
|
+
log.error(redactedMessage);
|
|
198
204
|
}
|
|
199
205
|
static debug(message, param) {
|
|
200
|
-
this.
|
|
206
|
+
const redactedMessage = this.redactCredentials(message);
|
|
207
|
+
this.logToFile(redactedMessage, "debug");
|
|
201
208
|
if (param) {
|
|
202
|
-
log.debug(
|
|
209
|
+
log.debug(redactedMessage, param);
|
|
203
210
|
} else {
|
|
204
|
-
log.debug(
|
|
211
|
+
log.debug(redactedMessage);
|
|
205
212
|
}
|
|
206
213
|
}
|
|
207
214
|
static warn(message) {
|
|
208
|
-
this.
|
|
209
|
-
|
|
215
|
+
const redactedMessage = this.redactCredentials(message);
|
|
216
|
+
this.logToFile(redactedMessage, "warn");
|
|
217
|
+
log.warn(redactedMessage);
|
|
210
218
|
}
|
|
211
219
|
static trace(message) {
|
|
212
|
-
this.
|
|
213
|
-
|
|
220
|
+
const redactedMessage = this.redactCredentials(message);
|
|
221
|
+
this.logToFile(redactedMessage, "trace");
|
|
222
|
+
log.trace(redactedMessage);
|
|
214
223
|
}
|
|
215
224
|
static clearLogger() {
|
|
216
225
|
if (this.logFileStream) {
|
|
@@ -589,6 +598,7 @@ var CLIUtils = class _CLIUtils {
|
|
|
589
598
|
modifiedOpts.browserStackLocalOptions = modifiedOpts.opts;
|
|
590
599
|
delete modifiedOpts.opts;
|
|
591
600
|
}
|
|
601
|
+
delete modifiedOpts.testManagementOptions;
|
|
592
602
|
modifiedOpts.testContextOptions = {
|
|
593
603
|
skipSessionName: isFalse(modifiedOpts.setSessionName),
|
|
594
604
|
skipSessionStatus: isFalse(modifiedOpts.setSessionStatus),
|
|
@@ -607,6 +617,8 @@ var CLIUtils = class _CLIUtils {
|
|
|
607
617
|
options.testObservability
|
|
608
618
|
);
|
|
609
619
|
const observabilityOptions = options.testObservabilityOptions || {};
|
|
620
|
+
const testManagementOptions = options.testManagementOptions || {};
|
|
621
|
+
const testPlanId = typeof testManagementOptions.testPlanId === "string" ? testManagementOptions.testPlanId.trim() : "";
|
|
610
622
|
const binconfig = {
|
|
611
623
|
userName: observabilityOptions.user || config.user,
|
|
612
624
|
accessKey: observabilityOptions.key || config.key,
|
|
@@ -618,26 +630,26 @@ var CLIUtils = class _CLIUtils {
|
|
|
618
630
|
binconfig.buildName = observabilityOptions.buildName || binconfig.buildName;
|
|
619
631
|
binconfig.projectName = observabilityOptions.projectName || binconfig.projectName;
|
|
620
632
|
binconfig.buildTag = this.getObservabilityBuildTags(observabilityOptions, buildTag) || [];
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
633
|
+
if (testPlanId.length > 0) {
|
|
634
|
+
binconfig.testManagementOptions = {
|
|
635
|
+
testPlanId
|
|
636
|
+
};
|
|
624
637
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
638
|
+
const caps = Array.isArray(capabilities) ? capabilities : [capabilities];
|
|
639
|
+
for (const cap of caps) {
|
|
640
|
+
const platform4 = {};
|
|
641
|
+
const capability = cap;
|
|
642
|
+
Object.keys(capability).filter((key) => key !== "bstack:options").forEach((key) => {
|
|
643
|
+
platform4[key] = capability[key];
|
|
644
|
+
});
|
|
645
|
+
if (capability["bstack:options"]) {
|
|
646
|
+
Object.keys(
|
|
647
|
+
capability["bstack:options"]
|
|
648
|
+
).forEach((key) => {
|
|
649
|
+
platform4[key] = capability["bstack:options"][key];
|
|
631
650
|
});
|
|
632
|
-
if (capability["bstack:options"]) {
|
|
633
|
-
Object.keys(
|
|
634
|
-
capability["bstack:options"]
|
|
635
|
-
).forEach((key) => {
|
|
636
|
-
platform4[key] = capability["bstack:options"][key];
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
binconfig.platforms.push(platform4);
|
|
640
651
|
}
|
|
652
|
+
binconfig.platforms.push(platform4);
|
|
641
653
|
}
|
|
642
654
|
return JSON.stringify(binconfig);
|
|
643
655
|
}
|
|
@@ -696,9 +708,20 @@ var CLIUtils = class _CLIUtils {
|
|
|
696
708
|
sdk_language: this.getSdkLanguage()
|
|
697
709
|
};
|
|
698
710
|
if (!isNullOrEmpty(existingCliPath)) {
|
|
699
|
-
|
|
711
|
+
if (this.isBinaryBusy(existingCliPath)) {
|
|
712
|
+
BStackLogger2.warn(`Existing binary is currently in use, skipping update: ${existingCliPath}`);
|
|
713
|
+
PerformanceTester.end(EVENTS.SDK_CLI_CHECK_UPDATE);
|
|
714
|
+
return existingCliPath;
|
|
715
|
+
}
|
|
716
|
+
const version3 = await this.runShellCommand(
|
|
700
717
|
`${existingCliPath} version`
|
|
701
718
|
);
|
|
719
|
+
if (version3.toLowerCase().includes("text file busy")) {
|
|
720
|
+
BStackLogger2.warn(`Binary busy during version check, skipping update: ${existingCliPath}`);
|
|
721
|
+
PerformanceTester.end(EVENTS.SDK_CLI_CHECK_UPDATE);
|
|
722
|
+
return existingCliPath;
|
|
723
|
+
}
|
|
724
|
+
queryParams.cli_version = version3;
|
|
702
725
|
}
|
|
703
726
|
const response = await this.requestToUpdateCLI(queryParams, config);
|
|
704
727
|
if (nestedKeyValue(response, ["updated_cli_version"])) {
|
|
@@ -814,6 +837,29 @@ var CLIUtils = class _CLIUtils {
|
|
|
814
837
|
return "";
|
|
815
838
|
}
|
|
816
839
|
}
|
|
840
|
+
static isBinaryBusy(binaryPath) {
|
|
841
|
+
if (isNullOrEmpty(binaryPath)) {
|
|
842
|
+
return false;
|
|
843
|
+
}
|
|
844
|
+
if (platform() === "darwin") {
|
|
845
|
+
return false;
|
|
846
|
+
}
|
|
847
|
+
if (!fs3.existsSync(binaryPath)) {
|
|
848
|
+
return false;
|
|
849
|
+
}
|
|
850
|
+
try {
|
|
851
|
+
const fd = fs3.openSync(binaryPath, "r+");
|
|
852
|
+
fs3.closeSync(fd);
|
|
853
|
+
return false;
|
|
854
|
+
} catch (err) {
|
|
855
|
+
if (BINARY_BUSY_ERROR_CODES.includes(err.code)) {
|
|
856
|
+
BStackLogger2.debug(`Binary is busy: ${binaryPath}`);
|
|
857
|
+
return true;
|
|
858
|
+
}
|
|
859
|
+
BStackLogger2.debug(`Error checking if binary is busy: ${err.message}`);
|
|
860
|
+
return false;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
817
863
|
static requestToUpdateCLI = async (queryParams, config) => {
|
|
818
864
|
const params = new URLSearchParams(queryParams);
|
|
819
865
|
const requestInit = {
|
|
@@ -934,8 +980,11 @@ ${Date.now()}
|
|
|
934
980
|
const cleanupTemporaryDownloads = (maxAgeMs = CLI_LOCK_TIMEOUT_MS) => {
|
|
935
981
|
try {
|
|
936
982
|
const now = Date.now();
|
|
983
|
+
const tmpExtractRe = /\.tmp\.\d+$/;
|
|
937
984
|
for (const entry of fs3.readdirSync(cliDir)) {
|
|
938
|
-
|
|
985
|
+
const isDownloadZip = entry.startsWith(CLI_DOWNLOAD_TMP_PREFIX) && entry.endsWith(CLI_DOWNLOAD_TMP_SUFFIX);
|
|
986
|
+
const isExtractTmp = tmpExtractRe.test(entry);
|
|
987
|
+
if (!isDownloadZip && !isExtractTmp) {
|
|
939
988
|
continue;
|
|
940
989
|
}
|
|
941
990
|
const filePath = path3.join(cliDir, entry);
|
|
@@ -952,13 +1001,13 @@ ${Date.now()}
|
|
|
952
1001
|
fs3.unlinkSync(filePath);
|
|
953
1002
|
} catch (err) {
|
|
954
1003
|
BStackLogger2.debug(
|
|
955
|
-
`Failed to delete temp CLI
|
|
1004
|
+
`Failed to delete temp CLI file ${filePath}: ${util.format(err)}`
|
|
956
1005
|
);
|
|
957
1006
|
}
|
|
958
1007
|
}
|
|
959
1008
|
} catch (err) {
|
|
960
1009
|
BStackLogger2.debug(
|
|
961
|
-
`Failed to scan temp CLI
|
|
1010
|
+
`Failed to scan temp CLI files in ${cliDir}: ${util.format(err)}`
|
|
962
1011
|
);
|
|
963
1012
|
}
|
|
964
1013
|
};
|
|
@@ -1004,7 +1053,6 @@ ${Date.now()}
|
|
|
1004
1053
|
);
|
|
1005
1054
|
const downloadedFileStream = fs3.createWriteStream(zipFilePath);
|
|
1006
1055
|
return new Promise((resolve, reject) => {
|
|
1007
|
-
const binaryName = null;
|
|
1008
1056
|
const processDownload = async () => {
|
|
1009
1057
|
const abortController = new AbortController();
|
|
1010
1058
|
const timeout = setTimeout(
|
|
@@ -1038,7 +1086,6 @@ ${Date.now()}
|
|
|
1038
1086
|
nodeStream.pipe(downloadedFileStream);
|
|
1039
1087
|
_CLIUtils.downloadFileStream(
|
|
1040
1088
|
downloadedFileStream,
|
|
1041
|
-
binaryName,
|
|
1042
1089
|
zipFilePath,
|
|
1043
1090
|
cliDir,
|
|
1044
1091
|
(result) => {
|
|
@@ -1072,40 +1119,104 @@ ${Date.now()}
|
|
|
1072
1119
|
return null;
|
|
1073
1120
|
}
|
|
1074
1121
|
};
|
|
1075
|
-
static downloadFileStream(downloadedFileStream,
|
|
1122
|
+
static downloadFileStream(downloadedFileStream, zipFilePath, cliDir, resolve, reject) {
|
|
1076
1123
|
downloadedFileStream.on("close", async function() {
|
|
1077
1124
|
const yauzlOpenPromise = promisify(yauzl.open);
|
|
1078
1125
|
try {
|
|
1079
1126
|
const zipfile = await yauzlOpenPromise(zipFilePath, {
|
|
1080
1127
|
lazyEntries: true
|
|
1081
1128
|
});
|
|
1129
|
+
let resolvedBinaryPath = null;
|
|
1082
1130
|
zipfile.readEntry();
|
|
1083
1131
|
zipfile.on("entry", async (entry) => {
|
|
1084
|
-
if (!binaryName) {
|
|
1085
|
-
binaryName = entry.fileName;
|
|
1086
|
-
}
|
|
1087
1132
|
if (/\/$/.test(entry.fileName)) {
|
|
1088
1133
|
zipfile.readEntry();
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
const candidatePath = path3.join(cliDir, entry.fileName);
|
|
1137
|
+
const resolvedCandidate = path3.resolve(candidatePath);
|
|
1138
|
+
const resolvedDir = path3.resolve(cliDir) + path3.sep;
|
|
1139
|
+
if (!resolvedCandidate.startsWith(resolvedDir)) {
|
|
1140
|
+
zipfile.close();
|
|
1141
|
+
reject(new Error(`Zip-slip detected: entry "${entry.fileName}" resolves outside ${cliDir}`));
|
|
1142
|
+
return;
|
|
1143
|
+
}
|
|
1144
|
+
const isBinaryEntry = path3.basename(entry.fileName).startsWith("binary-");
|
|
1145
|
+
if (!isBinaryEntry) {
|
|
1146
|
+
const directStream = fs3.createWriteStream(candidatePath);
|
|
1147
|
+
directStream.on("error", (writeErr) => {
|
|
1148
|
+
zipfile.close();
|
|
1149
|
+
reject(writeErr);
|
|
1150
|
+
});
|
|
1151
|
+
const openReadStreamPromise2 = promisify(
|
|
1094
1152
|
zipfile.openReadStream
|
|
1095
1153
|
).bind(zipfile);
|
|
1096
1154
|
try {
|
|
1097
|
-
const readStream = await
|
|
1155
|
+
const readStream = await openReadStreamPromise2(entry);
|
|
1098
1156
|
readStream.on("end", function() {
|
|
1099
|
-
|
|
1100
|
-
zipfile.readEntry();
|
|
1157
|
+
directStream.end();
|
|
1158
|
+
directStream.on("close", () => zipfile.readEntry());
|
|
1101
1159
|
});
|
|
1102
|
-
readStream.pipe(
|
|
1160
|
+
readStream.pipe(directStream);
|
|
1103
1161
|
} catch (zipErr) {
|
|
1162
|
+
zipfile.close();
|
|
1104
1163
|
reject(zipErr);
|
|
1105
1164
|
}
|
|
1106
|
-
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
const finalPath = candidatePath;
|
|
1168
|
+
const tempPath = path3.join(cliDir, `${entry.fileName}.tmp.${process.pid}`);
|
|
1169
|
+
const writeStream = fs3.createWriteStream(tempPath);
|
|
1170
|
+
let writeStreamErrored = false;
|
|
1171
|
+
writeStream.on("error", (writeErr) => {
|
|
1172
|
+
writeStreamErrored = true;
|
|
1173
|
+
fsp.unlink(tempPath).catch(() => {
|
|
1174
|
+
});
|
|
1175
|
+
zipfile.close();
|
|
1176
|
+
reject(writeErr);
|
|
1177
|
+
});
|
|
1178
|
+
writeStream.on("close", async () => {
|
|
1179
|
+
if (writeStreamErrored) {
|
|
1180
|
+
return;
|
|
1181
|
+
}
|
|
1182
|
+
try {
|
|
1183
|
+
await fsp.chmod(tempPath, "0755");
|
|
1184
|
+
try {
|
|
1185
|
+
await fsp.rename(tempPath, finalPath);
|
|
1186
|
+
} catch (renameErr) {
|
|
1187
|
+
if (renameErr.code !== "EXDEV") {
|
|
1188
|
+
throw renameErr;
|
|
1189
|
+
}
|
|
1190
|
+
BStackLogger2.warn(`Atomic rename failed (cross-device), falling back to copy: ${renameErr.message}`);
|
|
1191
|
+
await fsp.copyFile(tempPath, finalPath);
|
|
1192
|
+
await fsp.unlink(tempPath).catch(() => {
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
if (!resolvedBinaryPath) {
|
|
1196
|
+
resolvedBinaryPath = finalPath;
|
|
1197
|
+
}
|
|
1198
|
+
zipfile.readEntry();
|
|
1199
|
+
} catch (err) {
|
|
1200
|
+
await fsp.unlink(tempPath).catch(() => {
|
|
1201
|
+
});
|
|
1107
1202
|
zipfile.close();
|
|
1203
|
+
reject(err);
|
|
1108
1204
|
}
|
|
1205
|
+
});
|
|
1206
|
+
const openReadStreamPromise = promisify(
|
|
1207
|
+
zipfile.openReadStream
|
|
1208
|
+
).bind(zipfile);
|
|
1209
|
+
try {
|
|
1210
|
+
const readStream = await openReadStreamPromise(entry);
|
|
1211
|
+
readStream.on("end", function() {
|
|
1212
|
+
writeStream.end();
|
|
1213
|
+
});
|
|
1214
|
+
readStream.pipe(writeStream);
|
|
1215
|
+
} catch (zipErr) {
|
|
1216
|
+
fsp.unlink(tempPath).catch(() => {
|
|
1217
|
+
});
|
|
1218
|
+
zipfile.close();
|
|
1219
|
+
reject(zipErr);
|
|
1109
1220
|
}
|
|
1110
1221
|
});
|
|
1111
1222
|
zipfile.on("error", (zipErr) => {
|
|
@@ -1113,16 +1224,15 @@ ${Date.now()}
|
|
|
1113
1224
|
});
|
|
1114
1225
|
zipfile.once("end", () => {
|
|
1115
1226
|
fsp.unlink(zipFilePath).catch(() => {
|
|
1116
|
-
BStackLogger2.warn(
|
|
1117
|
-
`Failed to delete zip file: ${zipFilePath}`
|
|
1118
|
-
);
|
|
1119
|
-
});
|
|
1120
|
-
fsp.chmod(`${cliDir}/${binaryName}`, "0755").then(() => {
|
|
1121
|
-
resolve(`${cliDir}/${binaryName}`);
|
|
1122
|
-
}).catch((err) => {
|
|
1123
|
-
reject(err);
|
|
1227
|
+
BStackLogger2.warn(`Failed to delete zip file: ${zipFilePath}`);
|
|
1124
1228
|
});
|
|
1229
|
+
if (!resolvedBinaryPath) {
|
|
1230
|
+
zipfile.close();
|
|
1231
|
+
reject(new Error("No binary-* entry found in zip; cannot complete CLI binary extraction"));
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1125
1234
|
zipfile.close();
|
|
1235
|
+
resolve(resolvedBinaryPath);
|
|
1126
1236
|
});
|
|
1127
1237
|
} catch (err) {
|
|
1128
1238
|
reject(err);
|
|
@@ -1459,6 +1569,7 @@ var PerformanceTester = class _PerformanceTester {
|
|
|
1459
1569
|
static end(event, success = true, failure, details = {}) {
|
|
1460
1570
|
performance.mark(event + "-end");
|
|
1461
1571
|
performance.measure(event, event + "-start", event + "-end");
|
|
1572
|
+
delete this.eventsMap[event + "-start"];
|
|
1462
1573
|
this.details[event] = Object.assign({ success, failure: util2.format(failure) }, Object.assign(Object.assign({
|
|
1463
1574
|
clientWorkerId: _PerformanceTester.getClientWorkerId(),
|
|
1464
1575
|
worker: _PerformanceTester.getProcessId(),
|
|
@@ -1610,13 +1721,14 @@ var logBuildError = (error, product = "") => {
|
|
|
1610
1721
|
}
|
|
1611
1722
|
};
|
|
1612
1723
|
var getProductMapForBuildStartCall = (config, accessibilityAutomation) => {
|
|
1613
|
-
|
|
1614
|
-
observability
|
|
1615
|
-
accessibility
|
|
1616
|
-
percy
|
|
1617
|
-
automate
|
|
1618
|
-
app_automate
|
|
1619
|
-
|
|
1724
|
+
const entries = [
|
|
1725
|
+
["observability", config.testObservability.enabled],
|
|
1726
|
+
["accessibility", accessibilityAutomation],
|
|
1727
|
+
["percy", config.percy],
|
|
1728
|
+
["automate", config.automate],
|
|
1729
|
+
["app_automate", config.appAutomate]
|
|
1730
|
+
];
|
|
1731
|
+
return Object.fromEntries(entries.filter(([, v]) => v !== null));
|
|
1620
1732
|
};
|
|
1621
1733
|
|
|
1622
1734
|
// src/testorchestration/testorcherstrationutils.ts
|
|
@@ -2089,8 +2201,17 @@ var CrashReporter = class {
|
|
|
2089
2201
|
for (const prop in obj) {
|
|
2090
2202
|
if (keys.includes(prop.toLowerCase())) {
|
|
2091
2203
|
obj[prop] = "[REDACTED]";
|
|
2092
|
-
} else if (typeof obj[prop] === "object") {
|
|
2204
|
+
} else if (typeof obj[prop] === "object" && obj[prop] !== null) {
|
|
2093
2205
|
this.recursivelyRedactKeysFromObject(obj[prop], keys);
|
|
2206
|
+
} else if (typeof obj[prop] === "string") {
|
|
2207
|
+
try {
|
|
2208
|
+
const parsed = JSON.parse(obj[prop]);
|
|
2209
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
2210
|
+
this.recursivelyRedactKeysFromObject(parsed, keys);
|
|
2211
|
+
obj[prop] = JSON.stringify(parsed);
|
|
2212
|
+
}
|
|
2213
|
+
} catch {
|
|
2214
|
+
}
|
|
2094
2215
|
}
|
|
2095
2216
|
}
|
|
2096
2217
|
}
|
|
@@ -2430,7 +2551,6 @@ var usageStats_default = UsageStats;
|
|
|
2430
2551
|
|
|
2431
2552
|
// src/util.ts
|
|
2432
2553
|
import { create } from "tar";
|
|
2433
|
-
import { fileFromPath } from "formdata-node/file-from-path";
|
|
2434
2554
|
|
|
2435
2555
|
// src/scripts/accessibility-scripts.ts
|
|
2436
2556
|
import path5 from "node:path";
|
|
@@ -2664,7 +2784,10 @@ var launchTestSession = PerformanceTester.measureWrapper(TESTHUB_EVENTS.START, o
|
|
|
2664
2784
|
},
|
|
2665
2785
|
product_map: getProductMapForBuildStartCall(bStackConfig, accessibilityAutomation),
|
|
2666
2786
|
config: {},
|
|
2667
|
-
test_orchestration: OrchestrationUtils.getInstance(config)?.getBuildStartData() || {}
|
|
2787
|
+
test_orchestration: OrchestrationUtils.getInstance(config)?.getBuildStartData() || {},
|
|
2788
|
+
test_management: {
|
|
2789
|
+
test_plan_id: getTestPlanId(options)
|
|
2790
|
+
}
|
|
2668
2791
|
};
|
|
2669
2792
|
if (accessibilityAutomation && (isTurboScale(options) || data.browserstackAutomation === false)) {
|
|
2670
2793
|
data.accessibility.settings ??= {};
|
|
@@ -2693,6 +2816,7 @@ var launchTestSession = PerformanceTester.measureWrapper(TESTHUB_EVENTS.START, o
|
|
|
2693
2816
|
const jsonResponse = await response.json();
|
|
2694
2817
|
delete data?.accessibility?.settings?.includeEncodedExtension;
|
|
2695
2818
|
BStackLogger.debug(`[Start_Build] Success response: ${JSON.stringify(jsonResponse)}`);
|
|
2819
|
+
BStackLogger.debug(`Test Plan Id sent in request: ${getTestPlanId(options)}`);
|
|
2696
2820
|
process.env[TESTOPS_BUILD_COMPLETED_ENV] = "true";
|
|
2697
2821
|
if (jsonResponse.jwt) {
|
|
2698
2822
|
process.env[BROWSERSTACK_TESTHUB_JWT] = jsonResponse.jwt;
|
|
@@ -3216,6 +3340,25 @@ function getObservabilityBuildTags(options, bstackBuildTag) {
|
|
|
3216
3340
|
}
|
|
3217
3341
|
return [];
|
|
3218
3342
|
}
|
|
3343
|
+
function getTestPlanId(options) {
|
|
3344
|
+
if (process.env[BROWSERSTACK_TEST_PLAN_ID]) {
|
|
3345
|
+
return process.env[BROWSERSTACK_TEST_PLAN_ID];
|
|
3346
|
+
}
|
|
3347
|
+
const CLI_ARG = "--browserstack.testManagementOptions.testPlanId";
|
|
3348
|
+
const argIndex = process.argv.indexOf(CLI_ARG);
|
|
3349
|
+
if (argIndex !== -1 && process.argv[argIndex + 1]) {
|
|
3350
|
+
return process.argv[argIndex + 1];
|
|
3351
|
+
}
|
|
3352
|
+
const argWithEquals = process.argv.find((arg) => arg.startsWith(`${CLI_ARG}=`));
|
|
3353
|
+
if (argWithEquals) {
|
|
3354
|
+
return argWithEquals.split("=")[1];
|
|
3355
|
+
}
|
|
3356
|
+
const testPlanId = options.testManagementOptions?.testPlanId;
|
|
3357
|
+
if (typeof testPlanId === "string" && testPlanId.trim().length > 0) {
|
|
3358
|
+
return testPlanId.trim();
|
|
3359
|
+
}
|
|
3360
|
+
return void 0;
|
|
3361
|
+
}
|
|
3219
3362
|
function getBrowserStackUser(config) {
|
|
3220
3363
|
if (process.env.BROWSERSTACK_USERNAME) {
|
|
3221
3364
|
return process.env.BROWSERSTACK_USERNAME;
|
package/build/cli/cliUtils.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class CLIUtils {
|
|
|
12
12
|
* @returns {string}
|
|
13
13
|
* @throws {Error}
|
|
14
14
|
*/
|
|
15
|
-
static getBinConfig(config: Options.Testrunner, capabilities: Capabilities.
|
|
15
|
+
static getBinConfig(config: Options.Testrunner, capabilities: Capabilities.RequestedStandaloneCapabilities | Capabilities.RequestedStandaloneCapabilities[], options: BrowserstackConfig & BrowserstackOptions, buildTag?: string): string;
|
|
16
16
|
static getSdkVersion(): string;
|
|
17
17
|
static getSdkLanguage(): string;
|
|
18
18
|
static setupCliPath(config: Options.Testrunner): Promise<string | null>;
|
|
@@ -20,10 +20,11 @@ export declare class CLIUtils {
|
|
|
20
20
|
static getCliDir(): string;
|
|
21
21
|
static getWritableDir(): string | null | undefined;
|
|
22
22
|
static getExistingCliPath(cliDir: string): string;
|
|
23
|
+
static isBinaryBusy(binaryPath: string): boolean;
|
|
23
24
|
static requestToUpdateCLI: (queryParams: Record<string, string>, config: Options.Testrunner) => Promise<any>;
|
|
24
25
|
static runShellCommand(cmdCommand: string, workingDir?: string): Promise<string>;
|
|
25
26
|
static downloadLatestBinary: (binDownloadUrl: string, cliDir: string) => Promise<string | null>;
|
|
26
|
-
static downloadFileStream(downloadedFileStream: fs.WriteStream,
|
|
27
|
+
static downloadFileStream(downloadedFileStream: fs.WriteStream, zipFilePath: string, cliDir: string, resolve: (path: string) => void, reject: (reason?: Error) => void): void;
|
|
27
28
|
static getTestFrameworkDetail(): any;
|
|
28
29
|
static getAutomationFrameworkDetail(): any;
|
|
29
30
|
static setFrameworkDetail(testFramework: string, automationFramework: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliUtils.d.ts","sourceRoot":"","sources":["../../src/cli/cliUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AA8BxB,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EACR,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"cliUtils.d.ts","sourceRoot":"","sources":["../../src/cli/cliUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AA8BxB,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EACR,kBAAkB,EAClB,mBAAmB,EAEnB,wBAAwB,EAC3B,MAAM,aAAa,CAAA;AAUpB,qBAAa,QAAQ;IACjB,MAAM,CAAC,yBAAyB,KAAK;IACrC,MAAM,CAAC,mBAAmB,KAAK;IAC/B,MAAM,CAAC,sBAAsB,WAAY;IAEzC,MAAM,CAAC,gBAAgB;IAIvB,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAOtD;;;;OAIG;IACH,MAAM,CAAC,YAAY,CACf,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,YAAY,EACN,YAAY,CAAC,+BAA+B,GAC5C,YAAY,CAAC,+BAA+B,EAAE,EACpD,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,EACjD,QAAQ,CAAC,EAAE,MAAM;IAgGrB,MAAM,CAAC,aAAa;IAIpB,MAAM,CAAC,cAAc;WAIR,YAAY,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AAc,CAAC;IA8D9E;;;OAGG;IAEG,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IAkC7D,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC;IA8DlE,6BAA6B,CAAC,IAAI,EAAE,IAAI,CAAC,oCAAoC,EAAE,cAAc,CAAC;IAmCpG;;OAEG;IACG,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;IA4C3I;;;OAGG;IACH,SAAS;IAIT;;;OAGG;IACH,UAAU;CAGb"}
|
package/build/cli/index.d.ts
CHANGED
|
@@ -64,6 +64,11 @@ export declare class BrowserstackCLI {
|
|
|
64
64
|
* @throws {Error} If the process fails to start
|
|
65
65
|
*/
|
|
66
66
|
start(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Spawn the CLI process and wait until it emits "ready".
|
|
69
|
+
* Handles both synchronous spawn errors and async error/close events.
|
|
70
|
+
*/
|
|
71
|
+
private _spawnAndAwaitReady;
|
|
67
72
|
/**
|
|
68
73
|
* Stop the CLI
|
|
69
74
|
* @returns {Promise<void>}
|
package/build/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAK7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AACtF,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAA;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,sBAAsB,MAAM,wCAAw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,GAAC,IAAI,CAAO;IACxD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IACtC,MAAM,sBAAe;IACrB,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,GAAG,EAAE,CAAA;;IAWtD;;;OAGG;IACH,MAAM,CAAC,WAAW;IAOlB;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,kBAAkB,GAAG,mBAAmB,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,EAAE,UAAU,SAAG;IA2B7G;;;OAGG;IACG,SAAS;IAYf;;;OAGG;IACH,WAAW,CAAC,gBAAgB,EAAE,uBAAuB;IA4DrD;;;OAGG;IACG,gBAAgB;IAUtB;;;;OAIG;IACG,KAAK;IA6DX;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAyD3B;;;OAGG;IACG,IAAI;IAiDV;;;;OAIG;IACG,kBAAkB;IASxB;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAM5C;;;;OAIG;IACG,UAAU,CAAC,YAAY,EAAE,MAAM;IAkBrC;;;OAGG;IACH,SAAS;IAWT;;;OAGG;IACH,qBAAqB;IAIrB;;;;OAIG;IACH,qBAAqB,CAAC,kBAAkB,EAAC,OAAO,CAAC,UAAU;IAI3D;;;OAGG;IACG,aAAa;IAOnB;;;OAGG;IACH,YAAY;IAIZ;;;OAGG;IACH,SAAS;IAIT;;;;MAIE;IACF,SAAS,CAAC,QAAQ,EAAE,uBAAuB;IAW3C;;;OAGG;IACH,kBAAkB;IAOlB;;;OAGG;IACH,wBAAwB;IAOxB;;;OAGG;IACH,gBAAgB;IAIhB;;;OAGG;IACH,sBAAsB;CAGzB"}
|
package/build/config.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare class BrowserStackConfig {
|
|
|
11
11
|
testObservability: TestOpsConfig;
|
|
12
12
|
percy: boolean;
|
|
13
13
|
percyCaptureMode?: string;
|
|
14
|
-
accessibility
|
|
14
|
+
accessibility?: boolean;
|
|
15
15
|
app?: string | AppConfig;
|
|
16
16
|
private static _instance;
|
|
17
17
|
appAutomate: boolean;
|
package/build/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,cAAM,kBAAkB;IACpB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,GAAG,kBAAkB;IAO/G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,aAAa,CAAA;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,cAAM,kBAAkB;IACpB,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,GAAG,kBAAkB;IAO/G,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,aAAa,CAAA;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoB;IACrC,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAQ;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,kBAAkB,UAAQ;IAC1B,QAAQ,EAAE,MAAM,CAAA;gBAEX,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU;IAexF,cAAc;CAIjB;AAED,eAAe,kBAAkB,CAAA"}
|
package/build/constants.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const DEFAULT_WAIT_TIMEOUT_FOR_PENDING_UPLOADS = 5000;
|
|
|
17
17
|
export declare const DEFAULT_WAIT_INTERVAL_FOR_PENDING_UPLOADS = 100;
|
|
18
18
|
export declare const BSTACK_SERVICE_VERSION: string;
|
|
19
19
|
export declare const NOT_ALLOWED_KEYS_IN_CAPS: string[];
|
|
20
|
+
export declare const BROWSERSTACK_TEST_PLAN_ID = "BROWSERSTACK_TEST_PLAN_ID";
|
|
20
21
|
export declare const LOGS_FILE = "logs/bstack-wdio-service.log";
|
|
21
22
|
export declare const CLI_DEBUG_LOGS_FILE = "log/sdk-cli-debug.log";
|
|
22
23
|
export declare const UPLOAD_LOGS_ADDRESS = "https://upload-observability.browserstack.com";
|
|
@@ -60,6 +61,9 @@ export declare const TEST_REPORTING_BUILD_NAME = "TEST_REPORTING_BUILD_NAME";
|
|
|
60
61
|
export declare const MAX_GIT_META_DATA_SIZE_IN_BYTES: number;
|
|
61
62
|
export declare const GIT_META_DATA_TRUNCATED = "...[TRUNCATED]";
|
|
62
63
|
export declare const CLI_STOP_TIMEOUT = 5000;
|
|
64
|
+
export declare const BINARY_BUSY_ERROR_CODES: string[];
|
|
65
|
+
export declare const MAX_SPAWN_RETRIES = 3;
|
|
66
|
+
export declare const SPAWN_RETRY_DELAY_MS = 1000;
|
|
63
67
|
export declare const WDIO_NAMING_PREFIX = "WebdriverIO-";
|
|
64
68
|
export declare const PERF_METRICS_WAIT_TIME = 2000;
|
|
65
69
|
export declare const UPDATED_CLI_ENDPOINT = "sdk/v1/update_cli";
|
package/build/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,eAAO,MAAM,mBAAmB,qHAStB,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAI/B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,eAAO,MAAM,mBAAmB,qHAStB,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAI/B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,kBAAkB,CAIvD,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,OAAoC,CAAA;AAEvE,eAAO,MAAM,aAAa,qDAAqD,CAAA;AAC/E,eAAO,MAAM,iBAAiB,wDAAwD,CAAA;AACtF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