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

Disable vet as part of go test #33662

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Feb 20, 2025

go vet implicitely runs as part of go test, but we already have make lint-go-vet, so we were essentially running it twice. This should hopefully make go test slightly faster.

Ref: https://pkg.go.dev/cmd/go#hdr-Test_packages

As part of building a test binary, go test runs go vet

`go vet` implicitely runs as part of `go test`, but we already have
`make lint-go-vet`.

Ref: https://pkg.go.dev/cmd/go#hdr-Test_packages
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 20, 2025
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 20, 2025
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Feb 20, 2025
@silverwind
Copy link
Member Author

silverwind commented Feb 20, 2025

Actually I see we ran vet only with -vettool which replaces the default checks:

The -vettool=prog flag selects a different analysis tool with alternative
or additional checks.

So I've added a command that now runs plain vet as part of lint-go-vet.

@silverwind
Copy link
Member Author

Need to check whether gitea-vit replaces or extends the builtin checks. If the latter, we only need to run go vet once.

@silverwind silverwind marked this pull request as draft February 20, 2025 18:10
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 20, 2025
@techknowlogick
Copy link
Member

On a lower powered machine this definitely helps.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 20, 2025
@silverwind
Copy link
Member Author

silverwind commented Feb 20, 2025

Yeah I agree, go test in general is a massively slow test runner compared to others like vitest, I guess it's partly because it runs vet. But let's wait on the investigation above until I'm certain whether one or two vet calls are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/internal size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants