Commit graph

18 commits

Author SHA1 Message Date
Eric Huss 340656e29d Add RegistryBuilder to help initializing test registries.
The intent here is to make it more flexible to create different registry
setups, and to reuse code a little more easily.
2021-02-02 15:48:48 -08:00
Eric Huss 6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
bishtpawan 3952fdb223 Refactor code and resolve PR comments 2020-08-05 17:46:33 +05:30
bishtpawan dd654d5576 Add pattern match for yank check and updated corresponding test cases 2020-08-05 17:31:56 +05:30
Daniel Wagner-Hall 556c236f9a Bump to semver 0.10 for VersionReq::is_exact
This stops using `to_string` as a proxy for this now-provided precise API.

This reverts commit b71927224f and bupms the
dependency version in Cargo.toml.
2020-05-25 11:11:45 +01:00
Daniel Wagner-Hall b71927224f Switch to using existing is_locked implementation
semver hasn't merged the upstream PR (yet)
2020-05-20 20:38:23 +01:00
Daniel Wagner-Hall 1e2c233116 Fix up updating logic for multiple installs 2020-03-21 00:47:08 +00:00
Daniel Wagner-Hall 137e518d98 Explicitly check whether installed first instead 2020-03-21 00:04:17 +00:00
Daniel Wagner-Hall a721e62781 Try installing exact versions before updating
When an exact version is being installed, if we already have that
version from the index, we don't need to update the index before
installing it. Don't do this if it's not an exact version, because the
update may find us a newer version.

This is particularly useful for scripts which unconditionally run
`cargo install some-crate --version=1.2.3`. Before install-update, I
wrote a crate to do this
(https://crates.io/crates/cargo-ensure-installed) which I'm trying to
replace with just `cargo install`, but the extra latency of updating the
index for a no-op is noticeable.

This introduces an interesting edge-case around yanked crates; the
yanked-ness of crates will no longer change on install for exact version
matches which were already downloaded. This feels niche enough to
hopefully not matter...
2020-03-20 14:36:23 +00:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss f7b29716ed Stabilize install-upgrade. 2019-11-11 14:47:48 -08:00
Alex Crichton 9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
bors f42275c30e Auto merge of #7246 - ehuss:install-remove-orphan, r=alexcrichton
`cargo install`: Remove orphaned executables.

When a new version of a package is installed that no longer contains an executable from a previous version, this change causes those orphaned executables to also be removed.

I can place this new behavior behind the `install-upgrade` feature gate if anyone is uncomfortable with changing the behavior now.

cc #6797
2019-08-19 16:03:35 +00:00
Eric Huss 3c20a24335 Clean up some git test support functions. 2019-08-12 22:25:36 -07:00
Eric Huss 5a59b80966 cargo install: Remove orphaned executables. 2019-08-12 21:44:14 -07:00
Jethro Beekman 0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Eric Huss 9ecdfe0475 install-upgrade: Fix bugs, more comments, review updates. 2019-04-03 18:05:55 -07:00
Eric Huss e023a6672b Add install-upgrade. 2019-04-02 08:40:34 -07:00