@testomatio/reporter 2.3.7-beta.8-stack-artifacts β†’ 2.3.7

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/lib/bin/cli.js CHANGED
File without changes
File without changes
@@ -35,7 +35,7 @@ while (i < args.length) {
35
35
  newArgs[0] = 'start';
36
36
  }
37
37
  else if (arg === '--finish') {
38
- // Map --finish to finish command
38
+ // Map --finish to finish command
39
39
  newArgs[0] = 'finish';
40
40
  }
41
41
  else {
@@ -46,8 +46,8 @@ while (i < args.length) {
46
46
  }
47
47
  // Execute the main CLI with mapped arguments
48
48
  const child = (0, node_child_process_1.spawn)(process.execPath, [cliPath, ...newArgs], {
49
- stdio: 'inherit'
49
+ stdio: 'inherit',
50
50
  });
51
- child.on('exit', (code) => {
51
+ child.on('exit', code => {
52
52
  process.exit(code);
53
53
  });
File without changes
package/lib/client.js CHANGED
@@ -173,7 +173,7 @@ class Client {
173
173
  * @type {TestData}
174
174
  */
175
175
  const { rid, error = null, steps: originalSteps, title, suite_title, } = testData;
176
- const steps = originalSteps;
176
+ let steps = originalSteps;
177
177
  const uploadedFiles = [];
178
178
  const stackArtifactsEnabled = (0, utils_js_1.transformEnvVarToBoolean)(process.env.TESTOMATIO_STACK_ARTIFACTS);
179
179
  const { time = 0, example = null, files = [], filesBuffers = [], code = null, file, suite_id, test_id, timestamp, links, manuallyAttachedArtifacts, overwrite, tags, } = testData;
@@ -192,10 +192,10 @@ class Client {
192
192
  message = error?.message;
193
193
  }
194
194
  let fullLogs = this.formatLogs({ error: errorFormatted, steps, logs: testData.logs });
195
- if (stackArtifactsEnabled) {
196
- const timestamp = +new Date;
197
- uploadedFiles.push(this.uploader.uploadFileAsBuffer(Buffer.from(stripColors(fullLogs), 'utf8'), [this.runId, rid, `logs_${timestamp}.log`]));
195
+ if (stackArtifactsEnabled && fullLogs?.trim()?.length > 0) {
196
+ uploadedFiles.push(this.uploader.uploadFileAsBuffer(Buffer.from(stripColors(fullLogs), 'utf8'), [this.runId, rid, `logs_${+new Date}.log`]));
198
197
  fullLogs = '';
198
+ steps = null;
199
199
  }
200
200
  if (!this.pipes || !this.pipes.length)
201
201
  this.pipes = await (0, index_js_1.pipesFactory)(this.paramsForPipesFactory || {}, this.pipeStore);
@@ -294,7 +294,7 @@ class Client {
294
294
  const uploadedArtifacts = this.uploader.successfulUploads.map(file => ({
295
295
  relativePath: file.path.replace(process.cwd(), ''),
296
296
  link: file.link,
297
- sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(),
297
+ sizePretty: file.size == null ? 'unknown' : (0, filesize_1.filesize)(file.size, { round: 0 }).toString(),
298
298
  }));
299
299
  uploadedArtifacts.forEach(upload => {
300
300
  debug(`🟒Uploaded artifact`, `${upload.relativePath},`, 'size:', `${upload.sizePretty},`, 'link:', `${upload.link}`);
@@ -304,7 +304,7 @@ class Client {
304
304
  console.log(constants_js_1.APP_PREFIX, `πŸ—„οΈ ${this.uploader.failedUploads.length} artifacts πŸ”΄${picocolors_1.default.bold('failed')} to upload`);
305
305
  const failedUploads = this.uploader.failedUploads.map(file => ({
306
306
  relativePath: file.path.replace(process.cwd(), ''),
307
- sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(),
307
+ sizePretty: file.size == null ? 'unknown' : (0, filesize_1.filesize)(file.size, { round: 0 }).toString(),
308
308
  }));
309
309
  const pathPadding = Math.max(...failedUploads.map(upload => upload.relativePath.length)) + 1;
310
310
  failedUploads.forEach(upload => {
@@ -420,7 +420,7 @@ class TestomatioPipe {
420
420
  if (this.runUrl && this.proceed) {
421
421
  const notFinishedMessage = picocolors_1.default.yellow(picocolors_1.default.bold('Run was not finished because of $TESTOMATIO_PROCEED'));
422
422
  console.log(constants_js_1.APP_PREFIX, `πŸ“Š ${notFinishedMessage}. Report URL: ${picocolors_1.default.magenta(this.runUrl)}`);
423
- console.log(constants_js_1.APP_PREFIX, `πŸ›¬ Run to finish it: TESTOMATIO_RUN=${this.runId} npx start-test-run --finish`);
423
+ console.log(constants_js_1.APP_PREFIX, `πŸ›¬ Run to finish it: TESTOMATIO_RUN=${this.runId} npx @testomatio/reporter finish`);
424
424
  }
425
425
  if (this.hasUnmatchedTests) {
426
426
  console.log('');