-
Notifications
You must be signed in to change notification settings - Fork 50
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
assert/cmd/gty-migrate-from-testify: fix TestRun by adding "go get" commands #265
base: main
Are you sure you want to change the base?
assert/cmd/gty-migrate-from-testify: fix TestRun by adding "go get" commands #265
Conversation
The test TestRun of the gty-migrate-from-testify tool apparently needs to have the original packages available to run. So let's install them ("go get" in GOPATH mode, in a temporary directory) before running the migration test.
…-check Fix incorrect import path for go-check in gty-migrate-from-testify test: github.com/go-check/check => gopkg.in/check.v1
…test Fix test to use the gopkg.in/check.v1 API correctly. The func TestWithChecker(c *check.C) was incompatible with "go test".
Unfortunately I do not get the same failure as https://app.circleci.com/pipelines/github/gotestyourself/gotest.tools/308/workflows/b1924e3f-5a1b-4cc4-967a-566c13157643/jobs/3432?invite=true#step-108-38 when I run the test on my machine (go 1.20): $ go test -run TestRun -v
=== RUN TestRun
main_test.go:16: go get github.com/go-check/check
main_test.go:16: go get github.com/stretchr/testify/assert
main_test.go:16: go get github.com/stretchr/testify/require
-: /var/folders/7b/5rfj3bgs3tj34c6f2jy8h39w0000gn/T/test-run-2939663157/src/example.com/example/some_test.go:138:1: wrong signature for TestWithChecker, must be: func TestWithChecker(t *testing.T)
assert.NotContains(t, []bool{}, true) at ../../../../../../../../var/folders/7b/5rfj3bgs3tj34c6f2jy8h39w0000gn/T/test-run-2939663157/src/example.com/example/some_test.go:56: skipping unsupported assertion
--- PASS: TestRun (16.32s)
PASS
ok gotest.tools/v3/assert/cmd/gty-migrate-from-testify 16.556s |
I can reproduce the CI failure with: $ ( cd assert/cmd/gty-migrate-from-testify/testdata/full && export GO111MODULE=off && go get github.com/stretchr/testify/assert && go get gopkg.in/check.v1 && go test ) |
3db4fce
to
fcde373
Compare
I finally had to drop the |
Everything fixed. |
ping @dnephin |
Thanks for working on this! I tried the separate module in #268. I don't understand why only go1.19 is failing. I don't see anything different about that config. It should be using module mode as well. I'll keep debugging. |
The test TestRun of the gty-migrate-from-testify tool apparently needs to have the original packages available to run. So let's install them ("go get" in GOPATH mode, in a temporary directory) before running the migration test.
Here are example of the test failures that this patch fixes: