@testomatio/reporter 1.6.2 → 1.6.3-beta-artlog

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
@@ -219,7 +219,7 @@ program
219
219
  await client.addTestRun(undefined, { rid, files });
220
220
  }
221
221
 
222
- console.log(APP_PREFIX, '🗄️', client.uploader.totalSuccessfulUploadsCount, 'artifacts 🟢uploaded');
222
+ console.log(APP_PREFIX, '🗄️', client.uploader.successfulUploads.length, 'artifacts 🟢uploaded');
223
223
  const filesizeStrMaxLength = 7;
224
224
 
225
225
  if (client.uploader.failedUploads.length) {
@@ -74,7 +74,7 @@ program
74
74
  });
75
75
  }
76
76
 
77
- console.log(APP_PREFIX, client.uploader.totalSuccessfulUploadsCount, 'artifacts uploaded');
77
+ console.log(APP_PREFIX, client.uploader.successfulUploads.length, 'artifacts uploaded');
78
78
  if (client.uploader.failedUploads.length) {
79
79
  console.log(APP_PREFIX, client.uploader.failedUploads.length, 'artifacts failed to upload');
80
80
  }
package/lib/client.js CHANGED
@@ -251,10 +251,10 @@ 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.totalSuccessfulUploadsCount && this.uploader.isEnabled) {
254
+ if (this.uploader.successfulUploads.length && this.uploader.isEnabled) {
255
255
  console.log(
256
256
  APP_PREFIX,
257
- `🗄️ ${this.uploader.totalSuccessfulUploadsCount} artifacts ${
257
+ `🗄️ ${this.uploader.successfulUploads.length} artifacts ${
258
258
  process.env.TESTOMATIO_PRIVATE_ARTIFACTS ? 'privately' : chalk.bold('publicly')
259
259
  } 🟢 uploaded to S3 bucket`,
260
260
  );
@@ -262,6 +262,26 @@ class Client {
262
262
 
263
263
  const filesizeStrMaxLength = 7;
264
264
 
265
+ if (this.uploader.successfulUploads.length) {
266
+ debug('\n', APP_PREFIX, `🗄️ ${this.uploader.successfulUploads.length} artifacts uploaded to S3 bucket`);
267
+ const uploadedArtifacts = this.uploader.successfulUploads.map(file => ({
268
+ relativePath: file.path.replace(process.cwd(), ''),
269
+ link: file.link,
270
+ sizePretty: prettyBytes(file.size, { round: 0 }).toString(),
271
+ }));
272
+
273
+ uploadedArtifacts.forEach(upload => {
274
+ debug(
275
+ `🟢 Uploaded artifact`,
276
+ `${upload.relativePath},`,
277
+ 'size:',
278
+ `${upload.sizePretty},`,
279
+ 'link:',
280
+ `${upload.link}`,
281
+ );
282
+ });
283
+ }
284
+
265
285
  if (this.uploader.failedUploads.length) {
266
286
  console.log(
267
287
  '\n',
package/lib/uploader.js CHANGED
@@ -21,9 +21,10 @@ class S3Uploader {
21
21
  */
22
22
  this.skippedUploads = [];
23
23
  this.failedUploads = [];
24
- this.totalSuccessfulUploadsCount = 0;
25
-
26
- this.succesfulUploads = {};
24
+ /**
25
+ * @type {{path: string, size: number, link: string}[]}
26
+ */
27
+ this.successfulUploads = [];
27
28
 
28
29
  this.configKeys = [
29
30
  'S3_ENDPOINT',
@@ -119,8 +120,8 @@ class S3Uploader {
119
120
  });
120
121
 
121
122
  const link = await this.getS3LocationLink(upload);
122
- this.totalSuccessfulUploadsCount++;
123
- this.succesfulUploads[Key] = link;
123
+ this.successfulUploads.push({ path: file.path, size: file.size, link });
124
+ debug(`📤 Uploaded artifact. File: ${file.path}, size: ${prettyBytes(file.size)}, link: ${link}`);
124
125
  return link;
125
126
  } catch (e) {
126
127
  this.failedUploads.push({ path: file.path, size: file.size });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.2",
3
+ "version": "1.6.3-beta-artlog",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",