Skip to content

Commit 2476009

Browse files
bchalioszulinx86
authored andcommitted
fix(test): do not use build step for optional pipeline
Optional pipeline started failing during a build failure in the rust benchmarks tests. During the build step, we build REVISION_A (main) and REVISION_B (tip of the PR commit) and pass it over to the subsequent pipeline steps that run the test. However, 'test_benchmarks.py' needs to build the benchmarks, running `cargo bench`. That step started failing when building 'aws-lc-rs-sys' because CMake is complaining that its CMakeCache.txt file is not in the same path as the one initially created. Since we anyway run `cargo bench` in the test there's not really need to pre-build firecracker. So, modify the buildkite pipeline logic to allow defining pipelines without the build step, and change the pipeline_pr_no_block.py to not use it. Signed-off-by: Babis Chalios <[email protected]>
1 parent e03f723 commit 2476009

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.buildkite/common.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class BKPipeline:
229229

230230
parser = COMMON_PARSER
231231

232-
def __init__(self, initial_steps=None, **kwargs):
232+
def __init__(self, initial_steps=None, with_build_step=True, **kwargs):
233233
self.steps = []
234234
self.args = args = self.parser.parse_args()
235235
# Retry one time if agent was lost. This can happen if we terminate the
@@ -252,9 +252,12 @@ def __init__(self, initial_steps=None, **kwargs):
252252
self.per_arch["platforms"] = [("al2", "linux_5.10")]
253253
self.binary_dir = args.binary_dir
254254
# Build sharing
255-
build_cmds, self.shared_build = shared_build()
256-
step_build = group("🏗️ Build", build_cmds, **self.per_arch)
257-
self.steps += [step_build, "wait"]
255+
if with_build_step:
256+
build_cmds, self.shared_build = shared_build()
257+
step_build = group("🏗️ Build", build_cmds, **self.per_arch)
258+
self.steps += [step_build, "wait"]
259+
else:
260+
self.shared_build = None
258261

259262
# If we run initial_steps before the "wait" step above, then a failure of the initial steps
260263
# would result in the build not progressing past the "wait" step (as buildkite only proceeds past a wait step
@@ -284,10 +287,12 @@ def add_step(self, step, decorate=True):
284287

285288
def _adapt_group(self, group):
286289
""""""
287-
prepend = [
288-
f'buildkite-agent artifact download "{self.shared_build}" .',
289-
f"tar xzf {self.shared_build}",
290-
]
290+
prepend = []
291+
if self.shared_build is not None:
292+
prepend = [
293+
f'buildkite-agent artifact download "{self.shared_build}" .',
294+
f"tar xzf {self.shared_build}",
295+
]
291296
if self.binary_dir is not None:
292297
prepend.extend(
293298
[
@@ -327,7 +332,9 @@ def to_json(self):
327332
def devtool_test(self, devtool_opts=None, pytest_opts=None):
328333
"""Generate a `devtool test` command"""
329334
cmds = []
330-
parts = ["./tools/devtool -y test", "--no-build"]
335+
parts = ["./tools/devtool -y test"]
336+
if self.shared_build is not None:
337+
parts.append("--no-build")
331338
if devtool_opts:
332339
parts.append(devtool_opts)
333340
parts.append("--")

.buildkite/pipeline_pr_no_block.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
DEFAULT_PRIORITY = 1
1212

1313
pipeline = BKPipeline(
14+
with_build_step=False,
1415
timeout_in_minutes=45,
1516
# some non-blocking tests are performance, so make sure they get ag=1 instances
1617
priority=DEFAULT_PRIORITY + 1,

0 commit comments

Comments
 (0)