Skip to content

Commit 560cb3d

Browse files
committed
fix(sync): fail interop suite on broken Origin build, not skip
ensure-origin.sh previously exited 0 (skip) whenever the Origin build failed or produced no binary, even when Origin source was present locally. That masked real cross-repo regressions behind a green nextest run. Skipping now only applies when Origin source isn't available at all; a present-but-broken Origin build fails the suite.
1 parent 1a82543 commit 560cb3d

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

scripts/ensure-origin.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
# resolves from (`cargo metadata`) and derive the Origin workspace root from its
1212
# manifest path — a single source of truth, no duplicated path literal.
1313
#
14-
# Idempotent: `cargo build` rebuilds only when sources change. If `nodedb-types`
15-
# resolves from the registry instead of a local path (i.e. nobody has the Origin
16-
# source), we exit 0 WITHOUT exporting NODEDB_BIN, so the interop tests skip
17-
# rather than fail — a Lite-only checkout still passes `cargo nextest run`.
14+
# Idempotent: `cargo build` rebuilds only when sources change.
15+
#
16+
# Skip vs fail — the distinction is deliberate:
17+
# - If the Origin source is NOT available locally (`nodedb-types` resolves from
18+
# the registry, or the workspace can't be located) we exit 0 WITHOUT
19+
# exporting NODEDB_BIN, so the interop tests skip rather than fail — a
20+
# Lite-only checkout still passes `cargo nextest run`.
21+
# - If the Origin source IS available but its build fails (or produces no
22+
# binary), we exit NON-ZERO so nextest fails the run. A broken Origin build
23+
# must surface loudly; silently skipping every interop test while the suite
24+
# reports green would hide exactly the cross-repo regressions these tests exist
25+
# to catch.
1826
#
1927
# nextest runs this from the workspace root and reads exported env vars from the
2028
# file named by $NEXTEST_ENV.
@@ -52,16 +60,20 @@ if [ -z "$origin_root" ] || [ ! -f "$origin_root/Cargo.toml" ] || [ ! -f "$origi
5260
exit 0
5361
fi
5462

63+
# Past this point the Origin source IS present locally. A build failure or a
64+
# missing binary is now a REAL error, not a "no Origin available" skip — failing
65+
# here loudly is the whole point: a broken Origin build must fail the interop
66+
# suite rather than silently skip every test while the run still reports green.
5567
echo "ensure-origin: building Origin binary (cargo build -p nodedb in $origin_root) ..." >&2
5668
if ! cargo build --manifest-path "$origin_root/Cargo.toml" -p nodedb --bin nodedb >&2; then
57-
echo "ensure-origin: Origin build failed; interop tests will skip" >&2
58-
exit 0
69+
echo "ensure-origin: Origin build FAILED; failing the interop suite (Origin source is present, so this is a real error, not a skip)" >&2
70+
exit 1
5971
fi
6072

6173
bin="$origin_root/target/debug/nodedb"
6274
if [ ! -x "$bin" ]; then
63-
echo "ensure-origin: built binary not found at $bin; interop tests will skip" >&2
64-
exit 0
75+
echo "ensure-origin: Origin build reported success but binary not found at $bin; failing the interop suite" >&2
76+
exit 1
6577
fi
6678

6779
echo "NODEDB_BIN=$bin" >> "$NEXTEST_ENV"

0 commit comments

Comments
 (0)