@testomatio/reporter 2.22.0 → 2.24.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.
@@ -890,7 +890,11 @@ class AllureReader {
890
890
  uploadedTests += chunk.length;
891
891
  debug(`Uploaded ${uploadedTests}/${totalTests} tests`);
892
892
  }
893
- if (totalChunks > 1) {
893
+ const testomatioPipe = this.pipes.find(p => p.constructor.name === 'TestomatioPipe');
894
+ if (testomatioPipe && !testomatioPipe.isEnabled) {
895
+ console.warn(constants_js_1.APP_PREFIX, `⚠️ Tests were not uploaded to Testomat.io, skipping report`);
896
+ }
897
+ else if (totalChunks > 1) {
894
898
  console.log(constants_js_1.APP_PREFIX, `✅ Successfully uploaded ${uploadedTests} tests in ${totalChunks} chunks`);
895
899
  }
896
900
  else {
@@ -77,6 +77,11 @@ class CoveragePipe {
77
77
  shouldRetry: (error) => {
78
78
  if (!error.response)
79
79
  return false;
80
+ // a custom shouldRetry replaces the built-in check, which is the only place
81
+ // where the retry limit is enforced, so the limit must be checked here as well
82
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
83
+ if (currentRetryAttempt >= retry)
84
+ return false;
80
85
  switch (error.response?.status) {
81
86
  case 400: // Bad request (probably wrong API key)
82
87
  case 404: // Test not matched
@@ -121,6 +121,11 @@ class TestomatioPipe {
121
121
  shouldRetry: error => {
122
122
  if (!error.response)
123
123
  return false;
124
+ // a custom shouldRetry replaces the built-in check, which is the only place
125
+ // where the retry limit is enforced, so the limit must be checked here as well
126
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
127
+ if (currentRetryAttempt >= retry)
128
+ return false;
124
129
  // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
125
130
  // 500 could also be related to both user or server mistake, but decided not to retry for now
126
131
  // this code code be changed to retry 500 too if needed
package/lib/xmlReader.js CHANGED
@@ -519,7 +519,11 @@ class XmlReader {
519
519
  uploadedTests += chunk.length;
520
520
  debug(`Uploaded ${uploadedTests}/${totalTests} tests`);
521
521
  }
522
- if (totalChunks > 1) {
522
+ const testomatioPipe = this.pipes.find(p => p.constructor.name === 'TestomatioPipe');
523
+ if (testomatioPipe && !testomatioPipe.isEnabled) {
524
+ log_js_1.log.warn(`⚠️ Tests were not uploaded to Testomat.io, skipping report`);
525
+ }
526
+ else if (totalChunks > 1) {
523
527
  log_js_1.log.info(`✅ Successfully uploaded ${uploadedTests} tests in ${totalChunks} chunks`);
524
528
  }
525
529
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.22.0",
3
+ "version": "2.24.0",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -106,7 +106,7 @@
106
106
  "mock-http-server": "^1.4.5",
107
107
  "pino": "^8.15.0",
108
108
  "prettier": "^3.2.5",
109
- "puppeteer": "^22.15.0",
109
+ "puppeteer": "^25.18.1",
110
110
  "typescript": "^5.5.4",
111
111
  "vitest": "^5.0.5"
112
112
  },
@@ -986,7 +986,10 @@ class AllureReader {
986
986
  debug(`Uploaded ${uploadedTests}/${totalTests} tests`);
987
987
  }
988
988
 
989
- if (totalChunks > 1) {
989
+ const testomatioPipe = this.pipes.find(p => p.constructor.name === 'TestomatioPipe');
990
+ if (testomatioPipe && !testomatioPipe.isEnabled) {
991
+ console.warn(APP_PREFIX, `⚠️ Tests were not uploaded to Testomat.io, skipping report`);
992
+ } else if (totalChunks > 1) {
990
993
  console.log(APP_PREFIX, `✅ Successfully uploaded ${uploadedTests} tests in ${totalChunks} chunks`);
991
994
  } else {
992
995
  console.log(APP_PREFIX, `✅ Successfully uploaded ${uploadedTests} tests`);
@@ -84,6 +84,10 @@ class CoveragePipe { // or Changes for the future???
84
84
  httpMethodsToRetry: ['GET','PUT','HEAD','OPTIONS','DELETE','POST'],
85
85
  shouldRetry: (error) => {
86
86
  if (!error.response) return false;
87
+ // a custom shouldRetry replaces the built-in check, which is the only place
88
+ // where the retry limit is enforced, so the limit must be checked here as well
89
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
90
+ if (currentRetryAttempt >= retry) return false;
87
91
  switch (error.response?.status) {
88
92
  case 400: // Bad request (probably wrong API key)
89
93
  case 404: // Test not matched
@@ -139,6 +139,10 @@ class TestomatioPipe {
139
139
  httpMethodsToRetry: ['GET', 'PUT', 'HEAD', 'OPTIONS', 'DELETE', 'POST'],
140
140
  shouldRetry: error => {
141
141
  if (!error.response) return false;
142
+ // a custom shouldRetry replaces the built-in check, which is the only place
143
+ // where the retry limit is enforced, so the limit must be checked here as well
144
+ const { currentRetryAttempt = 0, retry } = error.config.retryConfig;
145
+ if (currentRetryAttempt >= retry) return false;
142
146
  // no need to retry on 4xx errors, because they caused by user mistake, thus retrying will not help
143
147
  // 500 could also be related to both user or server mistake, but decided not to retry for now
144
148
  // this code code be changed to retry 500 too if needed
package/src/xmlReader.js CHANGED
@@ -610,7 +610,10 @@ class XmlReader {
610
610
  debug(`Uploaded ${uploadedTests}/${totalTests} tests`);
611
611
  }
612
612
 
613
- if (totalChunks > 1) {
613
+ const testomatioPipe = this.pipes.find(p => p.constructor.name === 'TestomatioPipe');
614
+ if (testomatioPipe && !testomatioPipe.isEnabled) {
615
+ log.warn(`⚠️ Tests were not uploaded to Testomat.io, skipping report`);
616
+ } else if (totalChunks > 1) {
614
617
  log.info(`✅ Successfully uploaded ${uploadedTests} tests in ${totalChunks} chunks`);
615
618
  } else {
616
619
  log.info(`✅ Successfully uploaded ${uploadedTests} tests`);