Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classname attr to the JUnit test case and add a flag to allow skipping test junit report #105

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

chizhg
Copy link
Contributor

@chizhg chizhg commented Mar 8, 2021

  1. Add classname attribute to the JUnit test case to show on Spyglass, this will fix testsuite name does not show up in spyglass JUnit lens #107
  2. For some tester implementations, they will be generating their own Junit results, in which cases the extra Test JUnit result will be redundant. So add an extra flag --skip-test-junit-report to allow skipping reporting the JUnit test result. This will partially fix The error message in the JUnit xml result is not informative #58.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 8, 2021
@k8s-ci-robot k8s-ci-robot requested review from amwat and MushuEE March 8, 2021 06:47
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 8, 2021
@chizhg chizhg force-pushed the kubetest2-junit branch from e57aa3e to d3e848e Compare March 8, 2021 07:08
Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

I wouldn't want to mess with the name too much as it invalidates a lot of testgrid history.

ref: kubernetes/test-infra#21180 (comment)

I think filtering out the kubetest2 specific entries can be done by whatever is post processing it by many other means? (sorting and relying on capitalized alphabetical order is not the most ideal)

@chizhg chizhg force-pushed the kubetest2-junit branch from d3e848e to 3486f39 Compare March 8, 2021 21:43
@chizhg chizhg changed the title Change testsuite name to uppercase and add a flag to allow skipping test junit report Add a flag to allow skipping test junit report Mar 8, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 8, 2021
@chizhg
Copy link
Contributor Author

chizhg commented Mar 8, 2021

I wouldn't want to mess with the name too much as it invalidates a lot of testgrid history.

ref: kubernetes/test-infra#21180 (comment)

I think filtering out the kubetest2 specific entries can be done by whatever is post processing it by many other means? (sorting and relying on capitalized alphabetical order is not the most ideal)

That makes total sense. I've reverted the change in my PR and updated the commit message accordingly.

@chizhg chizhg force-pushed the kubetest2-junit branch from 3486f39 to c2db713 Compare March 8, 2021 22:50
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 8, 2021
@chizhg chizhg force-pushed the kubetest2-junit branch from c2db713 to 54ac74b Compare March 8, 2021 22:52
@chizhg chizhg changed the title Add a flag to allow skipping test junit report Add classname attr to the JUnit test case and add a flag to allow skipping test junit report Mar 8, 2021
pkg/app/cmd.go Outdated
@@ -199,6 +200,7 @@ func (o *options) bindFlags(flags *pflag.FlagSet) {
flags.BoolVar(&o.up, "up", false, "provision the test cluster")
flags.BoolVar(&o.down, "down", false, "tear down the test cluster")
flags.StringVar(&o.test, "test", "", "test type to run, if unset no tests will run")
flags.BoolVar(&o.skipTestJUnitReport, "skip-test-junit-report", false, "skip reporting the test result as a JUnit test case")
Copy link
Member

Choose a reason for hiding this comment

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

Is "test" a necessary distinction here?

Vs "skip-junit-report", "skip reporting kubetest2 steps to junit.xml", etc

Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC the intention is to only skip adding the junit entry for the kubetest2.Test() step. build, up, down will still show.
It's not too ideal but since we have explicit tester binaries I can see use cases where it should be treated specially.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @amwat . Yes, that is the intention for this change.

Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

/approve

pkg/app/cmd.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@chizhg chizhg force-pushed the kubetest2-junit branch from 54ac74b to 21dae53 Compare March 9, 2021 00:48
@chizhg chizhg force-pushed the kubetest2-junit branch from 21dae53 to e662cdd Compare March 9, 2021 01:04
Copy link
Member

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amwat, chizhg, spiffxp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 4459c89 into kubernetes-sigs:master Mar 9, 2021
@chizhg chizhg deleted the kubetest2-junit branch March 9, 2021 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
4 participants