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

WIP: test: use go workspace when testing #394

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justinsb
Copy link
Contributor

@justinsb justinsb commented Jun 7, 2024

No description provided.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 7, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 7, 2024
@justinsb justinsb changed the title test: use go workspace when testing WIP: test: use go workspace when testing Jun 7, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2024
@tomasaschan
Copy link
Member

I think this might be what currently blocks builds on a bunch of PRs; if I do this locally (including adding the submodules) the tests that fail on those PRs start passing again.

Is there a reason to not just check in the workspace file in the repo (and use it "always" and not just in the test runs)?

@justinsb
Copy link
Contributor Author

justinsb commented Jun 10, 2024

I think this might be what currently blocks builds on a bunch of PRs; if I do this locally (including adding the submodules) the tests that fail on those PRs start passing again.

So I've re-discovered what I had forgotten, we already do this in hack/ci/test.sh. I've started putting those under dev/presubmits/... (or dev/ci/presubmits/...) so maybe that would be more discoverable.

That said, I think we should also ensure that dev/update-golden either requires a go.work or creates one temporarily, and probably nudge developers to run dev/update-golden when the other tests fail.

Is there a reason to not just check in the workspace file in the repo (and use it "always" and not just in the test runs)?

The only reason is that I haven't seen it done elsewhere. But I agree with you, I'm increasingly wondering when we would not want it. My biggest concern is that it breaks usage as a library somehow, in the same way that go.mod rewrites can sometimes cause problems.

@tomasaschan
Copy link
Member

tomasaschan commented Jun 10, 2024

I though the whole point of go.work was to enable rewrites and similar tweaks in development while explicitly not affecting usage when importing the module. Maybe worth verifying, but unless I'm completely off here I think it'd be nice to just commit this and ensure the normal workflows with eg plain go test Just Works:tm:

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 8, 2024
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants