Skip to content
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

testscript: make testlog work with custom commands #89

Open
mvdan opened this issue Feb 3, 2020 · 0 comments
Open

testscript: make testlog work with custom commands #89

mvdan opened this issue Feb 3, 2020 · 0 comments

Comments

@mvdan
Copy link
Collaborator

mvdan commented Feb 3, 2020

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.

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.

/cc @rogpeppe @myitcv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant