Skip to content

Commit

Permalink
fix: Exempt local base targets from component tests (#1476)
Browse files Browse the repository at this point in the history
The current state triggers a rebuild of local base images, which are
normally tagged as `manual`.
  • Loading branch information
Bownairo authored Sep 12, 2024
1 parent 1ddd820 commit 52ebccf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ic-os/components/conformance_tests/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
""" Rules for component conformance tests. """

def component_file_references_test(name, component_files, image):
def component_file_references_test(name, component_files, image, tags = None):
"""
Verifies that the `component_files` only reference file paths that are accessible within the provided `image`.
Args:
name: The name of the test rule (must end in _test).
component_files: A list of Labels that reference components.
image: The compressed image where the referenced file paths can be found.
tags: Tags to apply to the generated test target.
"""

deps = [image]
Expand All @@ -25,6 +26,7 @@ def component_file_references_test(name, component_files, image):
",".join(component_paths),
"--image $(location %s)" % image,
],
tags = tags,
)

def _check_unused_components_test_impl(ctx):
Expand Down
2 changes: 2 additions & 0 deletions ic-os/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ def icos_build(
tags = ["manual"],
)

# Inherit tags for this test, to avoid triggering builds for local base images
component_file_references_test(
name = name + "_component_file_references_test",
image = ":partition-root-unsigned.tzst",
component_files = image_deps["component_files"].keys(),
tags = tags,
)

if upgrades:
Expand Down

0 comments on commit 52ebccf

Please sign in to comment.