From 5fcbc9f888c71f583a4345a61f4123e66e9a3103 Mon Sep 17 00:00:00 2001 From: Appu Date: Thu, 3 Sep 2026 11:35:00 -0400 Subject: [PATCH] fix: don't run docker tests on bcr presubmit bcr presubmit does a smoke test on the build, but now skips tests that require a docker daemon also does a buildifier cleanup on this repo Signed-off-by: Appu --- .bcr/presubmit.yml | 2 ++ apt/extensions.bzl | 2 +- apt/private/deb_import.bzl | 2 +- apt/tests/deb_postfix_test.bzl | 1 - apt/tests/dpkg_status_test.bzl | 1 - apt/tests/dpkg_statusd_test.bzl | 1 - distroless/tests/flatten_test.bzl | 1 - distroless/tests/locale_test.bzl | 1 - e2e/smoke/BUILD | 14 +++++++++++++- 9 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 17ad62cc..3e1ffb4e 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -8,5 +8,7 @@ bcr_test_module: name: "Run test module" bazel: ${{ bazel }} platform: ${{ platform }} + test_flags: + - "--test_tag_filters=-requires-docker" test_targets: - "//..." diff --git a/apt/extensions.bzl b/apt/extensions.bzl index 5969d271..835beb20 100644 --- a/apt/extensions.bzl +++ b/apt/extensions.bzl @@ -427,7 +427,7 @@ def _distroless_extension(mctx): ) # Key every package by the architecture we are resolving for, not by the - # package's own `Architecture` field. + # package's own `Architecture` field. # For arch-specific packages these are the same. # For `Architecture: all` packages this "expands" them into one entry per target architecture, # so each carries its own arch-specific dependency closure instead of a single frozen one shared across arches. diff --git a/apt/private/deb_import.bzl b/apt/private/deb_import.bzl index d83dca18..a476672e 100644 --- a/apt/private/deb_import.bzl +++ b/apt/private/deb_import.bzl @@ -1,7 +1,7 @@ "deb_import" -load(":lockfile.bzl", "lockfile") load(":linker_script.bzl", "linker_script") +load(":lockfile.bzl", "lockfile") load(":pkgconfig.bzl", "pkgconfig") load(":util.bzl", "util") diff --git a/apt/tests/deb_postfix_test.bzl b/apt/tests/deb_postfix_test.bzl index 45f06e90..0c373f61 100644 --- a/apt/tests/deb_postfix_test.bzl +++ b/apt/tests/deb_postfix_test.bzl @@ -5,7 +5,6 @@ load("//distroless/tests:asserts.bzl", "assert_tar_listing") _TEST_SUITE_PREFIX = "deb_postfix/" - def deb_postfix_tests(): native.genrule( name = "_deb_postfix_mergedusr_data", diff --git a/apt/tests/dpkg_status_test.bzl b/apt/tests/dpkg_status_test.bzl index be6c00f6..391bb631 100644 --- a/apt/tests/dpkg_status_test.bzl +++ b/apt/tests/dpkg_status_test.bzl @@ -5,7 +5,6 @@ load("//distroless/tests:asserts.bzl", "assert_tar_listing") _TEST_SUITE_PREFIX = "dpkg_status/" - def dpkg_status_tests(): # Test with single control archive native.genrule( diff --git a/apt/tests/dpkg_statusd_test.bzl b/apt/tests/dpkg_statusd_test.bzl index 33a86685..96085310 100644 --- a/apt/tests/dpkg_statusd_test.bzl +++ b/apt/tests/dpkg_statusd_test.bzl @@ -5,7 +5,6 @@ load("//distroless/tests:asserts.bzl", "assert_tar_listing") _TEST_SUITE_PREFIX = "dpkg_statusd/" - def dpkg_statusd_tests(): # Test basic dpkg_statusd with single package native.genrule( diff --git a/distroless/tests/flatten_test.bzl b/distroless/tests/flatten_test.bzl index 6c1f810b..3ced1170 100644 --- a/distroless/tests/flatten_test.bzl +++ b/distroless/tests/flatten_test.bzl @@ -5,7 +5,6 @@ load("//distroless/tests:asserts.bzl", "assert_tar_listing") _TEST_SUITE_PREFIX = "flatten/" - def flatten_tests(): # Test flattening two simple tar archives native.genrule( diff --git a/distroless/tests/locale_test.bzl b/distroless/tests/locale_test.bzl index cfc699a2..09e2205b 100644 --- a/distroless/tests/locale_test.bzl +++ b/distroless/tests/locale_test.bzl @@ -5,7 +5,6 @@ load("//distroless/tests:asserts.bzl", "assert_tar_listing") _TEST_SUITE_PREFIX = "locale/" - def locale_tests(): # Test basic locale extraction native.genrule( diff --git a/e2e/smoke/BUILD b/e2e/smoke/BUILD index c97b224a..32b9c97c 100644 --- a/e2e/smoke/BUILD +++ b/e2e/smoke/BUILD @@ -1,4 +1,5 @@ load("@bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") +load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@container_structure_test//:defs.bzl", "container_structure_test") load("@rules_distroless//distroless:defs.bzl", "cacerts", "group", "passwd") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") @@ -121,12 +122,23 @@ oci_load( target_compatible_with = COMPATIBLE_WITH, ) +build_test( + name = "smoke_build_test", + targets = [ + ":image_platform", + ":tarball", + ], +) + container_structure_test( - name = "test", + name = "structure_test", configs = select({ "@platforms//cpu:arm64": ["test_linux_arm64.yaml"], "@platforms//cpu:x86_64": ["test_linux_amd64.yaml"], }), image = ":image_platform", + tags = [ + "requires-docker", + ], target_compatible_with = COMPATIBLE_WITH, )