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

Support JUnit XML test report #340

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Support JUnit XML test report #340

merged 1 commit into from
Sep 20, 2021

Conversation

Amulyam24
Copy link
Contributor

What this PR does / why we need it:
This PR provides the ability to generate JUnit XML test reports and populate the prow dashboard accordingly for the unit tests.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #328

Specify your PR reviewers:

/cc @gyliu513 @jichenjc @xunpan @mkumatag

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 17, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @Amulyam24. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 17, 2021
@Amulyam24
Copy link
Contributor Author

cc @Rajalakshmi-Girish

@mkumatag
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 17, 2021
@mkumatag
Copy link
Member

@Amulyam24: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-ibmcloud-test ee1889e link /test pull-cluster-api-provider-ibmcloud-test
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

seems like this failure is happening here as well @Amulyam24 @Rajalakshmi-Girish

@mkumatag
Copy link
Member

/retest

@Rajalakshmi-Girish
Copy link
Contributor

@Amulyam24: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
Test name Commit Details Rerun command
pull-cluster-api-provider-ibmcloud-test ee1889e link /test pull-cluster-api-provider-ibmcloud-test
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

seems like this failure is happening here as well @Amulyam24 @Rajalakshmi-Girish

@Amulyam24 This failure seems to occur when make lint takes more than 1minute to execute.
You may try including --timeout option at https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/Makefile#L116

@Rajalakshmi-Girish
Copy link
Contributor

The default value is 1m as mentioned here https://golangci-lint.run/usage/configuration/#command-line-options

@Amulyam24
Copy link
Contributor Author

Amulyam24 commented Sep 17, 2021

After the initial test failure with timeout, the retests fail with /bin/sh: 1: go-junit-report: not found
I'll also make the changes to add a higher timeout to avoid the issue.

@Amulyam24
Copy link
Contributor Author

@Amulyam24: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
Test name Commit Details Rerun command
pull-cluster-api-provider-ibmcloud-test ee1889e link /test pull-cluster-api-provider-ibmcloud-test
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

seems like this failure is happening here as well @Amulyam24 @Rajalakshmi-Girish

@Amulyam24 This failure seems to occur when make lint takes more than 1minute to execute.
You may try including --timeout option at https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/blob/main/Makefile#L116

Thanks @Rajalakshmi-Girish , will update it.

@mkumatag
Copy link
Member

After the initial test failure with timeout, the retests fails with /bin/sh: 1: go-junit-report: not found
I'll make the changes to add a higher timeout as well to avoid the issue.

this may be because you just vendored but not really installed it. just see if you can install it like here

@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 Sep 17, 2021
@Amulyam24
Copy link
Contributor Author

@mkumatag, made the required changes, PTAL.

Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

looking at the test results, it just shows only one entry, not sure why?!

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@mkumatag
Copy link
Member

@Amulyam24 see if this helps for the ginkgo - https://onsi.github.io/ginkgo/#generating-junit-xml-output

@Amulyam24
Copy link
Contributor Author

Amulyam24 commented Sep 17, 2021

looking at the test results, it just shows only one entry, not sure why?!

Yes, go-junit-report is only considering the test suite as a whole and not the individual test cases unlike using the ginkgo package. I'll look more on it.

I'm wondering if we can make optional, generate xml only when mentioned(especially via CI scripts)

@mkumatag, are you mentioning about making it optional via the scripts/ci-test.sh or through prow yaml. I'll have to explore the possibility of making it optional with the current PR changes and flow, since with prow, the presence of artifacts will always lead to generation of the XML reports.

@mkumatag
Copy link
Member

@mkumatag, are you mentioning about making it optional via the scripts/ci-test.sh or through prow yaml. I'll have to explore the possibility of making it optional with the current PR flow, since with prow, the presence of artifacts will always lead to generation of the XML reports.

not with prow, e.g: if someone triggers these tests manually then it shouldn't generate the xml and generate the xml only if the option mentioned like some env like GENERATE_JUNIT, some of the logic can be derived from the kubernetes/kubernetes repo(something can be worked as followup PR).

@Amulyam24
Copy link
Contributor Author

@mkumatag, updated with changes. PTAL.

Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Amulyam24, mkumatag

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 20, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5574fce into kubernetes-sigs:main Sep 20, 2021
@Amulyam24 Amulyam24 deleted the junit-report branch September 20, 2021 13:39
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. area/provider/ibmcloud Issues or PRs related to ibmcloud provider 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Report unit tests properly in the prow dashboards
4 participants