Skip to content

added entry for running unit tests with junit report#39638

Merged
vdemeester merged 1 commit intomoby:masterfrom
tiborvass:unit-junit
Aug 2, 2019
Merged

added entry for running unit tests with junit report#39638
vdemeester merged 1 commit intomoby:masterfrom
tiborvass:unit-junit

Conversation

@tiborvass
Copy link
Contributor

Signed-off-by: Andrew Hsu [email protected]
(cherry picked from commit 30d1bf8)
Signed-off-by: Tibor Vass [email protected]

#39637

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there advantages to using this instead of gotestsum? docker/cli#1639

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll have a look. i started with go-junit-report because that's what i've used in the past and was easiest to setup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i decided to use gotestsum after getting to know it because it's better

@andrewhsu andrewhsu force-pushed the unit-junit branch 2 times, most recently from 849a6f6 to 927ea39 Compare July 31, 2019 01:39
@andrewhsu
Copy link
Contributor

@thaJeztah
Copy link
Member

ping @vdemeester ptal

@thaJeztah
Copy link
Member

interesting failure on janky

16:40:05 === FAIL: pkg/pubsub TestSendToOneSub (0.00s)
16:40:05     publisher_test.go:17: expected message hi but received hi

@andrewhsu
Copy link
Contributor

@andrewhsu
Copy link
Contributor

I think this is ready for merge. This PR adds another parallel PR check stage in the Jenkinsfile for just running the unit tests via hack/test/unit on x86_64. The result of the stage will produce 3 artifacts in a unit-bundles.tar.gz file that will be stored with the job run, e.g. https://ci.docker.com/public/blue/organizations/jenkins/moby/detail/PR-39638/10/artifacts

The contents of the bundle are:

  • go-test-report.json - the go test -json output
  • junit-report.xml - the junit format of the test result for consumption by jenkins
  • profile.out - the coverage report of the unit test runs

The Jenkinsfile has been updated in this PR to consume the junit-report.xml for making graphs and tables of the result like so: https://ci.docker.com/public/job/moby/job/PR-39638/10/testReport/github/

The graphs and tables will help developers quickly locate the info of the failing unit tests instead of searching for the error on the verbose console output page of the jenkins job.

To accomplish this, I had to add gotestsum to the Dockerfile image because it can run the unit tests and generate the junit-report.xml.

@tiborvass tiborvass marked this pull request as ready for review August 1, 2019 22:38
@tiborvass tiborvass requested a review from tianon as a code owner August 1, 2019 22:38
@tiborvass
Copy link
Contributor Author

gotestsum works great with go test, but will break for gocheck used by integration-cli. We can discuss that separately.

@tiborvass
Copy link
Contributor Author

PTAL @thaJeztah @vdemeester

Copy link
Contributor

@andrewhsu andrewhsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🤳🏼

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@zelahi
Copy link
Contributor

zelahi commented Aug 2, 2019

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants