@applitools/core 4.38.2 → 4.39.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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.39.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.2...js/core@4.39.0) (2025-05-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * add logging for offline execution startup with system details ([#2971](https://github.com/Applitools-Dev/sdk/issues/2971)) ([82eb5cd](https://github.com/Applitools-Dev/sdk/commit/82eb5cdffe5cf1f88f20e62d50f43600b0a06361))
9
+ * mac arm binary | FLD-3010 ([#2950](https://github.com/Applitools-Dev/sdk/issues/2950)) ([0cb7f59](https://github.com/Applitools-Dev/sdk/commit/0cb7f59b851c746e12b3a8a210a505adf3230903))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * missing resources problem ([#2976](https://github.com/Applitools-Dev/sdk/issues/2976)) ([ab0d217](https://github.com/Applitools-Dev/sdk/commit/ab0d217d23a1df4ad24618a9bf00dc84c57cd8bc))
15
+
16
+
17
+ ### Dependencies
18
+
19
+ * @applitools/core-base bumped to 1.25.3
20
+ #### Performance Improvements
21
+
22
+ * batchify log event ([#2970](https://github.com/Applitools-Dev/sdk/issues/2970)) ([9b1556f](https://github.com/Applitools-Dev/sdk/commit/9b1556f0c9ddc64a52b8b3f928c18e35f6fbbc17))
23
+ * @applitools/ec-client bumped to 1.10.14
24
+
25
+
3
26
  ## [4.38.2](https://github.com/Applitools-Dev/sdk/compare/js/core@4.38.1...js/core@4.38.2) (2025-05-11)
4
27
 
5
28
 
@@ -38,11 +38,20 @@ const utils = __importStar(require("@applitools/utils"));
38
38
  const merge_configs_1 = require("./merge-configs");
39
39
  const format_results_1 = require("../utils/format-results");
40
40
  const throat_1 = __importDefault(require("throat"));
41
+ const os_1 = __importDefault(require("os"));
41
42
  const throttledReadFile = (0, throat_1.default)(Number(process.env.APPLITOOLS_FILE_READING_CONCURRENCY) || 1000, fs_1.default.promises.readFile);
42
43
  function getConsoleLogLimit() {
43
44
  var _a;
44
45
  return (_a = utils.general.getEnvValue('OFFLINE_LOG_LIMIT', 'number')) !== null && _a !== void 0 ? _a : 20;
45
46
  }
47
+ function version() {
48
+ try {
49
+ return JSON.parse(fs_1.default.readFileSync(require.resolve('../../package.json'), 'utf-8')).version;
50
+ }
51
+ catch (e) {
52
+ return 'unknown';
53
+ }
54
+ }
46
55
  async function runOfflineSnapshots(options) {
47
56
  var _a;
48
57
  const limitConsoleLogs = getConsoleLogLimit();
@@ -53,7 +62,7 @@ async function runOfflineSnapshots(options) {
53
62
  const startTime = Date.now();
54
63
  const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : (0, logger_1.makeLogger)({ format: { label: 'offline-exec' } });
55
64
  const eyesServerSettings = { ...options.config.open, ...options };
56
- const core = (0, core_1.makeCore)();
65
+ const core = (0, core_1.makeCore)({ agentId: `js/core-offline/${version()}`, logger });
57
66
  const account = await core.getAccountInfo({ settings: eyesServerSettings });
58
67
  const ufgClient = await (0, get_ufg_client_1.makeGetUFGClient)({ logger })({
59
68
  settings: { ...account.eyesServer, ...account.ufgServer },
@@ -61,6 +70,7 @@ async function runOfflineSnapshots(options) {
61
70
  const testFolders = (await fs_1.default.promises.readdir(offlineLocationPath))
62
71
  .filter(filename => filename.startsWith('test-'))
63
72
  .sort();
73
+ void logStartupInfo();
64
74
  if (testFolders.length === 1) {
65
75
  logger.console.log(`Running single test from folder ${offlineLocationPath}`);
66
76
  }
@@ -260,6 +270,21 @@ async function runOfflineSnapshots(options) {
260
270
  logger: uploadLogger,
261
271
  });
262
272
  });
273
+ resourcePromises.push(ufgClient.uploadResource({
274
+ resource: {
275
+ hash: target.snapshot,
276
+ async getter() {
277
+ return {
278
+ id: '',
279
+ url: '',
280
+ value: await throttledReadFile(path_1.default.join(offlineLocationPath, 'resources', target.snapshot.hash)),
281
+ contentType: target.snapshot.contentType,
282
+ hash: target.snapshot,
283
+ };
284
+ },
285
+ },
286
+ logger: uploadLogger,
287
+ }));
263
288
  return Promise.all(resourcePromises);
264
289
  });
265
290
  await Promise.all(promises);
@@ -349,6 +374,48 @@ async function runOfflineSnapshots(options) {
349
374
  const mergedCheckSettings = (0, merge_configs_1.mergeConfigs)(baseSettings, options.config.check);
350
375
  return { mergedCheckSettings, baseTarget };
351
376
  }
377
+ async function logStartupInfo() {
378
+ await core.logEvent({
379
+ logger,
380
+ settings: {
381
+ ...account.eyesServer,
382
+ ...account.ufgServer,
383
+ level: 'Notice',
384
+ event: {
385
+ type: 'offlineExecutionStart',
386
+ timestamp: new Date().toISOString(),
387
+ offlineLocationPath,
388
+ testCount: testFolders.length,
389
+ ufgServerUrl: account.ufgServer.ufgServerUrl,
390
+ CI: process.env.CI,
391
+ config: options.config,
392
+ driver: {
393
+ platform: os_1.default.platform(),
394
+ version: os_1.default.release(),
395
+ arch: os_1.default.arch(),
396
+ cpu: {
397
+ count: os_1.default.cpus().length,
398
+ avgSpeed: os_1.default.cpus().reduce((acc, cpu) => acc + cpu.speed, 0) / os_1.default.cpus().length,
399
+ model: os_1.default.cpus()[0].model,
400
+ },
401
+ memory: {
402
+ total: os_1.default.totalmem(),
403
+ free: os_1.default.freemem(),
404
+ },
405
+ nodeVersion: process.version,
406
+ versions: await Promise.all(['eyes', 'core', 'core-base', 'ufg-client']
407
+ .map(async (name) => ({
408
+ name,
409
+ version: JSON.parse(await throttledReadFile(require.resolve(`@applitools/${name}/package.json`), {
410
+ encoding: 'utf-8',
411
+ })).version,
412
+ }))
413
+ .map(promise => promise.catch(e => `failed to get version: ${e}`))),
414
+ },
415
+ },
416
+ },
417
+ });
418
+ }
352
419
  }
353
420
  exports.runOfflineSnapshots = runOfflineSnapshots;
354
421
  function uniq(arr) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.38.2",
3
+ "version": "4.39.0",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -71,15 +71,16 @@
71
71
  "node20-linux-x64-musl": "./bin/core-alpine",
72
72
  "node20-linux-arm64": "./bin/core-linux-arm64",
73
73
  "node20-darwin-x64": "./bin/core-macos",
74
- "node20-win-x64": "./bin/core-win.exe"
74
+ "node20-win-x64": "./bin/core-win.exe",
75
+ "node20-darwin-arm64": "./bin/core-macos-arm64"
75
76
  }
76
77
  },
77
78
  "dependencies": {
78
- "@applitools/core-base": "1.25.2",
79
+ "@applitools/core-base": "1.25.3",
79
80
  "@applitools/dom-capture": "11.5.5",
80
81
  "@applitools/dom-snapshot": "4.11.21",
81
82
  "@applitools/driver": "1.21.4",
82
- "@applitools/ec-client": "1.10.13",
83
+ "@applitools/ec-client": "1.10.14",
83
84
  "@applitools/logger": "2.1.4",
84
85
  "@applitools/nml-client": "1.9.4",
85
86
  "@applitools/req": "1.7.12",
@@ -113,6 +114,7 @@
113
114
  "@types/semver": "^7.5.8",
114
115
  "@types/yargs": "^17.0.22",
115
116
  "chromedriver": "^131.0.5",
117
+ "crypto": "^1.0.1",
116
118
  "nock": "^13.3.2",
117
119
  "png-async": "^0.9.4",
118
120
  "puppeteer": "^19.11.1",