Open fasmat opened 6 days ago
@r-hang do you have an feedback on this? 🙂
Hey @fasmat, I see some CI errors. I'm wondering if this has to do with the changes to the GO111MODULE flag. As for the test configuration, I think having CI tests for just the two latest versions of Go is sufficient.
Thank you for your contribution!
Hi @r-hang! I'm still trying to figure out why the one package fails to be parsed when executing the tests with newer go versions.
I don't think this is related to GO111MODULE
. GO111MODULE=on
has been the default since 1.13 if $PWD
is outside $GOROOT
and a go.mod
file is found. Since 1.18 GO111MODULE
has to be set to off to get the old behavior (before go install
became an option) of go get
.
Since this contribution: https://github.com/golang/mock/pull/641 tests have only been executed for Go 1.18.x but not for other versions and since this contribution https://github.com/uber-go/mock/pull/6 the CI has been using Go 1.19.x and 1.20.x which means some PR merged after that broke the tests.
The package that fails the test was contributed in https://github.com/uber-go/mock/pull/11 and if I checkout that commit and run ./ci/tests.sh
without the Go v1.18.x check it actually passes - so that narrows it down to some change between this PR and today that must have broken the test.
git bisect
lead me to this PR: https://github.com/uber-go/mock/pull/48 before it was merged ./ci/test.sh
passes. After that contribution it fails with
$ ./ci/test.sh
/var/folders/4z/mx354sss66ndtlb135lfjnmc0000gn/T/tmp.Jhr9l4UvJI /var/folders/4z/mx354sss66ndtlb135lfjnmc0000gn/T/tmp.Jhr9l4UvJI
2024/07/02 20:16:53 Loading input failed: faux/faux.go:5:2: could not parse package faux: package faux is not in std (/opt/homebrew/Cellar/go/1.22.4/libexec/src/faux)
mockgen/internal/tests/aux_imports_embedded_interface/bugreport.go:3: running "mockgen": exit status 1
package command-line-arguments
prog.go:14:2: use of internal package go.uber.org/mock/mockgen/internal/tests/internal_pkg/subdir/internal/pkg not allowed
but it didn't show up in the CI because the tests were never executed. 🙁
I updated the CI to use the two newest stable versions of go (v1.21.x and v1.22.x) to test the code as well as the oldest version (
v1.19.x
) that could still be used to build the source.The behaviour of the
go version
line ingo.mod
changed withv1.21.x
: it should state the oldest version of go that is needed to build the source, withv1.19.x
the source builds without issues and all tests pass, older versions fail.