assert/cmd/gty-migrate-from-testify: fix TestRun by adding "go get" commands#265
Open
dolmen wants to merge 3 commits intogotestyourself:mainfrom
Open
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".
Contributor
Author
|
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 |
Contributor
Author
|
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
Contributor
Author
|
I finally had to drop the |
Contributor
Author
|
Everything fixed. |
This was referenced Jun 12, 2023
Merged
Merged
Merged
Contributor
Author
|
ping @dnephin |
Member
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: