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

Bug 1999188: hack/verify-vendor.sh: clean module cache pre-test #5178

Closed

Conversation

patrickdillon
Copy link
Contributor

go mod verify "checks that dependencies of the main
module stored in the module cache have not been
modified since they were downloaded." As these tests
are running in a container, it the contents of that
cache seem arbitrary.

By adding go clean -modcache we can clear the cache
before testing to ensure a fresh start and that
go mod verify is not complaining about altering
contents that should be removed.

The cache seems to cause an issue in #5120. When updating to go 1.16 and then running hack/verify-vendor.sh, the test fails on go mod verify as some files have been (correctly) removed:

--- a/go.sum
+++ b/go.sum
@@ -490,7 +490,6 @@ github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkg
 github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik=
 github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
 github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
-github.com/elazarl/goproxy/ext v0.0.0-20190911111923-ecfe977594f1 h1:8B7WF1rIoM8H1smfpXFvOawSAzlRDMVzoGu9zE3+OCk=
 github.com/elazarl/goproxy/ext v0.0.0-20190911111923-ecfe977594f1/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
 github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
 github.com/emicklei/go-restful v2.9.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
@@ -1345,7 +1344,6 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
 github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
 github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
-github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
 github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
 github.com/nbutton23/zxcvbn-go v0.0.0-20160627004424-a22cb81b2ecd/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
 github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
@@ -1936,7 +1934,6 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
 go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
 go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
-go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
 go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
 go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
{"component":"entrypoint","error":"wrapped process failed: exit status 1","file":"prow/entrypoint/run.go:80","func":"k8s.io/test-infra/prow/entrypoint.Options.Run","level":"error","msg":"Error executing test process","severity":"error","time":"2021-08-30T14:27:40Z"} 

go mod verify "checks that dependencies of the main
 module stored in the module cache have not been
modified since they were downloaded." As these tests
are running in a container, it the contents of that
cache seem arbitrary.

By adding go clean -modcache we can clear the cache
before testing to ensure a fresh start and that
go mod verify is not complaining about altering
contents that should be removed.

[0] https://golang.org/ref/mod#go-mod-verify
@patrickdillon
Copy link
Contributor Author

@LorbusChris @abhinavdahiya your input would be valuable here, as I think you have a good understanding of go vendoring.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from patrickdillon after the PR has been reviewed.

The full list of commands accepted by this bot can be found 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

@LorbusChris
Copy link
Member

LorbusChris commented Aug 30, 2021

@patrickdillon to me it looks like the issue in the failing verify test on #5120 is the git diff that was found. Running and committing go mod tidy && go mod vendor (with Go 1.16) on the #5120 branch should fix that.

Clearing the cache does make sense if that's not done at build time, wouldn't fix the above, though.

@patrickdillon
Copy link
Contributor Author

/retitle Bug 1999188: hack/verify-vendor.sh: clean module cache pre-test

@openshift-ci openshift-ci bot changed the title hack/verify-vendor.sh: clean module cache pre-test Bug 1999188: hack/verify-vendor.sh: clean module cache pre-test Aug 30, 2021
@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Aug 30, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2021

@patrickdillon: This pull request references Bugzilla bug 1999188, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (gpei@redhat.com), skipping review request.

In response to this:

Bug 1999188: hack/verify-vendor.sh: clean module cache pre-test

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2021

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

Test name Commit Details Rerun command
ci/prow/e2e-openstack-provider-network 1cd0390 link /test e2e-openstack-provider-network
ci/prow/e2e-metal-ipi-ovn-ipv6 1cd0390 link /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-crc 1cd0390 link /test e2e-crc
ci/prow/e2e-aws-upgrade 1cd0390 link /test e2e-aws-upgrade
ci/prow/e2e-libvirt 1cd0390 link /test e2e-libvirt
ci/prow/e2e-aws-fips 1cd0390 link /test e2e-aws-fips
ci/prow/e2e-aws-workers-rhel7 1cd0390 link /test e2e-aws-workers-rhel7
ci/prow/e2e-openstack-byon 1cd0390 link /test e2e-openstack-byon

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@patrickdillon
Copy link
Contributor Author

@patrickdillon to me it looks like the issue in the failing verify test on #5120 is the git diff that was found. Running and committing go mod tidy && go mod vendor (with Go 1.16) on the #5120 branch should fix that.

Clearing the cache does make sense if that's not done at build time, wouldn't fix the above, though.

Thanks for sanity checking this. You are correct. I thought we already tried your suggestion (both locally and in the PR), but it definitely works when trying it again. So this PR is unnecessary.

/close

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2021

@patrickdillon: Closed this PR.

In response to this:

@patrickdillon to me it looks like the issue in the failing verify test on #5120 is the git diff that was found. Running and committing go mod tidy && go mod vendor (with Go 1.16) on the #5120 branch should fix that.

Clearing the cache does make sense if that's not done at build time, wouldn't fix the above, though.

Thanks for sanity checking this. You are correct. I thought we already tried your suggestion (both locally and in the PR), but it definitely works when trying it again. So this PR is unnecessary.

/close

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.

@openshift-ci openshift-ci bot closed this Aug 30, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2021

@patrickdillon: This pull request references Bugzilla bug 1999188. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

In response to this:

Bug 1999188: hack/verify-vendor.sh: clean module cache pre-test

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants