@testomatio/reporter 1.0.5 → 1.0.6
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/pipe/testomatio.js +24 -0
- package/package.json +1 -1
package/lib/pipe/testomatio.js
CHANGED
|
@@ -53,8 +53,27 @@ class TestomatioPipe {
|
|
|
53
53
|
async createRun() {
|
|
54
54
|
if (!this.isEnabled) return;
|
|
55
55
|
|
|
56
|
+
let buildUrl = process.env.BUILD_URL || process.env.CI_JOB_URL || process.env.CIRCLE_BUILD_URL;
|
|
57
|
+
|
|
58
|
+
// GitHub Actions Url
|
|
59
|
+
if (!buildUrl && process.env.GITHUB_RUN_ID) {
|
|
60
|
+
// eslint-disable-next-line max-len
|
|
61
|
+
buildUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Azure DevOps Url
|
|
65
|
+
if (!buildUrl && process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) {
|
|
66
|
+
const collectionUri = process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI;
|
|
67
|
+
const project = process.env.SYSTEM_TEAMPROJECT;
|
|
68
|
+
const buildId = process.env.BUILD_BUILDID;
|
|
69
|
+
buildUrl = `${collectionUri}/${project}/_build/results?buildId=${buildId}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!buildUrl.startsWith('http')) buildUrl = undefined;
|
|
73
|
+
|
|
56
74
|
const runParams = Object.fromEntries(
|
|
57
75
|
Object.entries({
|
|
76
|
+
ci_build_url: buildUrl,
|
|
58
77
|
parallel: this.parallel,
|
|
59
78
|
api_key: this.apiKey.trim(),
|
|
60
79
|
group_title: this.groupTitle,
|
|
@@ -124,6 +143,7 @@ class TestomatioPipe {
|
|
|
124
143
|
}
|
|
125
144
|
return;
|
|
126
145
|
}
|
|
146
|
+
// eslint-disable-next-line max-len
|
|
127
147
|
console.log(APP_PREFIX, chalk.blue(data?.title || ''), `Report couldn't be processed: ${err.response.data.message}`);
|
|
128
148
|
} else {
|
|
129
149
|
console.log(APP_PREFIX, chalk.blue(data?.title || ''), "Report couldn't be processed", err);
|
|
@@ -165,13 +185,17 @@ class TestomatioPipe {
|
|
|
165
185
|
}
|
|
166
186
|
if (this.hasUnmatchedTests) {
|
|
167
187
|
console.log('');
|
|
188
|
+
// eslint-disable-next-line max-len
|
|
168
189
|
console.log(APP_PREFIX, chalk.yellow.bold('⚠️ Some reported tests were not found in Testomat.io project'));
|
|
190
|
+
// eslint-disable-next-line max-len
|
|
169
191
|
console.log(APP_PREFIX, `If you use Testomat.io as a reporter only, please re-run tests using ${chalk.bold('TESTOMATIO_CREATE=1')}`);
|
|
192
|
+
// eslint-disable-next-line max-len
|
|
170
193
|
console.log(APP_PREFIX, `But to keep your tests consistent it is recommended to ${chalk.bold('import tests first')}`);
|
|
171
194
|
console.log(APP_PREFIX, 'If tests were imported but still not matched, assign test IDs to your tests.');
|
|
172
195
|
console.log(APP_PREFIX, 'You can do that automatically via command line tools:');
|
|
173
196
|
console.log(APP_PREFIX, chalk.bold('npx check-tests ... --update-ids'), 'See: https://bit.ly/js-update-ids');
|
|
174
197
|
console.log(APP_PREFIX, 'or for Cucumber:');
|
|
198
|
+
// eslint-disable-next-line max-len
|
|
175
199
|
console.log(APP_PREFIX, chalk.bold('npx check-cucumber ... --update-ids'), 'See: https://bit.ly/bdd-update-ids');
|
|
176
200
|
}
|
|
177
201
|
} catch (err) {
|