@mablhq/mabl-cli 1.58.20 → 1.58.28
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/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +4 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +1 -1
- package/commands/commandUtil/util.js +2 -1
- package/commands/constants.js +3 -1
- package/commands/tests/tests_cmds/run.js +21 -0
- package/core/execution/LocalizationOptionsLists.js +1253 -0
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/mablApi/index.js +1 -1
- package/mablscript/MablSymbol.js +1 -1
- package/mablscript/steps/CookieUtils.js +40 -7
- package/mablscript/steps/SetCookieStep.js +36 -20
- package/mablscriptFind/index.js +1 -1
- package/package.json +2 -2
- package/resources/mablFind.js +1 -1
- package/util/TestOutputWriter.js +12 -8
package/util/TestOutputWriter.js
CHANGED
|
@@ -29,10 +29,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.LocalTestOutputWriter = void 0;
|
|
30
30
|
const fs = __importStar(require("fs"));
|
|
31
31
|
const CloudStorageWriter_1 = __importDefault(require("./CloudStorageWriter"));
|
|
32
|
-
const murmurhash = __importStar(require("murmurhash"));
|
|
33
32
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
33
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
34
34
|
const path_1 = __importDefault(require("path"));
|
|
35
|
-
const HASH_PREFIX_LENGTH = 4;
|
|
36
35
|
const EXECUTION_OUTPUT_PATH_PREFIX = 'execution-output';
|
|
37
36
|
const MAX_PATH_LENGTH = 1024;
|
|
38
37
|
class LocalTestOutputWriter {
|
|
@@ -75,20 +74,25 @@ class CloudOutputWriter {
|
|
|
75
74
|
await this.storageWriter.write(path, contentType, data);
|
|
76
75
|
return `${this.storageWriter.bucketName()}/${path}`;
|
|
77
76
|
}
|
|
77
|
+
randomPathComponent() {
|
|
78
|
+
return (crypto_1.default
|
|
79
|
+
.randomBytes(3)
|
|
80
|
+
.toString('base64url')
|
|
81
|
+
.replace(/-/g, 'm')
|
|
82
|
+
.replace(/_/g, 'a')
|
|
83
|
+
.toLowerCase());
|
|
84
|
+
}
|
|
78
85
|
nameToFullPath(name) {
|
|
79
86
|
const directoryPath = `${this.applicationId}/${this.planId}/${this.planRunId}/${this.testRunId}`;
|
|
80
|
-
const
|
|
81
|
-
const fullPath = `${EXECUTION_OUTPUT_PATH_PREFIX}/${
|
|
87
|
+
const randomComponent = this.randomPathComponent();
|
|
88
|
+
const fullPath = `${EXECUTION_OUTPUT_PATH_PREFIX}/${randomComponent}/${directoryPath}/${name}`;
|
|
82
89
|
if (fullPath.length <= MAX_PATH_LENGTH) {
|
|
83
90
|
return fullPath;
|
|
84
91
|
}
|
|
85
92
|
loggingProvider_1.logger.info(`WARNING: Truncating path longer than ${MAX_PATH_LENGTH}: ${fullPath}`);
|
|
86
93
|
const overage = fullPath.length - MAX_PATH_LENGTH;
|
|
87
94
|
const truncatedName = name.substring(overage);
|
|
88
|
-
return `${EXECUTION_OUTPUT_PATH_PREFIX}/${
|
|
89
|
-
}
|
|
90
|
-
generateHash(value) {
|
|
91
|
-
return murmurhash.v3(value).toString(36).substring(0, HASH_PREFIX_LENGTH);
|
|
95
|
+
return `${EXECUTION_OUTPUT_PATH_PREFIX}/${randomComponent}/${directoryPath}/${truncatedName}`;
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
exports.default = CloudOutputWriter;
|