Commit graph

67 commits

Author SHA1 Message Date
Arlo Siemsen 24bf873c83 Fix cargo install --index when used with registry.default 2022-11-15 11:28:29 -06:00
Arlo Siemsen 49fb8f3d88 Fix publishing with a dependency on a sparse registry 2022-10-20 17:21:32 -05:00
Arlo Siemsen dd5134c7a5 Implement RFC 3289: source replacement ambiguity 2022-10-07 22:30:59 -05:00
Arlo Siemsen 931d8cbf99 Fix sparse registry lockfile urls containing 'registry+sparse+' 2022-10-05 11:08:00 -05:00
Scott Schafer ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Arlo Siemsen 24dac452c5 Improve testing framework for http registries
Improve integration of the http server introduced by the http-registry feature.
Now the same HTTP server is used for serving downloads, the index, and
the API.

This makes it easier to write tests that deal with authentication and
http registries.
2022-06-10 16:51:35 -05:00
Ed Page 2313edd4b2 fix(yank): Use '--version' like install
During the design conversations on cargo-add, we noticed that
`cargo-install` has a public flag `--version` and an invisible alias
`--vers` while `cargo-yank` has a public flag `--vers`.  This switches
`cargo-yank` to publicly use `--version` and have an invisible alias
`--vers`, making them consistent.

Completions are a best guess.
2022-04-19 16:45:13 -05:00
flip1995 390af27128
Add rust_metadata to SerializedPackage
After the rust_version field was stabilized in #9732 this adds the
rust_version as output to the `cargo metadata` command, so tools like
Clippy can read and use it as well.
2021-10-12 14:07:19 +02:00
Weihang Lo 8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
hi-rustin f9a5625733 add default_run to SerializedPackage
Delete "default_run": null,
2021-06-07 14:59:57 +08:00
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
roblabla 72694e8015 Fix tests 2020-10-01 09:40:32 +00:00
Eric Huss 6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Mikastiv 51fa3a4d28 --vers arg now required for yank cmd 2020-09-12 17:13:13 -04:00
Arlo Siemsen 58869e5ce6 Stop ignoring Array ordering Json comparison tests. Update tests to have sorted order. 2020-07-15 16:32:19 -07:00
Brian Chin 866d4316e1 Add support for workspace.metadata table 2020-06-05 09:32:54 -07:00
Eric Huss ff9126d0d2 Provide some error context for bad registries.foo.index URL. 2020-05-25 11:17:28 -07:00
Eric Huss b4c374039f Do not implicitly load registry.token with --index.
The intent is to avoid leaking the crates.io token to other servers.
2020-04-19 09:20:54 -07:00
Eric Huss 2599071110 Don't allow both --index and --registry to be specified at the same time.
Otherwise --index was being silently ignored.
2020-04-19 09:20:54 -07:00
Eric Huss 9d00f9f07f Make setting registry.index a hard error.
This has been deprecated for 4 years. This helps simplify this code.
2020-04-19 09:20:54 -07:00
Eric Huss 4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss 944f5049f1 Re-implement proc-macro feature decoupling. 2020-03-22 15:08:02 -07:00
Eric Huss 5a1862cd36 Add proc-macro to the index. 2020-03-15 10:10:25 -07:00
Eric Huss 95008f91e5 Try to better handle restricted crate names. 2020-03-02 16:04:24 -08:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Alex Crichton ebd10526f3 Run rustfmt 2019-09-16 12:00:12 -07: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
Steven Fackler 7d41d454d8 Include the publish field in cargo-metadata output 2019-09-11 14:46:12 -04:00
Jeremy Stucki 930134c75b
Rename to_url -> into_url 2019-06-20 16:53:24 +02:00
Eric Huss 34307c6122 Stabilize publish-lockfile. 2019-06-10 13:19:18 -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
k-nasa 63a9c7aa6d $cargo fmt --all 2019-05-02 06:39:15 +09:00
Alex Helfet 987f19d2ea Forbid relative path in registry index (relative URL only), update tests. 2019-04-29 18:39:21 +01:00
Alex Helfet 0dda8f5f72 Added a few tests for relative registry index URLs, fixed a bug. 2019-04-28 00:01:43 +01:00
Alex Helfet d9bc8c0dc5 Validate registry token before operations that require it. 2019-04-15 19:00:42 +01:00
Alex Crichton f16efff150 Run cargo fmt 2019-04-10 10:42:07 -07:00
Eric Huss b666a9faa3 cargo install: Be more restrictive about cli flags. 2019-03-31 12:38:16 -07:00
Eric Huss 737382d7e1 Stabilize Alternative Registries 2019-02-11 15:16:13 -08:00
nasa db09895f3c $cargo fmt --all 2019-01-27 22:39:49 +09:00
Eric Huss b5144c7f83 Add test for publish with [patch] + cleanup. 2019-01-11 19:14:58 -08:00
Eric Huss 0a4cfa630f publish: rework the crates.io detection logic.
The old code used an unreliable method to detect if `cargo publish` was publishing to crates.io. This should work even if the `--index` flag is used.

Also includes a very minor rewording of an error message mentioning crates.io, even for alternative registries.
2019-01-05 10:56:49 -08:00
Eric Huss 64042d845d Fix registry-index bug. 2018-12-30 16:07:58 -08:00
Eric Huss 3d84d0ad77 Add dependency registry to cargo metadata.
This adds the `registry` field for dependencies for alternate registries in
`cargo metadata`.
2018-12-29 21:14:25 -08:00
Eric Huss f58d107e7c testsuite: Require failing commands to check output. 2018-12-28 17:59:36 -08:00
Eric Huss 70f84bf3b0 Rewrite login and registry cleanups. 2018-12-20 04:34:35 -08:00
Eric Huss 080f0b34c4 Restrict registry names to same style as package names. 2018-12-19 20:36:13 -08:00
Eric Huss 7eaa1cf70a Support alt-registry names in [patch] table. 2018-12-17 20:50:42 -08:00
Alex Crichton fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
Dale Wijnand 04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
Steven Fackler 6e90641759 Allow usernames in alt registry URLs
We want to forbid secrets since they'll commonly end up checked into
source control, but usernames are fine (and are commonly going to be
`git`).

Closes #6241
2018-10-30 18:01:44 -07:00