test(cli): relocate the _open example twins to tests/fixtures (refs #248)
The four _open blueprints leave the user-facing gallery (crates/aura-cli/examples/) and become test fixtures; the closed twins are now the only example corpus (bound params are overridable defaults since #246, so the closed files serve both run and sweep). Compile-time embeds follow the move: the emit_* generators and the shipped_*_serialize byte-pins target tests/fixtures/ (the open fixtures stay builder-generated and byte-pinned — regenerating after the move left the tree clean), load_open_r_sma and the axis-probe read the fixture, and the walk-forward refit test plus the `aura graph` default sample switch to the closed r_sma.json. graph_construct's open-fixture tests swap example() -> fixture(), their names dropping the now-false "shipped example" claim; a new e2e test pins the relocation property (all four fixtures load and introspect, the gallery holds exactly the four closed examples). Intermediate state: cli_run.rs / research_docs.rs / project_load.rs still reference the old example paths and fail at runtime until the follow-up migration commit (MIGRATE sites move to the closed twins, NEEDS-OPEN sites to the fixtures). Verification: cargo build --workspace; cargo test -p aura-cli --bin aura; cargo test -p aura-cli --test graph_construct; the three ignored emit generators re-run byte-stable.
This commit is contained in:
@@ -471,7 +471,7 @@ fn graph_register_is_idempotent() {
|
||||
fn graph_params_lists_raw_axis_namespace() {
|
||||
let dir = temp_cwd("params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_sma_open.json")]);
|
||||
run_in(&dir, &["graph", "introspect", "--params", &fixture("r_sma_open.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(stdout, "fast.length:I64\nslow.length:I64\n", "the raw open params, in order");
|
||||
}
|
||||
@@ -512,7 +512,7 @@ fn graph_introspect_mode_guard_still_exits_two_on_zero_or_two_modes() {
|
||||
#[test]
|
||||
fn graph_params_by_content_id_matches_params_by_file() {
|
||||
let dir = temp_cwd("params-by-id");
|
||||
let bp = example("r_sma_open.json");
|
||||
let bp = fixture("r_sma_open.json");
|
||||
let (reg_out, reg_err, reg_code) = run_in(&dir, &["graph", "register", &bp]);
|
||||
assert_eq!(reg_code, Some(0), "register: {reg_out} {reg_err}");
|
||||
let id = registered_id(®_out);
|
||||
@@ -533,7 +533,7 @@ fn graph_params_by_content_id_matches_params_by_file() {
|
||||
#[test]
|
||||
fn graph_params_tolerates_content_prefix_on_target() {
|
||||
let dir = temp_cwd("params-content-prefix");
|
||||
let bp = example("r_sma_open.json");
|
||||
let bp = fixture("r_sma_open.json");
|
||||
let (reg_out, reg_err, reg_code) = run_in(&dir, &["graph", "register", &bp]);
|
||||
assert_eq!(reg_code, Some(0), "register: {reg_out} {reg_err}");
|
||||
let id = registered_id(®_out);
|
||||
@@ -744,7 +744,7 @@ fn shipped_r_sma_example_is_genuinely_closed() {
|
||||
assert_eq!(stdout, "", "the closed example must leave zero params unbound");
|
||||
}
|
||||
|
||||
/// Property (#159): the shipped open example (`examples/r_sma_open.json`) is a
|
||||
/// Property (#159): the open fixture (`tests/fixtures/r_sma_open.json`) is a
|
||||
/// usable sweep-axis template from its public gallery location, not just a
|
||||
/// byte-identical artifact — `graph introspect --params` lists exactly the two
|
||||
/// unbound SMA lengths, in lowering order, matching the raw axis namespace the
|
||||
@@ -753,10 +753,10 @@ fn shipped_r_sma_example_is_genuinely_closed() {
|
||||
/// shipped copy is actually introspectable/bindable from where a consumer runs
|
||||
/// it.
|
||||
#[test]
|
||||
fn shipped_r_sma_open_example_lists_its_axis_namespace() {
|
||||
fn open_r_sma_fixture_lists_its_axis_namespace() {
|
||||
let dir = temp_cwd("example-open-params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_sma_open.json")]);
|
||||
run_in(&dir, &["graph", "introspect", "--params", &fixture("r_sma_open.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(
|
||||
stdout, "fast.length:I64\nslow.length:I64\n",
|
||||
@@ -764,6 +764,31 @@ fn shipped_r_sma_open_example_lists_its_axis_namespace() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Property (#248): the four `_open` blueprint twins were RELOCATED out of the
|
||||
/// public gallery, not deleted — each stem is present under `tests/fixtures/`
|
||||
/// (the internal sweep-axis fixture location) and absent from `examples/` (the
|
||||
/// public, user-facing gallery). This is the acceptance criterion's core claim
|
||||
/// ("`examples/` ships no `_open` variants") stated as a filesystem fact, so a
|
||||
/// future example addition that reintroduces a twin — or a migration that moves
|
||||
/// the reference but forgets the file — fails here even though every
|
||||
/// `include_str!`/path-string call site already resolves.
|
||||
#[test]
|
||||
fn open_twins_are_relocated_from_examples_to_fixtures_not_deleted() {
|
||||
let manifest_dir = env!("CARGO_MANIFEST_DIR");
|
||||
for stem in ["r_sma", "r_breakout", "r_meanrev", "r_channel"] {
|
||||
let gallery_path = format!("{manifest_dir}/examples/{stem}_open.json");
|
||||
assert!(
|
||||
!std::path::Path::new(&gallery_path).exists(),
|
||||
"{stem}_open.json must not ship in the public examples/ gallery (#248)"
|
||||
);
|
||||
let fixture_path = format!("{manifest_dir}/tests/fixtures/{stem}_open.json");
|
||||
assert!(
|
||||
std::path::Path::new(&fixture_path).exists(),
|
||||
"{stem}_open.json must survive relocated under tests/fixtures/ (#248)"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Property (#159 cut 2): the shipped closed example (`examples/r_breakout.json`) is
|
||||
/// genuinely closed — `graph introspect --params` reports zero unbound params.
|
||||
#[test]
|
||||
@@ -775,14 +800,14 @@ fn shipped_r_breakout_example_is_genuinely_closed() {
|
||||
assert_eq!(stdout, "", "the closed example must leave zero params unbound");
|
||||
}
|
||||
|
||||
/// Property (#159 cut 2): the shipped open example (`examples/r_breakout_open.json`)
|
||||
/// Property (#159 cut 2): the open fixture (`tests/fixtures/r_breakout_open.json`)
|
||||
/// lists its ONE ganged channel axis (#61: the two rolling windows are structurally
|
||||
/// one knob).
|
||||
#[test]
|
||||
fn shipped_r_breakout_open_example_lists_its_axis_namespace() {
|
||||
fn open_r_breakout_fixture_lists_its_axis_namespace() {
|
||||
let dir = temp_cwd("r-breakout-example-open-params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_breakout_open.json")]);
|
||||
run_in(&dir, &["graph", "introspect", "--params", &fixture("r_breakout_open.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(
|
||||
stdout, "channel_length:I64\n",
|
||||
@@ -805,7 +830,7 @@ fn shipped_r_breakout_open_example_lists_its_axis_namespace() {
|
||||
/// member) would be caught here even if the internal builder-level
|
||||
/// equivalence still holds.
|
||||
#[test]
|
||||
fn shipped_r_breakout_open_gang_axis_matches_the_closed_example() {
|
||||
fn open_r_breakout_fixture_gang_axis_matches_the_closed_example() {
|
||||
let closed_dir = temp_cwd("r-breakout-gang-axis-closed");
|
||||
let (closed_stdout, closed_stderr, closed_code) = run_in(&closed_dir, &["run", &example("r_breakout.json")]);
|
||||
assert_eq!(closed_code, Some(0), "closed run stderr: {closed_stderr}");
|
||||
@@ -815,7 +840,7 @@ fn shipped_r_breakout_open_gang_axis_matches_the_closed_example() {
|
||||
let sweep_dir = temp_cwd("r-breakout-gang-axis-sweep");
|
||||
let (sweep_stdout, sweep_stderr, sweep_code) = run_in(
|
||||
&sweep_dir,
|
||||
&["sweep", &example("r_breakout_open.json"), "--axis", "r_breakout_signal.channel_length=3"],
|
||||
&["sweep", &fixture("r_breakout_open.json"), "--axis", "r_breakout_signal.channel_length=3"],
|
||||
);
|
||||
assert_eq!(sweep_code, Some(0), "sweep stderr: {sweep_stderr}");
|
||||
let lines: Vec<&str> = sweep_stdout.lines().collect();
|
||||
@@ -840,13 +865,13 @@ fn shipped_r_meanrev_example_is_genuinely_closed() {
|
||||
assert_eq!(stdout, "", "the closed example must leave zero params unbound");
|
||||
}
|
||||
|
||||
/// Property (#159 cut 3): the shipped open example (`examples/r_meanrev_open.json`)
|
||||
/// Property (#159 cut 3): the open fixture (`tests/fixtures/r_meanrev_open.json`)
|
||||
/// lists its raw axis namespace, in lowering (node-add) order.
|
||||
#[test]
|
||||
fn shipped_r_meanrev_open_example_lists_its_axis_namespace() {
|
||||
fn open_r_meanrev_fixture_lists_its_axis_namespace() {
|
||||
let dir = temp_cwd("r-meanrev-example-open-params");
|
||||
let (stdout, stderr, code) =
|
||||
run_in(&dir, &["graph", "introspect", "--params", &example("r_meanrev_open.json")]);
|
||||
run_in(&dir, &["graph", "introspect", "--params", &fixture("r_meanrev_open.json")]);
|
||||
assert_eq!(code, Some(0), "stdout: {stdout} stderr: {stderr}");
|
||||
assert_eq!(
|
||||
stdout, "window:I64\nband.factor:F64\n",
|
||||
@@ -863,7 +888,7 @@ fn shipped_r_meanrev_open_example_lists_its_axis_namespace() {
|
||||
/// param positions could silently mis-bind the co-present un-ganged axis
|
||||
/// instead (or vice-versa) even though each axis alone still resolves.
|
||||
#[test]
|
||||
fn shipped_r_meanrev_open_gang_plus_plain_axis_matches_the_closed_example() {
|
||||
fn open_r_meanrev_fixture_gang_plus_plain_axis_matches_the_closed_example() {
|
||||
let closed_dir = temp_cwd("r-meanrev-gang-axis-closed");
|
||||
let (closed_stdout, closed_stderr, closed_code) = run_in(&closed_dir, &["run", &example("r_meanrev.json")]);
|
||||
assert_eq!(closed_code, Some(0), "closed run stderr: {closed_stderr}");
|
||||
@@ -874,7 +899,7 @@ fn shipped_r_meanrev_open_gang_plus_plain_axis_matches_the_closed_example() {
|
||||
let (sweep_stdout, sweep_stderr, sweep_code) = run_in(
|
||||
&sweep_dir,
|
||||
&[
|
||||
"sweep", &example("r_meanrev_open.json"),
|
||||
"sweep", &fixture("r_meanrev_open.json"),
|
||||
"--axis", "r_meanrev_signal.window=3",
|
||||
"--axis", "r_meanrev_signal.band.factor=2.0",
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user