engine-dependency 1.0.3 → 1.0.4
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.
|
@@ -26,7 +26,7 @@ class TestInformationService extends services_base_service.default {
|
|
|
26
26
|
|
|
27
27
|
buildTestPayload(testInfo) {
|
|
28
28
|
return {
|
|
29
|
-
testTitle: testInfo.
|
|
29
|
+
testTitle: testInfo.title,
|
|
30
30
|
testStatus: testInfo.status || testInfo.state,
|
|
31
31
|
duration: testInfo.duration,
|
|
32
32
|
testFile: testInfo.file,
|
|
@@ -52,6 +52,26 @@ class TestInformationService extends services_base_service.default {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
buildLocalPayload(testInfo) {
|
|
56
|
+
return {
|
|
57
|
+
testTitle: testInfo.title,
|
|
58
|
+
testStatus: testInfo.status || testInfo.state,
|
|
59
|
+
duration: testInfo.duration,
|
|
60
|
+
testFile: testInfo.file,
|
|
61
|
+
testProject: process.env.PROJECT_NAME,
|
|
62
|
+
retries: testInfo.retries || testInfo.retries?.length || 0,
|
|
63
|
+
retry: testInfo.retry ?? 0,
|
|
64
|
+
tags: testInfo.tags || [],
|
|
65
|
+
environment: process.env.ENV,
|
|
66
|
+
testInfo: testInfo,
|
|
67
|
+
pipelineId: null,
|
|
68
|
+
commitSha: null,
|
|
69
|
+
branch: null,
|
|
70
|
+
runUrl: null,
|
|
71
|
+
provider: null
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
async sendTestResult(testInfo) {
|
|
56
76
|
if (!process.env.CI) return;
|
|
57
77
|
|
|
@@ -75,6 +95,21 @@ class TestInformationService extends services_base_service.default {
|
|
|
75
95
|
console.log(`Error enviando resultado de test: ${error?.message || error}`);
|
|
76
96
|
}
|
|
77
97
|
}
|
|
98
|
+
|
|
99
|
+
async sendLocalTestResult(testInfo) {
|
|
100
|
+
try {
|
|
101
|
+
const payload = this.buildLocalPayload(testInfo);
|
|
102
|
+
const response = await this.sendPOSTRequest(
|
|
103
|
+
`${this.baseUrl}${this.testResultsEndpoint}`,
|
|
104
|
+
payload
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
console.log(`Resultado de test enviado: ${testInfo.title} - ${testInfo.status}`);
|
|
108
|
+
return response?.data;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.log(`Error enviando resultado de test: ${error?.message || error}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
78
113
|
}
|
|
79
114
|
|
|
80
115
|
exports.TestInformationService = TestInformationService;
|
|
@@ -24,7 +24,7 @@ class TestInformationService extends BaseService {
|
|
|
24
24
|
|
|
25
25
|
buildTestPayload(testInfo) {
|
|
26
26
|
return {
|
|
27
|
-
testTitle: testInfo.
|
|
27
|
+
testTitle: testInfo.title,
|
|
28
28
|
testStatus: testInfo.status || testInfo.state,
|
|
29
29
|
duration: testInfo.duration,
|
|
30
30
|
testFile: testInfo.file,
|
|
@@ -50,6 +50,26 @@ class TestInformationService extends BaseService {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
buildLocalPayload(testInfo) {
|
|
54
|
+
return {
|
|
55
|
+
testTitle: testInfo.title,
|
|
56
|
+
testStatus: testInfo.status || testInfo.state,
|
|
57
|
+
duration: testInfo.duration,
|
|
58
|
+
testFile: testInfo.file,
|
|
59
|
+
testProject: process.env.PROJECT_NAME,
|
|
60
|
+
retries: testInfo.retries || testInfo.retries?.length || 0,
|
|
61
|
+
retry: testInfo.retry ?? 0,
|
|
62
|
+
tags: testInfo.tags || [],
|
|
63
|
+
environment: process.env.ENV,
|
|
64
|
+
testInfo: testInfo,
|
|
65
|
+
pipelineId: null,
|
|
66
|
+
commitSha: null,
|
|
67
|
+
branch: null,
|
|
68
|
+
runUrl: null,
|
|
69
|
+
provider: null
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
53
73
|
async sendTestResult(testInfo) {
|
|
54
74
|
if (!process.env.CI) return;
|
|
55
75
|
|
|
@@ -73,6 +93,21 @@ class TestInformationService extends BaseService {
|
|
|
73
93
|
console.log(`Error enviando resultado de test: ${error?.message || error}`);
|
|
74
94
|
}
|
|
75
95
|
}
|
|
96
|
+
|
|
97
|
+
async sendLocalTestResult(testInfo) {
|
|
98
|
+
try {
|
|
99
|
+
const payload = this.buildLocalPayload(testInfo);
|
|
100
|
+
const response = await this.sendPOSTRequest(
|
|
101
|
+
`${this.baseUrl}${this.testResultsEndpoint}`,
|
|
102
|
+
payload
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
console.log(`Resultado de test enviado: ${testInfo.title} - ${testInfo.status}`);
|
|
106
|
+
return response?.data;
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.log(`Error enviando resultado de test: ${error?.message || error}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
76
111
|
}
|
|
77
112
|
|
|
78
113
|
export { TestInformationService };
|