Skip to content

Commit 48546e8

Browse files
authored
Update codecov.yml
1 parent b112525 commit 48546e8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/codecov.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
uses: actions/upload-artifact@v4
2525
with:
2626
name: test-report
27-
path: test_results.txt
27+
path: |
28+
test_results.txt
29+
cobratoolbox/CodeCovTestResults.xml
2830
2931
# Parse Test Results and Comment on PR using regex
3032
- name: Parse Test Results and Comment on PR
@@ -34,7 +36,7 @@ jobs:
3436
with:
3537
script: |
3638
const fs = require('fs');
37-
const xml = fs.readFileSync('CodeCovTestResults.xml', 'utf8');
39+
const xml = fs.readFileSync('cobratoolbox/CodeCovTestResults.xml', 'utf8');
3840
3941
// Extract data using regex
4042
const passedRegex = /tests="(\d+)" failures="(\d+)" errors="(\d+)" skipped="(\d+)"/;
@@ -47,11 +49,11 @@ jobs:
4749
let summary = `Test Results: Passed: ${totalTests - failures - skipped}, Failed: ${failures}, Errors: ${errors}, Skipped: ${skipped}`;
4850
4951
// Find failed tests
50-
const failedTestsRegex = /<testcase classname="[^"]*" name="([^"]+)"[^>]*>\s*<error[^>]*>([^<]*)<\/error>/g;
52+
const failedTestsRegex = /<testcase classname="[^"]*" name="([^"]+)"[^>]*>\s*<(error|failure)[^>]*>([^<]*)<\/(error|failure)>/g;
5153
let failedTestDetails = '';
5254
let match;
5355
while ((match = failedTestsRegex.exec(xml)) !== null) {
54-
failedTestDetails += `\n* ${match[1]}: ${match[2]}`;
56+
failedTestDetails += `\n* ${match[1]}: ${match[3]}`;
5557
}
5658
5759
if (failedTestDetails.length > 0) {

0 commit comments

Comments
 (0)