-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][image_test] use static units for booted tests
Summary: Use as much static unit configuration as possible for booted tests. There is still a ton of drop-in settings required for things that can only be determined at runtime (including the test command, environment, etc) However, this does make the tests a bit easier to manually debug, since there is only one drop-in being generated instead of 3 Test Plan: ``` ❯ buck2 test fbcode//antlir/antlir2/testing/tests: fbcode//metalos/imaging_initrd/tests/broken-generator:broken-generator.antlir2 Buck UI: https://www.internalfb.com/buck2/12c0e77e-aed1-4419-94c6-dc12eb960529 Test UI: https://www.internalfb.com/intern/testinfra/testrun/2814749958879637 Note: Using experimental modern dice Network: Up: 0B Down: 0B Jobs completed: 141. Time elapsed: 24.7s. Tests finished: Pass 32. Fail 0. Fatal 0. Skip 0. Build failure 0 ``` Reviewed By: epilatow Differential Revision: D47886919 fbshipit-source-id: b274816ef291656ce503d8dce2d788d3857d251e
- Loading branch information
1 parent
f0b2d99
commit 76d6875
Showing
7 changed files
with
160 additions
and
94 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
19 changes: 19 additions & 0 deletions
19
antlir/antlir2/testing/image_test/antlir2_image_test.service
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Unit that runs the booted unit test. This is heavily re-configured by a | ||
# drop-in that inserts the command, env vars, cwd, and any other things that can | ||
# only be determined at runtime | ||
[Unit] | ||
DefaultDependencies=no | ||
# Exit the container as soon as this test is done, using the exit code of the | ||
# process | ||
SuccessAction=exit-force | ||
FailureAction=exit-force | ||
|
||
[Service] | ||
# Having Type=simple will not cause a test that waits for `systemctl | ||
# is-system-running` to stall until the test itself is done (which would never | ||
# happen). {Failure,Success}Action are still respected when the test process | ||
# exits either way. | ||
Type=simple | ||
Environment=USER=%u | ||
StandardOutput=truncate:/antlir2/test_stdout | ||
StandardError=truncate:/antlir2/test_stderr |
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.