cut test time with coverage by half
Per the inline comment, we want to build every package in the test suite at least once, otherwise we won't get proper code coverage information. For example, some code only triggers when obfuscating the runtime, and if I run "go test" twice in a row, the second might reuse the first's obfuscation of the runtime and skip the code entirely. However, per the TODO, we used to solve this in a rather wasteful way, by making each test use its own separate GOCACHE directory. Instead, use a new GOCACHE directory, but share it between tests. This is still enough, as we still build each package at least once. Running the command below twice in a row with Go 1.20: go test -cover took about 1m55s on my laptop before, and now takes about 1m10s. Not great, but a noticeable improvement. Both report a total coverage of 88.7%. While here, do the same for GARBLE_CACHE_DIR, and use testscript.Env.Setenv for simplicity.pull/682/head
parent
86b7e334ba
commit
bb69facbd8
Loading…
Reference in New Issue