Open rickeylev opened 2 years ago
@rickeylev I briefly looked into this, but already failed to get the actual test action in Starlark. All I'm seeing is:
[action 'Writing script test/undertest', action 'Creating source manifest for //test:undertest', action 'Creating runfiles tree bazel-out/k8-fastbuild/bin/test/undertest.runfiles', runfiles for //test:undertest]
If I were able to get the Testing ...
action, I think I know how to fix this in Bazel and write a test for it. Could you give me some pointers?
Confirmed. But I think this is a bug in Bazel, not in Skylib.
Note that in Bazel 6, testing.TestEnvironment is deprecated in favor of RunEnvironmentInfo, but the environment set by RunEnvironmentInfo is also not visible in analysis tests.
Test rules can return
testing.TestEnvironment
to include custom environment variables for when the test is run. This works, however, they are not visible in the action object that an analysis test sees.(incomplete) repro:
Expected: The "Testing ..." action should have FOO=BAR as one of its environment variable.
Actual: The FOO=BAR env var is not shown in the action's env values.