onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.23k stars 650 forks source link

--junit-report is not working as expected #1152

Open bnshr opened 1 year ago

bnshr commented 1 year ago

I am running the test suite this way. ginkgo --junit-report=$JUNIT_OUTPUT -v -p ./test/validation

And JUNIT_OUTPUT="${JUNIT_OUTPUT:-/tmp/artifacts/unit_report.xml}"

When I do not set JUNIT_OUTPUT the default location should be taken. But I get the following error.

  open <fullpath-test-suite>/test/validation/tmp/artifacts/unit_report.xml: no such file or directory
  In [ReportAfterSuite] at: <fullpath-test-suite>/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go:155 @ 03/02/23 12:37:16.348
------------------------------

Summarizing 1 Failure:
  [FAIL] [ReportAfterSuite] Autogenerated ReportAfterSuite for --junit-report
  <fullpath-test-suite>/vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go:155

Can anyone tell me what is wrong here? The Ginkgo version is 2.5.1 and I tried 2.8.4 also, no luck.

onsi commented 1 year ago

the docs cover this a bit:

https://onsi.github.io/ginkgo/#generating-machine-readable-reports

though it's admittedly not super explicit.

--junit-report should be the file name --output-dir should be the path to the directory where you want the file stored