CircleCI-Public / go-orb

https://circleci.com/orbs/registry/orb/circleci/go
MIT License
9 stars 35 forks source link

feat: Allow `test` job to support JUnit test output #63

Open adamdmharvey opened 1 year ago

adamdmharvey commented 1 year ago

We use the Go orb to simplify some of our Golang repo mechanics, but we don't use the test job because it doesn't let us specify JUnit output.

We like getting the JUnit output because it intentionally uses the features of CircleCI to better elevate our test results, and gives us data in Test Insights.

image

For example, rather than using the orb out of the box right now,

- go/test:
    covermode: atomic
    failfast: true
    race: true

which provides no test output. Instead, we use a regular command and run:

- run:
    command: gotestsum --junitfile test-results/unit-tests.xml -- -covermode=atomic -coverprofile=test-results/coverage.out

And then using:

 - store_test_results:
           path: test-results

Would be great if there was a flag to pass into the test job to sort of do this "automatically" within the test job.