Skip to content

Commit 7034f6a

Browse files
committed
fix(actions/parse-ci-reports): improve LCOV supported formats
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent fb50508 commit 7034f6a

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

actions/parse-ci-reports/src/parsers/LCOVParser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ export class LCOVParser extends BaseParser {
1515

1616
return (
1717
hasSupportedName &&
18-
content.includes("TN:") &&
19-
(content.includes("SF:") || content.includes("DA:"))
18+
content.includes("SF:") &&
19+
(content.includes("DA:") ||
20+
content.includes("LF:") ||
21+
content.includes("end_of_record"))
2022
);
2123
}
2224

actions/parse-ci-reports/src/parsers/LCOVParser.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ BRDA:2,0,1,0
1212
end_of_record
1313
`;
1414

15+
const SAMPLE_LCOV_WITHOUT_TEST_NAME = `SF:lib/main.dart
16+
DA:1,1
17+
DA:2,0
18+
LF:2
19+
LH:1
20+
end_of_record
21+
`;
22+
1523
describe("LCOVParser", () => {
1624
it("keeps auto-pattern path detection synchronized", () => {
1725
const parser = new LCOVParser();
@@ -25,6 +33,12 @@ describe("LCOVParser", () => {
2533
const parser = new LCOVParser();
2634

2735
assert.ok(parser.canParse("coverage/lcov.info", SAMPLE_LCOV));
36+
assert.ok(
37+
parser.canParse(
38+
"flutter/coverage/lcov.info",
39+
SAMPLE_LCOV_WITHOUT_TEST_NAME,
40+
),
41+
);
2842
assert.ok(!parser.canParse("coverage/report.txt", SAMPLE_LCOV));
2943
});
3044

0 commit comments

Comments
 (0)