@flakiness/cucumberjs 1.2.0 → 1.4.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.
- package/README.md +1 -1
- package/lib/formatter.js +18 -21
- package/package.json +4 -4
- package/types/src/formatter.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ formatOptions: {
|
|
|
147
147
|
|
|
148
148
|
Optional human-readable report title. Typically used to name a CI run, matrix shard, or other execution group.
|
|
149
149
|
|
|
150
|
-
Defaults to the `FLAKINESS_TITLE` environment variable, or
|
|
150
|
+
Defaults to the `FLAKINESS_TITLE` environment variable, or empty otherwise.
|
|
151
151
|
|
|
152
152
|
```javascript
|
|
153
153
|
formatOptions: {
|
package/lib/formatter.js
CHANGED
|
@@ -85,7 +85,6 @@ class FlakinessCucumberFormatter extends Formatter {
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
const { attachments, suites } = await this._collectSuites(worktree);
|
|
88
|
-
const title = this._config.title ?? process.env.FLAKINESS_TITLE ?? CIUtils.runTitle();
|
|
89
88
|
const report = ReportUtils.normalizeReport({
|
|
90
89
|
category: "cucumberjs",
|
|
91
90
|
commitId,
|
|
@@ -96,7 +95,7 @@ class FlakinessCucumberFormatter extends Formatter {
|
|
|
96
95
|
})
|
|
97
96
|
],
|
|
98
97
|
flakinessProject: this._config.flakinessProject,
|
|
99
|
-
title,
|
|
98
|
+
title: this._config.title ?? process.env.FLAKINESS_TITLE,
|
|
100
99
|
suites,
|
|
101
100
|
startTimestamp: this._startTimestamp,
|
|
102
101
|
url: CIUtils.runUrl()
|
|
@@ -176,14 +175,14 @@ To open last Flakiness report, run:
|
|
|
176
175
|
parallelIndex,
|
|
177
176
|
annotations: extractAttemptAnnotations(worktree, this.cwd, featureUri, attemptData.gherkinDocument, attemptData.pickle),
|
|
178
177
|
errors: errors.length ? errors : void 0,
|
|
179
|
-
attachments: await extractAttachmentsFromTestSteps(parsedAttempt.testSteps, attachments),
|
|
180
178
|
stdio: stdio.length ? stdio : void 0,
|
|
181
|
-
steps: parsedAttempt.testSteps.map((step) => ({
|
|
179
|
+
steps: await Promise.all(parsedAttempt.testSteps.map(async (step) => ({
|
|
180
|
+
attachments: await extractAttachmentsFromTestStep(step, attachments),
|
|
182
181
|
title: toFKStepTitle(step),
|
|
183
182
|
duration: toDurationMS(step.result.duration),
|
|
184
183
|
error: extractErrorFromStep(worktree, this.cwd, step),
|
|
185
184
|
location: step.sourceLocation ? createLineAndUriLocation(worktree, this.cwd, step.sourceLocation) : step.actionLocation ? createLineAndUriLocation(worktree, this.cwd, step.actionLocation) : void 0
|
|
186
|
-
}))
|
|
185
|
+
})))
|
|
187
186
|
});
|
|
188
187
|
}
|
|
189
188
|
return {
|
|
@@ -409,23 +408,21 @@ function extractSTDIOFromTestSteps(steps, startTimestamp) {
|
|
|
409
408
|
}
|
|
410
409
|
return stdio;
|
|
411
410
|
}
|
|
412
|
-
async function
|
|
411
|
+
async function extractAttachmentsFromTestStep(step, attachments) {
|
|
413
412
|
const fkAttachments = [];
|
|
414
|
-
for (const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
});
|
|
428
|
-
}
|
|
413
|
+
for (const attachment of step.attachments) {
|
|
414
|
+
if (attachment.mediaType === CUCUMBER_LOG_MEDIA_TYPE)
|
|
415
|
+
continue;
|
|
416
|
+
const dataAttachment = await ReportUtils.createDataAttachment(
|
|
417
|
+
attachment.mediaType,
|
|
418
|
+
decodeAttachmentBody(attachment)
|
|
419
|
+
);
|
|
420
|
+
attachments.set(dataAttachment.id, dataAttachment);
|
|
421
|
+
fkAttachments.push({
|
|
422
|
+
id: dataAttachment.id,
|
|
423
|
+
name: attachment.fileName ?? `attachment-${fkAttachments.length + 1}`,
|
|
424
|
+
contentType: attachment.mediaType
|
|
425
|
+
});
|
|
429
426
|
}
|
|
430
427
|
return fkAttachments;
|
|
431
428
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flakiness/cucumberjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/flakiness/cucumberjs.git"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@flakiness/flakiness-report": "^0.
|
|
24
|
-
"@flakiness/sdk": "^2.
|
|
23
|
+
"@flakiness/flakiness-report": "^0.31.0",
|
|
24
|
+
"@flakiness/sdk": "^2.7.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@cucumber/cucumber": "^12.7.0",
|
|
28
28
|
"@cucumber/messages": "^32.2.0",
|
|
29
|
-
"@flakiness/cucumberjs": "1.
|
|
29
|
+
"@flakiness/cucumberjs": "1.3.0",
|
|
30
30
|
"@types/node": "^25.5.0",
|
|
31
31
|
"c8": "^11.0.0",
|
|
32
32
|
"esbuild": "^0.27.4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAoB,MAAM,oBAAoB,CAAC;AAwDjE,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,SAAS;IAC/D,MAAM,CAAC,aAAa,SAAwD;IAE5E,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAA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