@testomatio/reporter 2.3.7-beta.9-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.3.7-beta.9-stack-artifacts",
3
+ "version": "2.3.7",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -18,7 +18,7 @@ const newArgs = ['run'];
18
18
  let i = 0;
19
19
  while (i < args.length) {
20
20
  const arg = args[i];
21
-
21
+
22
22
  if (arg === '-c' || arg === '--command') {
23
23
  // Map -c/--command to positional argument for run command
24
24
  i++;
@@ -33,7 +33,7 @@ while (i < args.length) {
33
33
  // Map --launch to start command
34
34
  newArgs[0] = 'start';
35
35
  } else if (arg === '--finish') {
36
- // Map --finish to finish command
36
+ // Map --finish to finish command
37
37
  newArgs[0] = 'finish';
38
38
  } else {
39
39
  // Pass through other arguments
@@ -45,9 +45,9 @@ while (i < args.length) {
45
45
  // Execute the main CLI with mapped arguments
46
46
 
47
47
  const child = spawn(process.execPath, [cliPath, ...newArgs], {
48
- stdio: 'inherit'
48
+ stdio: 'inherit',
49
49
  });
50
50
 
51
- child.on('exit', (code) => {
51
+ child.on('exit', code => {
52
52
  process.exit(code);
53
- });
53
+ });
package/src/client.js CHANGED
@@ -170,12 +170,12 @@ class Client {
170
170
  title,
171
171
  suite_title,
172
172
  } = testData;
173
- const steps = originalSteps;
173
+ let steps = originalSteps;
174
174
 
175
175
  const uploadedFiles = [];
176
176
  const stackArtifactsEnabled = transformEnvVarToBoolean(process.env.TESTOMATIO_STACK_ARTIFACTS);
177
177
 
178
-
178
+
179
179
  const {
180
180
  time = 0,
181
181
  example = null,
@@ -210,18 +210,18 @@ class Client {
210
210
 
211
211
  let fullLogs = this.formatLogs({ error: errorFormatted, steps, logs: testData.logs });
212
212
 
213
- if (stackArtifactsEnabled) {
214
- const timestamp = +new Date;
213
+ if (stackArtifactsEnabled && fullLogs?.trim()?.length > 0) {
215
214
  uploadedFiles.push(
216
215
  this.uploader.uploadFileAsBuffer(
217
216
  Buffer.from(stripColors(fullLogs), 'utf8'),
218
- [this.runId, rid, `logs_${timestamp}.log`]
217
+ [this.runId, rid, `logs_${+new Date}.log`]
219
218
  )
220
219
  );
221
220
  fullLogs = '';
221
+ steps = null;
222
222
  }
223
223
 
224
-
224
+
225
225
  if (!this.pipes || !this.pipes.length)
226
226
  this.pipes = await pipesFactory(this.paramsForPipesFactory || {}, this.pipeStore);
227
227
 
@@ -336,7 +336,7 @@ class Client {
336
336
  const uploadedArtifacts = this.uploader.successfulUploads.map(file => ({
337
337
  relativePath: file.path.replace(process.cwd(), ''),
338
338
  link: file.link,
339
- sizePretty: prettyBytes(file.size, { round: 0 }).toString(),
339
+ sizePretty: file.size == null ? 'unknown' : prettyBytes(file.size, { round: 0 }).toString(),
340
340
  }));
341
341
 
342
342
  uploadedArtifacts.forEach(upload => {
@@ -358,7 +358,7 @@ class Client {
358
358
  );
359
359
  const failedUploads = this.uploader.failedUploads.map(file => ({
360
360
  relativePath: file.path.replace(process.cwd(), ''),
361
- sizePretty: prettyBytes(file.size, { round: 0 }).toString(),
361
+ sizePretty: file.size == null ? 'unknown' : prettyBytes(file.size, { round: 0 }).toString(),
362
362
  }));
363
363
 
364
364
  const pathPadding = Math.max(...failedUploads.map(upload => upload.relativePath.length)) + 1;
@@ -472,7 +472,7 @@ class TestomatioPipe {
472
472
  if (this.runUrl && this.proceed) {
473
473
  const notFinishedMessage = pc.yellow(pc.bold('Run was not finished because of $TESTOMATIO_PROCEED'));
474
474
  console.log(APP_PREFIX, `📊 ${notFinishedMessage}. Report URL: ${pc.magenta(this.runUrl)}`);
475
- console.log(APP_PREFIX, `🛬 Run to finish it: TESTOMATIO_RUN=${this.runId} npx start-test-run --finish`);
475
+ console.log(APP_PREFIX, `🛬 Run to finish it: TESTOMATIO_RUN=${this.runId} npx @testomatio/reporter finish`);
476
476
  }
477
477
 
478
478
  if (this.hasUnmatchedTests) {