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

build: Enable run_tests.sh to work with go.work. #3021

Merged
merged 1 commit into from Nov 23, 2022

Conversation

jholdstock
Copy link
Member

The script run_tests.sh does not work if a go.work file is present in the project root. This is because when a go.work file is present, go list -m returns the names of all modules in the workspace rather than just the parent module in the root directory. Removing the -m flag fixes this.

The script `run_tests.sh` does not work if a go.work file is present in
the project root. This is because when a `go.work` file is present, `go
list -m` returns the names of all modules in the workspace rather than
just the parent module in the root directory. Removing the `-m` flag
fixes this.
Copy link
Member

@matheusd matheusd left a comment

Choose a reason for hiding this comment

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

I tested a bunch of things but couldn't break this when running run_tests.sh inside the dcrd repo.

Only way I could break go list using a workspace was by working on a different cwd and using a workspace with (for example) use ./dcrd, but I expect that's not an intended use case for run_tests.sh.

run_tests.sh Show resolved Hide resolved
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This is indeed the case and can easily be seen by running versions of Go before and after the introduction of workspaces:

$ go1.16.15 list -m
github.com/decred/dcrd
$ go1.17.13 list -m
github.com/decred/dcrd
$ go1.18.8 list -m
github.com/decred/dcrd
github.com/decred/base58
github.com/decred/dcrd/addrmgr/v2
...

@davecgh davecgh changed the title contrib: Enable run_tests.sh to work with go.work. build: Enable run_tests.sh to work with go.work. Nov 23, 2022
@davecgh davecgh added this to the 1.8.0 milestone Nov 23, 2022
@davecgh davecgh merged commit a5266ce into decred:master Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants