Skip to content

Commit

Permalink
[antlir][oss] fix bzl/linux tests
Browse files Browse the repository at this point in the history
Summary:
These pass internally because the python interpreter from `/usr/local/fbcode`
is available without needing to actually be installed, but in OSS we need to
install `python3`

Test Plan:
```
❯ https_proxy=fwdproxy:8080 ../dotslash buck2 test //antlir/bzl/linux/tests:test-{os-release,timezone-{utc,us-pacific}}
✓ Pass: antlir//antlir/bzl/linux/tests:test-os-release (0.3s)
---- STDOUT ----

---- STDERR ----
test_custom_name (antlir.bzl.linux.tests.test_os_release.OsReleaseTest)
Verify that a custom 'os_name' is correctly included ... ok
test_os_release (antlir.bzl.linux.tests.test_os_release.OsReleaseTest)
Verify that the os-release file properly built. ... ok
test_vcs (antlir.bzl.linux.tests.test_os_release.OsReleaseTest)
Verify that VCS info is correctly included ... ok

----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK

✓ Pass: antlir//antlir/bzl/linux/tests:test-timezone-utc (0.2s)
---- STDOUT ----

---- STDERR ----
test_timezome (antlir.bzl.linux.tests.test_time.TimeTest)
Verify that the timezone is set properly. ... ok

----------------------------------------------------------------------
Ran 1 test in 0.003s

OK

✓ Pass: antlir//antlir/bzl/linux/tests:test-timezone-us-pacific (0.2s)
---- STDOUT ----

---- STDERR ----
test_timezome (antlir.bzl.linux.tests.test_time.TimeTest)
Verify that the timezone is set properly. ... ok

----------------------------------------------------------------------
Ran 1 test in 0.003s

OK

Build ID: 46c923de-00e7-4856-82ad-3ff048a5b781
Network: Up: 0B  Down: 0B
Jobs completed: 68. Time elapsed: 17.1s.
Cache hits: 0%. Commands: 24 (cached: 0, remote: 0, local: 24)
Tests finished: Pass 3. Fail 0. Fatal 0. Skip 0. Build failure 0
```

Reviewed By: justintrudell

Differential Revision: D61816146

fbshipit-source-id: 064e81260f7bce17975b5741b579e45210e1907f
  • Loading branch information
vmagro authored and facebook-github-bot committed Aug 27, 2024
1 parent abb723a commit 7f38eb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ jobs:
--disable //antlir/antlir2/test_images/cfg/target_arch/... \
--disable //antlir/antlir2/testing/tests:booted-image-test-that-should-fail \
--disable //antlir/antlir2/testing/tests:test-sh-booted-requires-units \
--disable //antlir/bzl/linux/tests:test-os-release \
--disable //antlir/bzl/linux/tests:test-timezone-us-pacific \
--disable //antlir/bzl/linux/tests:test-timezone-utc \
--disable //antlir/bzl/shape2/... \
--disable //antlir/bzl/tests/shapes/... \
--disable //antlir/rust:gen-modules-bzl-unittest \
Expand Down
15 changes: 12 additions & 3 deletions antlir/bzl/linux/tests/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ image.layer(
image.layer(
name = "test-layer-timezone-utc",
features = [
feature.rpms_install(rpms = ["coreutils"]),
feature.rpms_install(rpms = [
"coreutils",
"python3",
]),
linux.time.timezone(zone = "UTC"),
],
)
Expand All @@ -47,7 +50,10 @@ image_python_test(
image.layer(
name = "test-layer-timezone-us-pacific",
features = [
feature.rpms_install(rpms = ["coreutils"]),
feature.rpms_install(rpms = [
"coreutils",
"python3",
]),
linux.time.timezone(zone = "US/Pacific"),
],
)
Expand Down Expand Up @@ -89,7 +95,10 @@ linux.release.file(
image.layer(
name = "test-layer-os-release",
features = [
feature.rpms_install(rpms = ["coreutils"]),
feature.rpms_install(rpms = [
"coreutils",
"python3",
]),
linux.release.install(
api_versions = {
"BAR": 22,
Expand Down

0 comments on commit 7f38eb3

Please sign in to comment.