From f0f92bbfa860d4298d495a761e71fe97e24eef9e Mon Sep 17 00:00:00 2001 From: Transaction Science Date: Thu, 29 Oct 2026 06:07:08 -0400 Subject: [PATCH] wai-rs tests: the quickstart installer installs this crate's version The release job's first check refuses a tag whose installer installs another version, and it runs only on the tag, after the version bump has merged; the 0.4.0 bump missed the installer and the tag's first run stopped there. cli_ops now holds the bump to it: a version bump changes wai/wai-rs, which runs this test (wai-catalogue.yml). Falsified on the build host: it passes at 0.4.0 and fails, naming the line it needs, with the installer at 0.3.0. Co-Authored-By: Claude Opus 5.5 --- wai/wai-rs/tests/cli_ops.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wai/wai-rs/tests/cli_ops.rs b/wai/wai-rs/tests/cli_ops.rs index 343be7e8e..f3e9db6c6 100644 --- a/wai/wai-rs/tests/cli_ops.rs +++ b/wai/wai-rs/tests/cli_ops.rs @@ -3,6 +3,8 @@ //! //! - `wai ops list`, `search`, `schema` and `export` read the catalogue, and the export is //! the committed `wai/catalogue/ops.json` (a drifted copy exits 1); +//! - the quickstart installer (`wai/quickstart/install.sh`) installs this crate's version, as +//! the release job requires of a tag `wai-v`; //! - every operation answers `--help` from its catalogue entry, and its mechanical form //! `wai ` runs it as its CLI spelling does; //! - the exit codes: 1 a check that failed, 2 usage, 3 permission, 4 confirmation required, @@ -75,6 +77,19 @@ fn ops_list_names_every_operation_and_export_is_the_committed_file() { assert!(text(&o).contains("regenerate"), "{}", text(&o)); } +/// The release job's first check (wai-release.yml) refuses a tag whose installer installs +/// another version, after the version bump has merged; this holds the bump to it. +#[test] +fn the_quickstart_installer_installs_this_version() { + let version = env!("CARGO_PKG_VERSION"); + let install = std::fs::read_to_string(wai_dir().join("quickstart/install.sh")).unwrap(); + let line = format!("VERSION=\"${{WAI_VERSION:-{version}}}\""); + assert!( + install.lines().any(|l| l == line), + "wai/quickstart/install.sh does not install {version}, this crate's version: it needs the line {line}" + ); +} + #[test] fn ops_search_and_schema_answer_offline() { let d = scratch("search"); -- 2.54.0 (Apple Git-157)