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

KUBE_JUNIT_REPORT_DIR fixes #73581

Merged

Conversation

krzysied
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR fixes k8s.io/kubernetes/hack/jenkins/benchmark-dockerized.sh script.

  • If KUBE_JUNIT_REPORT_DIR is provided, benchmark-dockerized.sh script should ensure that there is go-junit-report installed.
  • KUBE_JUNIT_REPORT_DIR is nor provided, k8s.io/kubernetes/hack/make-rules/test.sh should write log to sdtout.

Which issue(s) this PR fixes:
ref #72363

Special notes for your reviewer:
reverting some changes from #72218

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 31, 2019
@krzysied
Copy link
Contributor Author

/hold
@cblecker I'm reverting some changes from PR. PTAL

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 31, 2019
@krzysied krzysied force-pushed the test_KUBE_JUNIT_REPORT_DIR_revert branch from 0b64682 to feec2c1 Compare January 31, 2019 10:52
@krzysied
Copy link
Contributor Author

/priority important-soon
/sig testing

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 31, 2019
@@ -34,6 +34,9 @@ retry() {
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}

retry go get github.com/cespare/prettybench
if [[ -n "${KUBE_JUNIT_REPORT_DIR:-}" ]]; then
go get github.com/jstemmer/go-junit-report
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this (and prettybench) vendored? If not they should be.

We should not be downloading code (flaky and/or disapper) during test execution.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @fejta. Also not sure testing on this is right.. we either call go-junit-report or we don't.. I don't think that hinges on if we have the report dir set, does it? If it does, can you link to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

About vendoring prettybench, I agree with @fejta.
However, I would like to focus on fixing hack/jenkins/benchmark-dockerized.sh first.
I can file an issue about downloading golang modules instead of vendoring it. For example go-junit-report is also downloaded in hack/jenkins/gotest.sh and hack/jenkins/test-dockerized.sh.

Copy link
Contributor

Choose a reason for hiding this comment

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

If benchmark-dockerized.sh needs go-junit-report, it should go install the vendored version like our other utilities do:

go install k8s.io/kubernetes/vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle

As long as we're fixing this, we should also fix prettybench to be a go install command rather than go get, but feel free to punt on that if you'd prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created separate PR #73740 to add go-junit-report and prettybench to the vendor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Gave that one a review.

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 :)

@@ -120,10 +120,6 @@ KUBE_TEST_API_VERSIONS="${KUBE_TEST_API_VERSIONS:-${ALL_VERSIONS_CSV}}"
# once we have multiple group supports
# Create a junit-style XML test report in this directory if set.
KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-}
# If KUBE_JUNIT_REPORT_DIR is unset, and ARTIFACTS is set, then have them match.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this is being removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took me some time, but I think I finally understood what's the issue.
The problem is cause by

if [[ -n "${KUBE_JUNIT_REPORT_DIR}" ]] ; then
and to be more precise
go_test_grep_pattern="^[^[:space:]]\+[[:space:]]\+[^[:space:]]\+/[^[[:space:]]\+"

When junit reporter is enabled, it filters out most of the logs.
I see two possible fixes:

  • remove setting KUBE_JUNIT_REPORT_DIR to ARTIFACTS as default
  • remove this go_test_grep_pattern that filters out logs

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, we probably don't want to remove this, as this is an important system in our CI system.

Copy link
Member

@cblecker cblecker Feb 7, 2019

Choose a reason for hiding this comment

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

If ARTIFACTS is also unset, then this won't be set (the local use case).

This is important for CI and shouldn't be removed (agree with @fejta).
/lgtm cancel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, so lets proceed then with changing go_test_grep_pattern.
I added flag that will force printing full log. hack/jenkins/benchmark-dockerized.sh will set this flag, get full log and convert it into benchmark. At the same time, there should be no impact on your CI.
Wdyt?

@@ -34,6 +34,9 @@ retry() {
export PATH=${GOPATH}/bin:${PWD}/third_party/etcd:/usr/local/go/bin:${PATH}

retry go get github.com/cespare/prettybench
if [[ -n "${KUBE_JUNIT_REPORT_DIR:-}" ]]; then
go get github.com/jstemmer/go-junit-report
Copy link
Member

Choose a reason for hiding this comment

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

I agree with @fejta. Also not sure testing on this is right.. we either call go-junit-report or we don't.. I don't think that hinges on if we have the report dir set, does it? If it does, can you link to that?

@cblecker
Copy link
Member

/assign

@krzysied
Copy link
Contributor Author

krzysied commented Feb 5, 2019

/hold
Blocked until #73740 is merged. [Done]

@krzysied krzysied force-pushed the test_KUBE_JUNIT_REPORT_DIR_revert branch from feec2c1 to 97654b1 Compare February 6, 2019 10:11
@krzysied
Copy link
Contributor Author

krzysied commented Feb 6, 2019

/hold cancel
#73740 is merged. PR rebased.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 6, 2019
Copy link
Contributor

@fejta fejta 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 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 Feb 6, 2019
Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

/hold

@@ -120,10 +120,6 @@ KUBE_TEST_API_VERSIONS="${KUBE_TEST_API_VERSIONS:-${ALL_VERSIONS_CSV}}"
# once we have multiple group supports
# Create a junit-style XML test report in this directory if set.
KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-}
# If KUBE_JUNIT_REPORT_DIR is unset, and ARTIFACTS is set, then have them match.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, we probably don't want to remove this, as this is an important system in our CI system.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 6, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2019
@krzysied krzysied force-pushed the test_KUBE_JUNIT_REPORT_DIR_revert branch from 97654b1 to 9256a59 Compare February 7, 2019 10:39
@krzysied krzysied force-pushed the test_KUBE_JUNIT_REPORT_DIR_revert branch from 9256a59 to d138e08 Compare February 7, 2019 10:49
@krzysied krzysied force-pushed the test_KUBE_JUNIT_REPORT_DIR_revert branch from d138e08 to c20262e Compare February 7, 2019 11:05
Copy link
Contributor

@fejta fejta 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 k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 8, 2019
@fejta
Copy link
Contributor

fejta commented Feb 8, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta, krzysied

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

@krzysied
Copy link
Contributor Author

krzysied commented Feb 8, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 999e2e0 into kubernetes:master Feb 8, 2019
@krzysied krzysied deleted the test_KUBE_JUNIT_REPORT_DIR_revert branch February 8, 2019 10:57
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants