@applitools/core 4.20.0 → 4.20.1
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/CHANGELOG.md +17 -0
- package/dist/run-offline-snapshots.js +9 -17
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.20.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.20.0...js/core@4.20.1) (2024-10-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* don't tar with offline ([#2550](https://github.com/Applitools-Dev/sdk/issues/2550)) ([d8b1a83](https://github.com/Applitools-Dev/sdk/commit/d8b1a833d13b01f5306501772e1c831692512360))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/core-base bumped to 1.17.1
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* don't tar with offline ([#2550](https://github.com/Applitools-Dev/sdk/issues/2550)) ([d8b1a83](https://github.com/Applitools-Dev/sdk/commit/d8b1a833d13b01f5306501772e1c831692512360))
|
|
17
|
+
* @applitools/ec-client bumped to 1.9.7
|
|
18
|
+
|
|
19
|
+
|
|
3
20
|
## [4.20.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.19.0...js/core@4.20.0) (2024-09-30)
|
|
4
21
|
|
|
5
22
|
|
|
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.runOfflineSnapshots = void 0;
|
|
30
30
|
const fs_1 = __importDefault(require("fs"));
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
|
-
const tar = __importStar(require("tar"));
|
|
33
32
|
const core_1 = require("./core");
|
|
34
33
|
const get_ufg_client_1 = require("./ufg/get-ufg-client");
|
|
35
34
|
const logger_1 = require("@applitools/logger");
|
|
@@ -46,20 +45,20 @@ async function runOfflineSnapshots(options) {
|
|
|
46
45
|
const ufgClient = await (0, get_ufg_client_1.makeGetUFGClient)({ logger })({
|
|
47
46
|
settings: { ...account.eyesServer, ...account.ufgServer },
|
|
48
47
|
});
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
logger.console.log(`Running execution ${
|
|
48
|
+
const executionFolders = (await fs_1.default.promises.readdir(options.offlineLocationPath)).filter(filename => /execution\-\d+/.test(filename));
|
|
49
|
+
if (executionFolders.length === 1) {
|
|
50
|
+
logger.console.log(`Running execution ${executionFolders[0]} from folder ${path_1.default.resolve(options.offlineLocationPath)}`);
|
|
52
51
|
}
|
|
53
|
-
else if (
|
|
52
|
+
else if (executionFolders.length === 0) {
|
|
54
53
|
logger.console.log('No execution artifacts were found at', options.offlineLocationPath);
|
|
55
54
|
}
|
|
56
55
|
else {
|
|
57
|
-
logger.console.log(`Running the following executions from folder ${options.offlineLocationPath} :\n ${
|
|
56
|
+
logger.console.log(`Running the following executions from folder ${options.offlineLocationPath} :\n ${executionFolders.join('\n ')}`);
|
|
58
57
|
}
|
|
59
|
-
if (
|
|
58
|
+
if (executionFolders.length === 0) {
|
|
60
59
|
throw new Error(`Unable to find offline executions in ${options.offlineLocationPath}`);
|
|
61
60
|
}
|
|
62
|
-
const allTestResults = (await Promise.all(
|
|
61
|
+
const allTestResults = (await Promise.all(executionFolders.map(runExecution))).flat();
|
|
63
62
|
const { exitCode, outputStr } = processResults({ testResults: allTestResults, totalTime: Date.now() - startTime });
|
|
64
63
|
if (exitCode) {
|
|
65
64
|
throw new Error(outputStr);
|
|
@@ -67,15 +66,8 @@ async function runOfflineSnapshots(options) {
|
|
|
67
66
|
else {
|
|
68
67
|
logger.console.log(outputStr);
|
|
69
68
|
}
|
|
70
|
-
async function runExecution(
|
|
71
|
-
const executionName = executionFile.replace('.tar.gz', '');
|
|
69
|
+
async function runExecution(executionName) {
|
|
72
70
|
const executionLogger = logger.extend({ tags: [executionName] });
|
|
73
|
-
executionLogger.log('unpacking execution', executionFile);
|
|
74
|
-
await tar.extract({
|
|
75
|
-
file: path_1.default.resolve(options.offlineLocationPath, executionFile),
|
|
76
|
-
gzip: true,
|
|
77
|
-
C: options.offlineLocationPath,
|
|
78
|
-
});
|
|
79
71
|
const executionPath = path_1.default.resolve(options.offlineLocationPath, executionName);
|
|
80
72
|
executionLogger.log('handling execution', executionPath);
|
|
81
73
|
const testFolders = (await fs_1.default.promises.readdir(executionPath)).filter(foldername => foldername.startsWith('test-'));
|
|
@@ -95,7 +87,7 @@ async function runOfflineSnapshots(options) {
|
|
|
95
87
|
// @ts-expect-error // we use node v12 types, therefore it's not aware of the existence of `fs.promises.rm`
|
|
96
88
|
await fs_1.default.promises.rm(executionPath, { recursive: true });
|
|
97
89
|
await core.closeBatch({ settings: batchIds.map(batchId => ({ batchId, ...account.eyesServer })) });
|
|
98
|
-
executionLogger.log('
|
|
90
|
+
executionLogger.log('done execution', executionName);
|
|
99
91
|
return allTestResults;
|
|
100
92
|
}
|
|
101
93
|
async function runTest(executionPath, testPath, openSettings, logger) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.1",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@applitools/core-base": "1.17.
|
|
77
|
+
"@applitools/core-base": "1.17.1",
|
|
78
78
|
"@applitools/dom-capture": "11.5.0",
|
|
79
79
|
"@applitools/dom-snapshot": "4.11.3",
|
|
80
80
|
"@applitools/driver": "1.19.1",
|
|
81
|
-
"@applitools/ec-client": "1.9.
|
|
81
|
+
"@applitools/ec-client": "1.9.7",
|
|
82
82
|
"@applitools/logger": "2.0.18",
|
|
83
83
|
"@applitools/nml-client": "1.8.11",
|
|
84
84
|
"@applitools/req": "1.7.2",
|
|
@@ -93,7 +93,6 @@
|
|
|
93
93
|
"chalk": "4.1.2",
|
|
94
94
|
"node-fetch": "2.6.7",
|
|
95
95
|
"semver": "7.6.2",
|
|
96
|
-
"tar": "7.4.3",
|
|
97
96
|
"webdriver": "7.31.1",
|
|
98
97
|
"ws": "8.17.1",
|
|
99
98
|
"yargs": "17.7.2"
|