You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two files: main.go importing golang.org/x/image/tiff and go.mod specifying dependency.
It seems that currently result of the vgo test all execution depends on whether vendor directory present or not. If there's no vendor directory, test succeeds:
vgo-test1 (master) ¶ vgo test all
? github.com/artyom/vgo-test1 [no test files]
ok golang.org/x/image/tiff (cached)
? golang.org/x/image/tiff/lzw [no test files]
After vgo vendor call that populates vendor directory, vgo test all fails because testdata is not vendored (while *_test.go files are):
It seems that vgo should either vendor testdata directories or ignore them completely as stated in introductory tour:
In order to provide for a graceful transition, vgo-based builds ignore vendor directories entirely [...]
What did you expect to see?
vgo-test1 (master) ¶ vgo vendor
vgo-test1 (master) ¶ vgo test all
? github.com/artyom/vgo-test1 [no test files]
ok golang.org/x/image/tiff (cached)
? golang.org/x/image/tiff/lzw [no test files]
What did you see instead?
vgo-test1 (master) ¶ vgo vendor
vgo-test1 (master) ¶ vgo test all
? github.com/artyom/vgo-test1 [no test files]
--- FAIL: TestNoRPS (0.00s)
reader_test.go:47: open ../testdata/no_rps.tiff: no such file or directory
--- FAIL: TestNoCompression (0.00s)
reader_test.go:57: open ../testdata/no_compress.tiff: no such file or directory
--- FAIL: TestShortBlockData (0.00s)
reader_test.go:85: open ../testdata/bw-uncompressed.tiff: no such file or directory
--- FAIL: TestDecodeInvalidDataType (0.00s)
reader_test.go:111: open ../testdata/bw-uncompressed.tiff: no such file or directory
--- FAIL: TestDecode (0.00s)
reader_test.go:155: open ../testdata/video-001.png: no such file or directory
--- FAIL: TestDecodeLZW (0.00s)
reader_test.go:185: open ../testdata/blue-purple-pink.png: no such file or directory
--- FAIL: TestDecodeTagOrder (0.00s)
reader_test.go:200: open ../testdata/video-001.tiff: no such file or directory
--- FAIL: TestDecompress (0.00s)
reader_test.go:225: decoding bw-uncompressed.tiff: open ../testdata/bw-uncompressed.tiff: no such file or directory
--- FAIL: TestZeroBitsPerSample (0.00s)
reader_test.go:264: open ../testdata/bw-deflate.tiff: no such file or directory
--- FAIL: TestTileTooBig (0.00s)
reader_test.go:292: open ../testdata/video-001-tile-64x64.tiff: no such file or directory
--- FAIL: TestRoundtrip (0.00s)
writer_test.go:43: open ../testdata/video-001.tiff: no such file or directory
FAIL
FAIL github.com/artyom/vgo-test1/vendor/golang.org/x/image/tiff 0.012s
? github.com/artyom/vgo-test1/vendor/golang.org/x/image/tiff/lzw [no test files]
ok golang.org/x/image/tiff (cached)
? golang.org/x/image/tiff/lzw [no test files]
The text was updated successfully, but these errors were encountered:
I think if we prune vendored deps, then we should not include *_test.go files. I'm not sure if there is way for go to know what directories/files are used in tests consistently.
It's important to keep the tests. You should run tests of your dependencies, especially if you've put them into a new, previously-untested configuration. The testdata issue is interesting. We could just keep all the testdata directories in parent directories of copied packages too.
rsc
changed the title
x/vgo: inconsistent handling of vendor directory
x/vgo: vendor testdata from parent directories of copied packages
Apr 2, 2018
rsc
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Apr 2, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10 darwin/amd64 vgo:2018-02-20.1
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Please see this example repository: https://github.com/artyom/vgo-test1
There are two files: main.go importing
golang.org/x/image/tiff
and go.mod specifying dependency.It seems that currently result of the
vgo test all
execution depends on whethervendor
directory present or not. If there's no vendor directory, test succeeds:After
vgo vendor
call that populatesvendor
directory,vgo test all
fails becausetestdata
is not vendored (while*_test.go
files are):It seems that vgo should either vendor testdata directories or ignore them completely as stated in introductory tour:
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: