Problems running only collect coverage
See original GitHub issueHi, I’m trying to use our action just to collect my report and comment on github that information, but I can’t run successfully.
My action:
- name: Step 08 - Run Tests & Collect Coverage
run: |
echo “PATH_WAZUH-APP=$GITHUB_WORKSPACE/kibana/plugins/wazuh-kibana-app/” >> $GITHUB_ENV
cd ./kibana/plugins/wazuh-kibana-app
ls -la
echo $GITHUB_WORKSPACE/kibana/plugins/wazuh-kibana-app/
yarn run test:jest --silent --ci --testLocationInResults --colors --coverage --json --outputFile=report.json
- name: Step 09 - Comment coverage
uses: artiomtr/jest-coverage-report-action@v2.0-rc.1
with:
working-directory: ${{ env.PATH_WAZUH-APP }}
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-step: all
Error result:
Run artiomtr/jest-coverage-report-action@v2.0-rc.1
with:
github-token: ***
skip-step: all
test-script: npx jest --silent --ci --coverage --testLocationInResults --json --outputFile="report.json"
icons: emoji
annotations: all
package-manager: npm
env:
“PATH_WAZUH-APP: /home/runner/work/wazuh-kibana-app/wazuh-kibana-app/kibana/plugins/wazuh-kibana-app/”
Could not read report file located at report.json [Error: ENOENT: no such file or directory, open 'report.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'report.json'
}
/usr/bin/git fetch --all --depth=1
fatal: not a git repository (or any of the parent directories): .git
Error fetching git repository Error: The process '/usr/bin/git' failed with exit code 128
at f._setResult (/home/runner/work/_actions/artiomtr/jest-coverage-report-action/v2.0-rc.1/dist/index.js:2:11470)
at f.CheckComplete (/home/runner/work/_actions/artiomtr/jest-coverage-report-action/v2.0-rc.1/dist/index.js:2:10900)
at ChildProcess.<anonymous> (/home/runner/work/_actions/artiomtr/jest-coverage-report-action/v2.0-rc.1/dist/index.js:2:9944)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:210:5)
at Pipe.<anonymous> (net.js:659:12)
/usr/bin/git checkout -f 4.3-7.10
fatal: not a git repository (or any of the parent directories): .git
Error: The process '/usr/bin/git' failed with exit code 128
Here my action.yml
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Jest finds tests but doesn't collect coverage - Stack Overflow
I found that when upgrading jest (from 23 to 26) that i had this issue, and the resolution was to run with the...
Read more >Troubleshooting Code Coverage - Visual Studio (Windows)
Learn how to resolve erroneous empty results messages when you expect Visual Studio to collect data for native and managed assemblies.
Read more >Test coverage visualization - GitLab Docs
With the help of GitLab CI/CD, you can collect the test coverage information of your favorite testing or coverage-analysis tool, and visualize this ......
Read more >Compiling for Coverage — gcovr 5.1 documentation
In order to collect coverage data, your software must be “instrumented” by the compiler. That means, you must re-compile your software with special...
Read more >Jest CLI Options
Run only the tests that were specified with a pattern or filename: ... Indicates that test coverage information should be collected and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gabiwassan,
I think that the problem is that you’re changing directory in previous step, to collect coverage. You can try to simply remove
working-directory
option from youraction.yml
file, or just to exit working directory in previous step. So possible configurations could be:Also, if these configurations not solved your issue, try to remove step 8 and let this action collect coverage for you:
If these solutions do not help you, then wait until #118 is merged into the master.
Hello @gabiwassan! 👋
Sorry for the late reply. As far as I can see, in your configuration the
working-directory
has correct value, but it is not being passed to the action. I’m not sure, but it seems to me that the issue is with the name of the variable: try to rename it so that no hyphen is used (for examplePATH_WAZUH_APP
). If that doesn’t work, try running an action with a configuration like this:Hope my answer will help you!