From 0da6997cccf5895ed5406f65946d3662b8c337d5 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 26 May 2023 12:56:22 -0500 Subject: [PATCH] test(add): Remove expensive test This is a carry-over from cargo-edit where we had to worry about the UX of all of the behavior while now we are just relying on built-in cargo behavior and don't need to test it specifically for `cargo add`. On my machine, this test takes 11s. --- .../cargo_add/invalid_git_external/in | 1 - .../cargo_add/invalid_git_external/mod.rs | 28 ------------------- .../invalid_git_external/out/Cargo.toml | 5 ---- .../cargo_add/invalid_git_external/stderr.log | 12 -------- .../cargo_add/invalid_git_external/stdout.log | 0 tests/testsuite/cargo_add/mod.rs | 1 - 6 files changed, 47 deletions(-) delete mode 120000 tests/testsuite/cargo_add/invalid_git_external/in delete mode 100644 tests/testsuite/cargo_add/invalid_git_external/mod.rs delete mode 100644 tests/testsuite/cargo_add/invalid_git_external/out/Cargo.toml delete mode 100644 tests/testsuite/cargo_add/invalid_git_external/stderr.log delete mode 100644 tests/testsuite/cargo_add/invalid_git_external/stdout.log diff --git a/tests/testsuite/cargo_add/invalid_git_external/in b/tests/testsuite/cargo_add/invalid_git_external/in deleted file mode 120000 index 6c6a27fcfb5..00000000000 --- a/tests/testsuite/cargo_add/invalid_git_external/in +++ /dev/null @@ -1 +0,0 @@ -../add-basic.in \ No newline at end of file diff --git a/tests/testsuite/cargo_add/invalid_git_external/mod.rs b/tests/testsuite/cargo_add/invalid_git_external/mod.rs deleted file mode 100644 index 8234df53a19..00000000000 --- a/tests/testsuite/cargo_add/invalid_git_external/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -use cargo_test_support::compare::assert_ui; -use cargo_test_support::prelude::*; -use cargo_test_support::Project; - -use cargo_test_support::curr_dir; - -#[cargo_test] -fn case() { - cargo_test_support::registry::init(); - - let project = Project::from_template(curr_dir!().join("in")); - let project_root = project.root(); - let cwd = &project_root; - let git_url = url::Url::from_directory_path(cwd.join("does-not-exist")) - .unwrap() - .to_string(); - - snapbox::cmd::Command::cargo_ui() - .arg("add") - .args(["fake-git", "--git", &git_url]) - .current_dir(cwd) - .assert() - .code(101) - .stdout_matches_path(curr_dir!().join("stdout.log")) - .stderr_matches_path(curr_dir!().join("stderr.log")); - - assert_ui().subset_matches(curr_dir!().join("out"), &project_root); -} diff --git a/tests/testsuite/cargo_add/invalid_git_external/out/Cargo.toml b/tests/testsuite/cargo_add/invalid_git_external/out/Cargo.toml deleted file mode 100644 index 3ecdb668167..00000000000 --- a/tests/testsuite/cargo_add/invalid_git_external/out/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -[workspace] - -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/tests/testsuite/cargo_add/invalid_git_external/stderr.log b/tests/testsuite/cargo_add/invalid_git_external/stderr.log deleted file mode 100644 index 18656300b63..00000000000 --- a/tests/testsuite/cargo_add/invalid_git_external/stderr.log +++ /dev/null @@ -1,12 +0,0 @@ - Updating git repository `[ROOTURL]/case/does-not-exist/` -... -error: failed to load source for dependency `fake-git` - -Caused by: - Unable to update [ROOTURL]/case/does-not-exist/ - -Caused by: - failed to clone into: [ROOT]/home/.cargo/git/db/does-not-exist-[..] - -Caused by: -... diff --git a/tests/testsuite/cargo_add/invalid_git_external/stdout.log b/tests/testsuite/cargo_add/invalid_git_external/stdout.log deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index 832397287c4..d62964e8805 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -36,7 +36,6 @@ mod git_rev; mod git_tag; mod infer_prerelease; mod invalid_arg; -mod invalid_git_external; mod invalid_git_name; mod invalid_key_inherit_dependency; mod invalid_key_overwrite_inherit_dependency;