-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][vm] read env values instead of passing them in
Summary: Currently, vmtest pass in `--setenv` with values from `ExternalRunnerTestInfo.env`. This mostly works except when the env values contain macros like `$(location)`. Based on testing, those macros will not be evaluated at the time our provider generates the full command for spawning the test. Thus we get them passed in verbatim into container and VM, which obviously won't work. Instead, defer reading of the env values until our VM process spawns, at which point the macros must have been evaluated. This does mean that [shell] sub target will not be able to reproduce the same environment as the real test. `buck run` simply won't set any of those test envs. However, we don't really have a choice given `buck run` will not get the evaluated value anyway. More context: https://fb.workplace.com/groups/askbuck/posts/25235126456109298 https://fb.workplace.com/groups/antlirusers/posts/1780377695727348 https://www.internalfb.com/diff/D49933136 Test Plan: Enhance unit test and vmtests to cover this case. CI signal should cover all these tests. ```name=Verify the failing test $ buck2 test 'fbcode//mode/dbgo-cov' '-c' 'fbcode.cxx_coverage_only=strobelight' fbcode//strobelight/server/vmtest:pylatency-bpf-verification-vm-test-5.19.0-0_fbk4_10711_g9cbb08e4dfe0 -- --exact 'strobelight/server/vmtest:pylatency-bpf-verification-vm-test-5.19.0-0_fbk4_10711_g9cbb08e4dfe0 - PyLatencyVerificationTest.Load' --collect-coverage '--code-coverage-session=test_session' --force-tpx File changed: fbsource//default.profraw File changed: fbcode//strobelight/server/vmtest/strobelight_test_hhvm_usdt.py File changed: fbcode//strobelight/server/test/USDTDummyLoopRRM.cpp 12 additional file change events Buck UI: https://www.internalfb.com/buck2/28bf261e-14d0-4f8b-8c07-3e6fb2186a53 Test UI: https://www.internalfb.com/intern/testinfra/testrun/4503599830155826 Network: Up: 174B Down: 11MiB (reSessionID-c122a95b-c397-4508-aa43-ce8ccb5cd48c) Jobs completed: 149. Time elapsed: 52.2s. Cache hits: 100%. Commands: 1 (cached: 1, remote: 0, local: 0) Tests finished: Pass 1. Fail 0. Fatal 0. Skip 0. Build failure 0 ``` Reviewed By: epilatow Differential Revision: D49981391 fbshipit-source-id: db7304bad30c6180fd1a0ffc5c411ef9bfa1a971
- Loading branch information
1 parent
313e134
commit de90c12
Showing
10 changed files
with
197 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.