|
11 | 11 | # resolves from (`cargo metadata`) and derive the Origin workspace root from its |
12 | 12 | # manifest path — a single source of truth, no duplicated path literal. |
13 | 13 | # |
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. |
18 | 26 | # |
19 | 27 | # nextest runs this from the workspace root and reads exported env vars from the |
20 | 28 | # file named by $NEXTEST_ENV. |
@@ -52,16 +60,20 @@ if [ -z "$origin_root" ] || [ ! -f "$origin_root/Cargo.toml" ] || [ ! -f "$origi |
52 | 60 | exit 0 |
53 | 61 | fi |
54 | 62 |
|
| 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. |
55 | 67 | echo "ensure-origin: building Origin binary (cargo build -p nodedb in $origin_root) ..." >&2 |
56 | 68 | 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 |
59 | 71 | fi |
60 | 72 |
|
61 | 73 | bin="$origin_root/target/debug/nodedb" |
62 | 74 | 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 |
65 | 77 | fi |
66 | 78 |
|
67 | 79 | echo "NODEDB_BIN=$bin" >> "$NEXTEST_ENV" |
|
0 commit comments