Skip to content

build: Enforce all the default 'go vet' checks on all Go sources - #1186

Merged
debarshiray merged 3 commits into
containers:mainfrom
debarshiray:wip/rishi/go-vet
Dec 2, 2022
Merged

debarshiray merged 3 commits into
containers:mainfrom
debarshiray:wip/rishi/go-vet

Conversation

@debarshiray

@debarshiray debarshiray commented Dec 2, 2022 •

Copy link
Copy Markdown
Member

Currently, only a so-called high-confidence subset of the default checks in go vet are being run by go test [1]. Since go vet is part of the core Go tools, it's worth trying to use more of it. After all, golangci-lint, which is currently being run through a GitHub Action, is running the default go vet checks as one of its linters [2].

It's good to have as much of the testing wrapped inside meson test, as possible, because it's easier to run locally and on other non-GitHub CI environments like those of downstream distributors.

[1] https://pkg.go.dev/cmd/go/internal/test

[2] https://golangci-lint.run/usage/linters/
https://golangci-lint.run/usage/linters/#govet

@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

✔️ unit-test SUCCESS in 8m 25s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 8m 51s
✔️ system-test-fedora-rawhide SUCCESS in 23m 15s
✔️ system-test-fedora-36 SUCCESS in 11m 13s
✔️ system-test-fedora-35 SUCCESS in 12m 06s

Currently, only a so-called high-confidence subset of the default checks
in 'go vet' are being run by 'go test' [1].  Since 'go vet' is part of
the core Go tools, it's worth trying to use more of it.  After all,
golangci-lint, which is currently being run through a GitHub Action,
is running the default 'go vet' checks as one of its linters [2].

It's good to have as much of the testing wrapped inside 'meson test', as
possible, because it's easier to run locally and on other non-GitHub CI
environments like those of downstream distributors.

[1] https://pkg.go.dev/cmd/go/internal/test

[2] https://golangci-lint.run/usage/linters/
    https://golangci-lint.run/usage/linters/#govet

containers#1186
@debarshiray debarshiray changed the title Run all the default 'go vet' tests, not just the high-confidence used in 'go test' build: Enforce all the default 'go vet' checks on all Go sources Dec 2, 2022
Otherwise, there's so much spew from 'go test', including the successful
tests, that the actual failures don't stand out.

Note that, the different steps involved in building the code base are a
lot more interdependent on each other.  Hence, some extra verbosity
can help understand what caused a build failure on non-interactive build
environments.  In contrast, the runtime outputs from each test case are
a lot more isolated and independent from one another.  The additional
verbosity from successful tests doesn't really help understand why a
particular test failed.

containers#1186
@softwarefactory-delete-me

Copy link
Copy Markdown

Build failed.

✔️ unit-test SUCCESS in 8m 32s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 8m 38s
❌ system-test-fedora-rawhide POST_FAILURE in 41m 29s
✔️ system-test-fedora-36 SUCCESS in 10m 59s
✔️ system-test-fedora-35 SUCCESS in 12m 30s

@softwarefactory-delete-me

Copy link
Copy Markdown

Build succeeded.

✔️ unit-test SUCCESS in 8m 35s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 8m 23s
✔️ system-test-fedora-rawhide SUCCESS in 29m 42s
✔️ system-test-fedora-36 SUCCESS in 11m 26s
✔️ system-test-fedora-35 SUCCESS in 12m 28s

@debarshiray
debarshiray merged commit 9e1cc2a into containers:main Dec 2, 2022
@debarshiray
debarshiray deleted the wip/rishi/go-vet branch December 2, 2022 13:20
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jan 29, 2023
The previous commit broke the golangci-lint test [1] because the GitHub
Action runs on Ubuntu 22.04, which only has Shadow 4.8 [2], whereas
libsubid.so was introduced in Shadow 4.9 [3].

However, that's not a big deal because 'go vet' was earlier added to the
set of tests run by 'meson test' [4], and 'go vet' is one of the linters
run by golangci-lint [5].  So, while it's not a proper replacement, it's
good enough.

[1] Commit ca8007c
    containers#1180

[2] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[3] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[4] Commit f695012
    containers#1186

[5] https://golangci-lint.run/usage/linters/
    https://golangci-lint.run/usage/linters/#govet

This reverts commit 7c86f30.
debarshiray added a commit to debarshiray/toolbox that referenced this pull request Jan 29, 2023
The previous commit broke the golangci-lint test [1] because the GitHub
Action runs on Ubuntu 22.04, which only has Shadow 4.8 [2], whereas
libsubid.so was introduced in Shadow 4.9 [3].

However, that's not a big deal because 'go vet' was earlier added to the
set of tests run by 'meson test' [4], and 'go vet' is one of the linters
run by golangci-lint [5].  So, while it's not a proper replacement, it's
good enough.

[1] Commit ca8007c
    containers#1180

[2] https://packages.ubuntu.com/source/jammy/shadow
    https://packages.ubuntu.com/source/jammy-updates/shadow

[3] Shadow commit 0a7888b1fad613a0
    shadow-maint/shadow@0a7888b1fad613a0
    shadow-maint/shadow#154

[4] Commit f695012
    containers#1186

[5] https://golangci-lint.run/usage/linters/
    https://golangci-lint.run/usage/linters/#govet

This reverts commit 7c86f30.

containers#1221
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.

1 participant