diff --git a/tests/fixtures/ship/validate_ship_install_failfast.stderr b/tests/fixtures/ship/validate_ship_install_failfast.stderr new file mode 100644 index 0000000..2235aee --- /dev/null +++ b/tests/fixtures/ship/validate_ship_install_failfast.stderr @@ -0,0 +1,16 @@ + INFO cargo_liner::cargo > Installing `abc`... + Updating `dummy-registry` index +error: could not find `abc` in registry `crates-io` with version `*` +Error: + 0: Failed to install or update the configured packages. + 1: Failed to install "abc". + 2: Cargo process finished unsuccessfully: exit status: 101 + +Location: + src/cargo.rs:[..] + +Note: This can happen for many reasons. +Suggestion: Read Cargo's output. + +Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. +Run with RUST_BACKTRACE=full to include source snippets. diff --git a/tests/ship.rs b/tests/ship.rs index 39c677e..fdb81c8 100644 --- a/tests/ship.rs +++ b/tests/ship.rs @@ -1044,3 +1044,22 @@ fn validate_ship_cargotermcolor_supported() { ]); assert_installed("pkg"); } + +#[cargo_test] +fn validate_ship_install_failfast() { + let _reg = init_registry(); + fake_install_self(); + fake_publish("def", "0.0.0"); + write_user_config(&["[packages]", "abc = '*'", "def = '*'"]); + + cargo_liner() + .args(["ship", "--skip-check", "--no-self"]) + .assert() + .failure() + .stdout_eq_("".into_data().raw()) + .stderr_eq_(snapbox::file![ + "fixtures/ship/validate_ship_install_failfast.stderr" + ]); + assert_not_installed("abc"); + assert_not_installed("def"); +}