testit-js-commons 4.0.1 → 4.0.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.
|
@@ -46,7 +46,6 @@ exports.AutotestsService = void 0;
|
|
|
46
46
|
// @ts-ignore
|
|
47
47
|
const TestitApiClient = __importStar(require("testit-api-client"));
|
|
48
48
|
const common_1 = require("../../common");
|
|
49
|
-
const autotests_type_1 = require("./autotests.type");
|
|
50
49
|
const autotests_converter_1 = require("./autotests.converter");
|
|
51
50
|
const autotests_handler_1 = require("./autotests.handler");
|
|
52
51
|
class AutotestsService extends common_1.BaseService {
|
|
@@ -80,6 +79,7 @@ class AutotestsService extends common_1.BaseService {
|
|
|
80
79
|
.catch((err) => (0, autotests_handler_1.handleHttpError)(err, `Failed update autotest "${autotestPost.name}"`));
|
|
81
80
|
});
|
|
82
81
|
}
|
|
82
|
+
// sometimes status is lowercase
|
|
83
83
|
loadAutotest(autotest, status) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
var _a, _b;
|
|
@@ -89,14 +89,16 @@ class AutotestsService extends common_1.BaseService {
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
const mergedAutotest = Object.assign(Object.assign({}, autotest), { namespace: (_a = autotest.namespace) !== null && _a !== void 0 ? _a : originAutotest.namespace, classname: (_b = autotest.classname) !== null && _b !== void 0 ? _b : originAutotest.classname });
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
// fix the issue with lowercase status
|
|
93
|
+
const currentStatus = status.toLowerCase();
|
|
94
|
+
switch (currentStatus) {
|
|
95
|
+
case "passed":
|
|
94
96
|
yield this.updateAutotest(mergedAutotest);
|
|
95
97
|
return;
|
|
96
|
-
case
|
|
98
|
+
case "failed":
|
|
97
99
|
yield this.updateAutotestFromFailed(originAutotest, mergedAutotest);
|
|
98
100
|
return;
|
|
99
|
-
case
|
|
101
|
+
case "skipped":
|
|
100
102
|
if (originAutotest.name != undefined && originAutotest.externalId != undefined) {
|
|
101
103
|
yield this.updateAutotestFromFailed(originAutotest, mergedAutotest);
|
|
102
104
|
return;
|
|
@@ -349,7 +349,7 @@ class SyncStorageRunner {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
exports.SyncStorageRunner = SyncStorageRunner;
|
|
352
|
-
SyncStorageRunner.VERSION = "v0.
|
|
352
|
+
SyncStorageRunner.VERSION = "v0.3.0";
|
|
353
353
|
SyncStorageRunner.STARTUP_TIMEOUT_MS = 30000;
|
|
354
354
|
SyncStorageRunner.STARTUP_POLL_MS = 1000;
|
|
355
355
|
SyncStorageRunner.PROCESS_WARMUP_MS = 2000;
|
|
@@ -183,7 +183,7 @@ class TestRunsService extends common_1.BaseService {
|
|
|
183
183
|
sendAutotestResultWithRetry(testRunId, autotestResult) {
|
|
184
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
185
|
var _a, _b, _c;
|
|
186
|
-
const maxAttempts =
|
|
186
|
+
const maxAttempts = 5;
|
|
187
187
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
188
188
|
try {
|
|
189
189
|
yield this._client.setAutoTestResultsForTestRun(testRunId, { autoTestResultsForTestRunModel: [autotestResult] });
|
|
@@ -203,7 +203,7 @@ class TestRunsService extends common_1.BaseService {
|
|
|
203
203
|
if (!transient || attempt === maxAttempts) {
|
|
204
204
|
throw err;
|
|
205
205
|
}
|
|
206
|
-
yield new Promise((resolve) => setTimeout(resolve,
|
|
206
|
+
yield new Promise((resolve) => setTimeout(resolve, 1000));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
});
|