Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest coverage is broken in GitHub Actions #617

Closed
kanadgupta opened this issue Sep 20, 2022 · 2 comments · Fixed by #741
Closed

Jest coverage is broken in GitHub Actions #617

kanadgupta opened this issue Sep 20, 2022 · 2 comments · Fixed by #741
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kanadgupta
Copy link
Member

kanadgupta commented Sep 20, 2022

Been seeing this error when running tests in GitHub Actions CI for a bit now:

        Failed to write coverage reports:
        ERROR: Error: ENOENT: no such file or directory, open '/home/runner/work/rdme/rdme/coverage/coverage-final.json'
        STACK: Error: ENOENT: no such file or directory, open '/home/runner/work/rdme/rdme/coverage/coverage-final.json'
    at Object.openSync (fs.js:498:3)
    at FileWriter.writeFile (/home/runner/work/rdme/rdme/node_modules/istanbul-lib-report/lib/file-writer.js:185:41)
    at JsonReport.onStart (/home/runner/work/rdme/rdme/node_modules/istanbul-reports/lib/json/index.js:17:45)
    at Visitor.value (/home/runner/work/rdme/rdme/node_modules/istanbul-lib-report/lib/tree.js:38:38)
    at ReportTree.visit (/home/runner/work/rdme/rdme/node_modules/istanbul-lib-report/lib/tree.js:126:17)
    at JsonReport.execute (/home/runner/work/rdme/rdme/node_modules/istanbul-lib-report/lib/report-base.js:12:44)
    at /home/runner/work/rdme/rdme/node_modules/@jest/reporters/build/CoverageReporter.js:241:12
    at Array.forEach (<anonymous>)
    at CoverageReporter.onRunComplete (/home/runner/work/rdme/rdme/node_modules/@jest/reporters/build/CoverageReporter.js:229:25)
    at ReporterDispatcher.onRunComplete (/home/runner/work/rdme/rdme/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)

Not sure why, but jest coverage started breaking somewhere between this commit and this commit.

Anything weird jumping out here? 🧐 ca998bc...65a209a

See #701 #611 #610 for various attempts to address this.

@kanadgupta kanadgupta added bug Something isn't working help wanted Extra attention is needed labels Sep 20, 2022
@erunion
Copy link
Member

erunion commented Dec 5, 2022

Weird that rdme is in there twice:

/home/runner/work/rdme/rdme/coverage/coverage-final.json

Have you tried setting a coverageDirectory into the Jest config? https://jestjs.io/docs/configuration/#coveragedirectory-string

@kanadgupta
Copy link
Member Author

I messed around in #701 and I think the double /rdme/rdme thing is expected? I tried a few values for coverageDirectory and that didn't appear to work either 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants