dflems
dflems

Reputation: 214

Test result caching using --test_env

Is there a way to mark certain --test_env values to not affect the cacheability of test results?

I have a scenario where there exists a fixed pool of n test resources. I've set the level of test parallelization to be no more than the size of this pool using --local_test_jobs=n. The resources are managed by a small daemon that is launched before calling bazel test. The port for this daemon is passed in using --test_env. Unless we want to use a fixed port number, each time we pass a different port number in, bazel test will refuse to use cached test results as the action environment has changed.

Is this possible? If not, is there some other mechanism that can provide a similar functionality?

Upvotes: 1

Views: 322

Answers (1)

hlopko
hlopko

Reputation: 3268

If you could make e.g. a network call to get the port number from the test, and do the call during the test, you don't have to pass port number using --test_env and all the test runs will be properly cached. Does it make sense?

Upvotes: 1

Related Questions