Package local_runner binary and reuse in smoke

This commit is contained in:
andrussal 2025-12-05 14:08:42 +01:00
parent 0c5cfb9cc9
commit 484f3ab646
3 changed files with 44 additions and 15 deletions

View File

@ -63,12 +63,14 @@ jobs:
# Work around flate2 1.1.6 ambiguity issues by pinning to a fixed release.
cargo +nightly-2025-09-14 update -p flate2 --precise 1.1.5
cargo +nightly-2025-09-14 build --features testing --bins
cargo +nightly-2025-09-14 build --features testing --bin local_runner -p runner-examples
- name: Package binaries
run: |
mkdir -p artifacts
cp "${CARGO_TARGET_DIR}/debug/nomos-node" artifacts/
cp "${CARGO_TARGET_DIR}/debug/nomos-executor" artifacts/
cp "${CARGO_TARGET_DIR}/debug/nomos-cli" artifacts/
cp "${CARGO_TARGET_DIR}/debug/local_runner" artifacts/
mkdir -p artifacts/circuits
rsync -a "$NOMOS_CIRCUITS"/ artifacts/circuits/
tar -czf nomos-binaries.tar.gz -C artifacts .

View File

@ -212,6 +212,9 @@ jobs:
echo "Circuits bundle missing in nomos-binaries tarball" >&2
exit 1
fi
if [ -f "${BIN_DIR}/local_runner" ]; then
echo "LOCAL_RUNNER_BIN=${BIN_DIR}/local_runner" >> "$GITHUB_ENV"
fi
- name: Download KZG params for DA (raw)
run: |
mkdir -p "$(dirname "${NOMOS_KZGRS_PARAMS_PATH}")"
@ -226,7 +229,7 @@ jobs:
echo "NOMOS_KZGRS_PARAMS_PATH=${GITHUB_WORKSPACE}/testing-framework/assets/stack/kzgrs_test_params/kzgrs_test_params" >> "$GITHUB_ENV"
- name: Run local runner smoke (ignored test)
run: |
NOMOS_TESTS_KEEP_LOGS=true cargo +nightly-2025-09-14 test -p runner-examples --test local_runner_bin_smoke -- --ignored --nocapture
NOMOS_TESTS_KEEP_LOGS=true LOCAL_DEMO_RUN_SECS=60 cargo +nightly-2025-09-14 test -p runner-examples --test local_runner_bin_smoke -- --ignored --nocapture
- name: Archive local smoke logs
if: always()
run: |

View File

@ -7,16 +7,31 @@ use std::{env, path::Path, process::Command};
#[test]
#[ignore = "runs local_runner binary (~2min) and requires local assets/binaries"]
fn local_runner_bin_smoke() {
let output = Command::new("cargo")
.args([
"run",
"-p",
"runner-examples",
"--bin",
"local_runner",
"--",
"--nocapture",
])
// Prefer a prebuilt local_runner binary (if provided), otherwise fall back to
// cargo run.
let runner_bin = env::var("LOCAL_RUNNER_BIN").ok();
let mut cmd = match runner_bin.as_deref() {
Some(path) => {
let mut c = Command::new(path);
c.args(["--nocapture"]);
c
}
None => {
let mut c = Command::new("cargo");
c.args([
"run",
"-p",
"runner-examples",
"--bin",
"local_runner",
"--",
"--nocapture",
]);
c
}
};
let output = cmd
.env("POL_PROOF_DEV_MODE", "true")
.env(
"NOMOS_CIRCUITS",
@ -31,12 +46,21 @@ fn local_runner_bin_smoke() {
})
.expect("NOMOS_CIRCUITS must be set or .tmp/nomos-circuits must exist"),
)
.env("LOCAL_DEMO_RUN_SECS", "120")
.env("LOCAL_DEMO_VALIDATORS", "1")
.env("LOCAL_DEMO_EXECUTORS", "1")
.env(
"LOCAL_DEMO_RUN_SECS",
env::var("LOCAL_DEMO_RUN_SECS").unwrap_or_else(|_| "120".into()),
)
.env(
"LOCAL_DEMO_VALIDATORS",
env::var("LOCAL_DEMO_VALIDATORS").unwrap_or_else(|_| "1".into()),
)
.env(
"LOCAL_DEMO_EXECUTORS",
env::var("LOCAL_DEMO_EXECUTORS").unwrap_or_else(|_| "1".into()),
)
.env("RUST_BACKTRACE", "1")
.output()
.expect("failed to spawn cargo run");
.expect("failed to spawn local runner");
if !output.status.success() {
panic!(