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 flag to prune PASSED subtests in junit xml and have top level tests #117029

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

Rajalakshmi-Girish
Copy link
Contributor

The CI which runs k8s unit tests has a huge no.of rows while it uses https://github.com/kubernetes/kubernetes/blob/master/hack/make-rules/test.sh and generates junit xml file in artifacts.

This large no. of rows hinders the display of complete data in test grids

Ref: kubernetes/test-infra#24779
kubernetes/test-infra#23425

As the purpose of the test grid in certain cases would be to analyze the failing/flaking tests, it shall be useful to have an option in prune-junit-xml to prune PASSED test cases and display only failed test cases.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 31, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.27 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.27.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Fri Mar 31 04:32:14 UTC 2023.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 31, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Mar 31, 2023
@Rajalakshmi-Girish
Copy link
Contributor Author

/kind bug
/sig testing

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 31, 2023
@liggitt liggitt added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Mar 31, 2023
@liggitt
Copy link
Member

liggitt commented Mar 31, 2023

is the expectation that all/most testgrids would use this option by default? losing info about green runs will make it hard to tell the difference between a test running and being skipped, as well as losing run-time information testgrid surfaces as graphs of times

@BenTheElder
Copy link
Member

Can we collapse to e.g. package level results instead?

@liggitt
Copy link
Member

liggitt commented Mar 31, 2023

Can we collapse to e.g. package level results instead?

or even package+top-level test ... a lot of the unit/integration test bulk comes from tests with ~hundreds of programmatically generated subtests

@Rajalakshmi-Girish Rajalakshmi-Girish force-pushed the prune-junit-xml branch 3 times, most recently from d1d8343 to 67635bd Compare March 31, 2023 08:51
@Rajalakshmi-Girish
Copy link
Contributor Author

Can we collapse to e.g. package level results instead?

or even package+top-level test ... a lot of the unit/integration test bulk comes from tests with ~hundreds of programmatically generated subtests

I have changed the logic to display the package + top-level tests. The subtests would be shown only in cases when there is a failure.

This has drastically brought down the no.of rows from ~39k to ~9k. Also, many stale rows that are generated by Tests like apiserver/pkg/cel.TestEscaping would be got rid of in testgrid.

Without Pruning https://prow.ppc64le-cloud.org/view/gs/ppc64le-kubernetes/logs/periodic-kubernetes-unit-test-ppc64le/1641471234464026624
With -prune-passed-subtests=true https://prow.ppc64le-cloud.org/view/gs/ppc64le-kubernetes/logs/periodic-kubernetes-unit-test-ppc64le/1641199440779808768

@BenTheElder @liggitt Can you PTAL now?

@Rajalakshmi-Girish Rajalakshmi-Girish changed the title Add flag to prune PASSED tests in junit xml and have only failed testcases Add flag to prune PASSED subtests in junit xml and have top level tests Mar 31, 2023
@dims
Copy link
Member

dims commented Mar 31, 2023

/release-note-none

cc @aojea @pohly

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 31, 2023
Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me.

However, should this PR also enable the new feature? Right now it doesn't, because default is false and the command line flag is not getting added to the test scripts which invoke prune-junit.

I think this PR should enable pruning. The simplest way to do that would be to change the flag default. Only Kubernetes uses it, so we don't need to worry about breaking someone other than ourselves.

Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

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

/lgtm
+1 to flip the default for prune-tests to true though

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

LGTM label has been added.

Git tree hash: 0277c75cade10fc65fbf1fcd64cbe94ea5b6b9ff

@BenTheElder
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 26, 2023
@k8s-ci-robot k8s-ci-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 6, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jun 6, 2023
@Rajalakshmi-Girish
Copy link
Contributor Author

Messed up while rebasing and resolving conflicts :(
Please see #118487

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jun 7, 2023
@Rajalakshmi-Girish
Copy link
Contributor Author

@pohly ^^

Copy link
Contributor

@pohly pohly 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.io/kubernetes/third_party/forked/gotestsum/junitxml"
)

func main() {
maxTextSize := flag.Int("max-text-size", 1, "maximum size of attribute or text (in MB)")
pruneTests := flag.Bool("prune-tests", true,
Copy link
Contributor

Choose a reason for hiding this comment

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

It's on by default now, as suggested in #117029 (review)

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

LGTM label has been added.

Git tree hash: 7f3495dc1567f3a2b24b133d1a3dec8ba2dc106c

@pohly
Copy link
Contributor

pohly commented Jun 7, 2023

Looks like we need one more approval.

/assign @dims

@dims
Copy link
Member

dims commented Jun 7, 2023

/approve

thanks @Rajalakshmi-Girish

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, dims, pohly, Rajalakshmi-Girish

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2023
@k8s-ci-robot k8s-ci-robot merged commit 7ef5ec4 into kubernetes:master Jun 7, 2023
12 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Jun 7, 2023
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants