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
All the files that the test binary directly opens are included in said cache key. This includes the testscript txt files.
However, custom commands are run by doing nested execs of the test binary. The files opened by the nested process alone are thus not included in the testlog file.
For example, in this example above, /foo/bar in the git repository would be consumed by a test script, but it wouldn't be included in the test cache key. If modified, go test would happily not re-run the tests.
my-cmd read-file ${GIT_ROOT}/foo/bar
I think we should add some code to help the magic work with nested exec calls, similar to what we did for code coverage.
See https://golang.org/src/testing/internal/testdeps/ - this code is used so that
go test
knows what files to include when computing the test cache key.All the files that the test binary directly opens are included in said cache key. This includes the testscript txt files.
However, custom commands are run by doing nested execs of the test binary. The files opened by the nested process alone are thus not included in the testlog file.
For example, in this example above,
/foo/bar
in the git repository would be consumed by a test script, but it wouldn't be included in the test cache key. If modified,go test
would happily not re-run the tests.I think we should add some code to help the magic work with nested exec calls, similar to what we did for code coverage.
/cc @rogpeppe @myitcv
The text was updated successfully, but these errors were encountered: