test-reporter
test-reporter copied to clipboard
No file matches path, but path is not what was specified
See the output from this run:
Compare line 4 to line 30 and see that the path is different. Is this a bug, or am I doing something wrong?
The step YAML looks like this:
# Check to see if the test results file exists so that we can condition the publishing of the test results:
- name: Check whether or not the test results file exists
id: test-results-verification
if: always() # Even if previous steps have failed
run: |
if test -f "${{ runner.temp }}/junit.xml"; then
echo "::set-output name=file-exists::true"
fi
# Publish the test results using an action from the marketplace:
- name: Generate test report
uses: dorny/test-reporter@v1
if: ${{ steps.test-results-verification.outputs.file-exists == 'true' && (success() || failure()) }} # Even if some tests failed
with:
name: Test results
path: "${{ runner.temp }}/junit.xml"
reporter: java-junit
(Note the second step is conditioned on the first step finding the file, and the second step is executing, so we know that the file is on disk where specified).
I ran into a very similar problem.
You might want to check the answer provided here:
You need to specify path as wildcard https://github.com/dorny/test-reporter/issues/175#issuecomment-1153262496
Specifying the file using the wildcard pattern in the most basic way solved it. I ended up changing the explicit file path to "**/TestResults.xml".
I'm not sure whether this will work four you, but maybe you get some inspiration on how to solve it.