@testomatio/reporter 1.6.3-beta-artlog → 1.6.3-beta-artifacts-2

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
@@ -220,6 +220,27 @@ program
220
220
  }
221
221
 
222
222
  console.log(APP_PREFIX, '🗄️', client.uploader.successfulUploads.length, 'artifacts 🟢uploaded');
223
+
224
+ if (client.uploader.successfulUploads.length) {
225
+ debug('\n', APP_PREFIX, `🗄️ ${client.uploader.successfulUploads.length} artifacts uploaded to S3 bucket`);
226
+ const uploadedArtifacts = client.uploader.successfulUploads.map(file => ({
227
+ relativePath: file.path.replace(process.cwd(), ''),
228
+ link: file.link,
229
+ sizePretty: prettyBytes(file.size, { round: 0 }).toString(),
230
+ }));
231
+
232
+ uploadedArtifacts.forEach(upload => {
233
+ debug(
234
+ `🟢 Uploaded artifact`,
235
+ `${upload.relativePath},`,
236
+ 'size:',
237
+ `${upload.sizePretty},`,
238
+ 'link:',
239
+ `${upload.link}`,
240
+ );
241
+ });
242
+ }
243
+
223
244
  const filesizeStrMaxLength = 7;
224
245
 
225
246
  if (client.uploader.failedUploads.length) {
package/lib/client.js CHANGED
@@ -35,7 +35,6 @@ class Client {
35
35
  this.version = JSON.parse(fs.readFileSync(join(__dirname, '..', 'package.json')).toString()).version;
36
36
  this.executionList = Promise.resolve();
37
37
  this.uploader = new S3Uploader();
38
- this.uploader.checkEnabled();
39
38
 
40
39
  console.log(APP_PREFIX, `Testomatio Reporter v${this.version}`);
41
40
  }
@@ -110,7 +109,8 @@ class Client {
110
109
  const runId = this.pipeStore?.runId;
111
110
  if (runId) this.runId = runId;
112
111
  storeRunId(this.runId);
113
-
112
+ })
113
+ .then(() => {
114
114
  this.uploader.checkEnabled();
115
115
  })
116
116
  .then(() => undefined); // fixes return type
@@ -251,7 +251,9 @@ class Client {
251
251
  this.queue = this.queue
252
252
  .then(() => Promise.all(this.pipes.map(p => p.finishRun(runParams))))
253
253
  .then(() => {
254
- if (this.uploader.successfulUploads.length && this.uploader.isEnabled) {
254
+ if (!this.uploader.isEnabled) return;
255
+
256
+ if (this.uploader.successfulUploads.length) {
255
257
  console.log(
256
258
  APP_PREFIX,
257
259
  `🗄️ ${this.uploader.successfulUploads.length} artifacts ${
@@ -304,7 +306,7 @@ class Client {
304
306
  });
305
307
  }
306
308
 
307
- if (this.uploader.isEnabled && this.uploader.skippedUploads.length) {
309
+ if (this.uploader.skippedUploads.length) {
308
310
  console.log(
309
311
  '\n',
310
312
  APP_PREFIX,
package/lib/uploader.js CHANGED
@@ -67,7 +67,7 @@ class S3Uploader {
67
67
  if (this.isEnabled !== undefined) return this.isEnabled;
68
68
 
69
69
  const { S3_BUCKET, TESTOMATIO_DISABLE_ARTIFACTS } = this.getConfig();
70
- if (!S3_BUCKET) debug(`Upload is disabled because S3_BUCKET is not set`);
70
+ if (!S3_BUCKET) debug(`Artifacts uploading is disabled because S3_BUCKET is not set`);
71
71
  this.isEnabled = !!(S3_BUCKET && !TESTOMATIO_DISABLE_ARTIFACTS);
72
72
 
73
73
  if (this.isEnabled) debug('S3 uploader is enabled');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.3-beta-artlog",
3
+ "version": "1.6.3-beta-artifacts-2",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",