allow tests to define if_changed and crate_path

We now check whether the test defines if_changed and crate_path before
using the ones from the workspace. If the tests does define these two,
then we don't overwrite them with the default workspace configuration.

This is needed so that custom pipelines for tests can specify as if
changed the crate that they're intended to. Without this change we
end up running the custom tests for all crates that are changed instead
of running it just for the crate that they're intended.

Signed-off-by: Andreea Florescu <andreea.florescu15@gmail.com>
This commit is contained in:
Andreea Florescu
2026-07-09 10:06:55 +02:00
committed by Manos Pitsidianakis
parent 84550804a4
commit bfca469deb

View File

@@ -356,7 +356,13 @@ class BuildkiteConfig:
step_input = copy.deepcopy(test)
step_input["platform"] = platform
step_input["crate"] = crate
step_input["crate_path"] = crate_path
# We always allow the test description to overwrite global configurations.
# To do so, we first check if the test definition has a `crate_path`, if yes, we use that. Otherwise, we
# use the passed parameter `crate_path`. This also applies to "if_changed".
crate_path = test.get("crate_path", crate_path)
if crate_path is not None:
step_input["crate_path"] = crate_path
if_changed = test.get("if_changed", if_changed)
if if_changed is not None:
step_input["if_changed"] = if_changed
if not step_input.get("hypervisor"):