18157 Commits

Author SHA1 Message Date
Ed Page
fa0e66e738 docs(test): Document git_process 2024-07-22 08:58:52 -05:00
Ed Page
504d377c8e docs(test): Document cargo_process 2024-07-22 08:58:52 -05:00
Ed Page
86945a211e docs(test): Document t! 2024-07-22 08:58:52 -05:00
Ed Page
ca9fc47fe0 docs(test): Add high level example 2024-07-22 08:58:52 -05:00
Ed Page
ad6abb54be docs(test): Verify they work 2024-07-22 08:58:52 -05:00
Ed Page
8e524ae561 docs(test): Link to two different docs builds 2024-07-22 08:58:52 -05:00
Ed Page
83d1c14b4e docs(test): Point to docs, rather than source
I pointed to the nightly docs because I figured that was the most likely
one for users to be looking at.
2024-07-22 08:58:52 -05:00
Ed Page
f05eba0ac5 docs(test): Migrate cargo_test docs from contrib to API reference
This will make them more easily discovered and make it easier to
remember to update them.
2024-07-19 12:04:02 -05:00
Ed Page
ba94d70dd0 docs(contrib): Update functional example 2024-07-19 12:04:02 -05:00
Ed Page
742defba13 docs(contrib): Update functional/ui comparison 2024-07-19 12:04:02 -05:00
bors
4196ea093b Auto merge of #14270 - epage:test-home, r=weihanglo
fix(test): Move 'cargo_home' from 'install' to 'paths'

### What does this PR try to resolve?

This is used outside of `cargo install` contexts and this makes it more
discoverable for those use cases.  That I found places that weren't using `cargo_home` but could helps illustrate the point.

### How should we test and review this PR?

### Additional information
2024-07-19 16:42:55 +00:00
Ed Page
49deefe477 refactor(test): Reuse 'cargo_home' in more cases 2024-07-19 10:54:17 -05:00
Ed Page
b0e515aa61 fix(test): Move 'cargo_home' from 'install' to 'paths'
This is used outside of `cargo install` contexts and this makes it more
discoverable for those use cases.
2024-07-19 10:50:42 -05:00
bors
dad331c5ba Auto merge of #14269 - epage:test-ext, r=ehuss
fix(test)!: Clarify extension trait role with rename

When browsing the docs, I feel like this will make it easier to tell the role of these traits within the API.
Or in other words, I can easily tell that these fill a support role and for what, so I know when I care to look into them.

We use this naming pattern for
`cargo_test_support::paths::CargoPathExt`.
2024-07-19 15:11:26 +00:00
bors
fb9d5584a9 Auto merge of #14268 - epage:test-proc, r=weihanglo
feat(test): Re-export ProcessBuilder

Since its tied heavily into the API, this should make it easier to use and document.
2024-07-19 04:41:37 +00:00
Ed Page
a49921f829 fix(test)!: Clarify extension trait role with rename
When browsing the docs, I feel like this will make it easier to tell the
role of these traits within the API.
Or in other words, I can easily tell that these fill a support role and
for what, so I know when I care to look into them.

We use this naming pattern for
`cargo_test_support::paths::CargoPathExt`.
2024-07-18 20:52:22 -05:00
Ed Page
879bc9e3c3 feat(test): Re-export ProcessBuilder
Since its tied heavily into the API, this should make it easier to use
and document.
2024-07-18 20:51:43 -05:00
bors
f10c069629 Auto merge of #14266 - epage:path2url, r=weihanglo
fix(test): Move path2url to CargoPathExt::to_url

### What does this PR try to resolve?

This is a small step, like #14243, to improve the clarity of `cargo-test-support`s API.

Overall, I'm trying to make it more obvious on https://docs.rs/cargo-test-support/latest/cargo_test_support/ which items to reach for when.  I figured this is one that could be demoted to `paths` When doing so, I noticed `CargoPathExt`. I figured if we had any extension traits for `Path`, then this is a
reasonable one to add.

### How should we test and review this PR?

### Additional information
2024-07-18 20:57:05 +00:00
Ed Page
d17322dccb fix(test): Move path2url to CargoPathExt::to_url
I was considering moving this into `paths` and noticed `CargoPathExt`.
I figured if we had any extension traits for `Path`, then this is a
reasonable one to add.
2024-07-18 15:41:26 -05:00
Ed Page
3a615ca9c8 feat(test): Add CargoPathExt to prelude 2024-07-18 15:22:29 -05:00
Ed Page
5d4ac652f5 feat(test): Offer CargPathExt for PathBuf 2024-07-18 14:51:57 -05:00
bors
61424d6040 Auto merge of #14205 - gmorenz:links_overrides_in_unit, r=weihanglo
Fix passing of links-overrides with target-applies-to-host and an implicit target

### What does this PR try to resolve?

This fixes the link-overrides half of #14195, both the panic, and the fact that the field is being discarded, the latter of which caused the former as discussed in [the issue](https://github.com/rust-lang/cargo/issues/14195#issuecomment-2211481773).

It does so following the blueprint laid out in #13900 - which is also in my opinion the current best summary of the broader context.

### How should we test and review this PR?

For reviewing, comparing to the changes in #13900 might be useful.

### Additional information

I'm pushing a PR for the other half of #14195 simultaneously. I thought it better to keep the PRs small since they're independent, though if merged simultaneously there will be a conflict over the ordering of fields in `Unit`.
2024-07-18 17:16:35 +00:00
bors
913d4b85e3 Auto merge of #14261 - epage:error, r=weihanglo
fix(toml): Improve error on missing package and workspace

That the error was confused was brought up in #13904
2024-07-17 22:01:29 +00:00
Ed Page
0ccafcace9 fix(toml): Improve error on missing package and workspace
That the error was confused was brought up in #13904
2024-07-17 15:52:37 -05:00
bors
b33a9b2ead Auto merge of #14244 - dieterplex:migrate-gct-snapbox, r=epage
Migrate global_cache_tracker snapbox

Part of #14039.

Some of these tests may require to assert specific removed file count or size that would be redact by current design. Need feedback to come out solution.

Temporary commit to pass the tests and illustrate what need to fix.
2024-07-17 16:57:08 +00:00
bors
52a2630253 Auto merge of #14260 - Eh2406:summary_sync, r=weihanglo
make summary sync by using Arc not Rc

### What does this PR try to resolve?

For my PubGrub testing work I want to be able to read the entire crates.io index into memory and then run lots of resolution questions against that data in parallel. Currently cargoes `Summary` and `Dependency` types use `Rc` internally which prevents this pattern. Using `Arc` in cargo makes my life a lot easier! It does not noticeably slow down single threaded performance. (Measured by running my PubGrub testing in single threaded mode before and after.)

The team largely agreed to this at a meeting and in discussions https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Make.20summary.20sync

### How should we test and review this PR?

Tests still pass

### Additional information

Should be add a test a this is sync?
2024-07-17 15:27:55 +00:00
Jacob Finkelman
c27579a584 add a check that Summary is Sync 2024-07-17 14:34:34 +00:00
d1t2
86862738d7
test: Migrate global_cache_tracker to snapbox 2024-07-16 23:07:09 +08:00
d1t2
df43a23235
test: Update HASH redaction for registry files 2024-07-16 23:07:06 +08:00
Greg Morenz
9098072ee3 Store links_overrides in Unit 2024-07-16 10:05:33 -04:00
Greg Morenz
76381aa81b Add test verifying behavior of links_overrides with target-applies-to-host and an implicit target 2024-07-16 10:05:33 -04:00
bors
a2b58c3dad Auto merge of #14257 - weihanglo:ci-tool, r=epage
chore(ci): bump CI tools

### What does this PR try to resolve?

* Bump cargo-semver-checks to 0.32.0, which supports rustdoc JSON format v30
* Bump mdbook to 0.4.40, and change `curly-quotes` to `smart-punctuation`

### How should we test and review this PR?

Wait for CI green.

### Additional information
2024-07-16 00:52:02 +00:00
Weihang Lo
12d00dcf6f
chore(ci): cargo-semver-checks to 0.32.0 2024-07-15 20:24:48 -04:00
Weihang Lo
33c75e66ef
doc: replace deprecated output.html.curly-quotes 2024-07-15 20:24:48 -04:00
Weihang Lo
00da161ce8
chore(ci): mdbook to 0.4.40 2024-07-15 20:20:20 -04:00
bors
7b227dee2c Auto merge of #14214 - eth3lbert:snapbox-fetch-n-la, r=weihanglo
test: migrate fetch and list_availables to snapbox

### What does this PR try to resolve?

Part of https://github.com/rust-lang/cargo/issues/14039.

Migrate following to snapbox:

- `tests/testsuite/fetch.rs`
- `tests/testsuite/list_availables.rs`
2024-07-15 20:18:29 +00:00
bors
54ee7e3257 Auto merge of #14254 - weihanglo:jobserver, r=epage
chore: downgrade to jobserver@0.1.28

See https://github.com/rust-lang/jobserver-rs/issues/99

While there is a fix waiting for review,
we might miss the release window for 1.80,
so propose we beta-backport this
2024-07-15 19:45:44 +00:00
Weihang Lo
8923ba62dd
chore: downgrade to jobserver@0.1.28
See https://github.com/rust-lang/jobserver-rs/issues/99

While there is a fix waiting for review,
we might miss the release window for 1.80,
so propose we beta-backport this
2024-07-15 14:28:54 -04:00
bors
a2d45dc370 Auto merge of #14252 - epage:du-less, r=ehuss
perf(source): Don't `du` on every git source load

### What does this PR try to resolve?

When profiling Zed (#14238), a major factor in their no-op run times is git patches and git dependencies.  The slowest operation for each git source is running `du`.  This is extraneous for a couple of reasons
- GC isn't stable, slowing people down for a feature they aren't using
- Size tracking was expected to be lazy, only reading sizes when the GC is configured for size, while this was eager
- Git checkouts are immutable but we check on every load
- This optimized for "while filesystem caches are warm" from a checkout operation when checkout operations are rare compared to all of the other commands run on a working directory.

This removes the `du`, relying on the lazy loading that happens in `update_null_sizes`.

For Zed, this removed about 40ms total from the runtime.  While by itself, this is below the threshold of being noticed,
- It adds up if any editor integrations are calling `cargo metadata` a lot
- Over time, small gains like this will add up

### How should we test and review this PR?

### Additional information

cc `@ehuss`
2024-07-15 17:33:50 +00:00
Ed Page
cd74470c4e perf(source): Don't du on every git source load
When profiling Zed (#14238), a major factor in their no-op run times
is git patches and git dependencies.  The slowest operation for each git
source is running `du`.  This is extraneous for a couple of reasons
- GC isn't stable, slowing people down for a feature they aren't using
- Size tracking was expected to be lazy, only reading sizes when the GC
  is configured for size, while this was eager
- Git checkouts are immutable but we check on every load
- This optimized for "while filesystem caches are warm" from a checkout
  operation when checkout operations are rare compared to all of the other
  commands run on a working directory.

This removes the `du`, relying on the lazy loading that happens in
`update_null_sizes`.
2024-07-15 10:38:28 -05:00
bors
2d658f2a62 Auto merge of #14239 - epage:git, r=weihanglo
fix(source): Don't warn about unreferenced duplicate packages

### What does this PR try to resolve?

This also improves the message, consolidating multiple duplicates and saying which was loaded instead, as it naturally fell out of the design

Fixes #10752

### How should we test and review this PR?

### Additional information

We're still subject to #13724 and fully load every manifest, even if we don't use it.  I'm exploring that topic at https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Redundant.20code.20in.20.60GitSouce.60.3F/near/450783427

This change builds on
- #13993
- #14169
- #14231
- #14234
2024-07-15 13:47:38 +00:00
eth3lbert
16a2dbd2ba
refactor(test): make list_availables snapshot-aware 2024-07-14 04:09:34 +08:00
eth3lbert
b43ea97f3b
test: migrate list_availables to snapbox 2024-07-14 04:09:32 +08:00
eth3lbert
7a6bf16153
test: migrate fetch to snapbox 2024-07-14 04:07:54 +08:00
bors
b31577d43c Auto merge of #14243 - epage:prelude, r=weihanglo
feat(test): Add cargo_test to test-support prelude

### What does this PR try to resolve?

With where we are at with #14039, I was revisiting our test writing documentation.  I was wanting to put more emphasis on rustdoc and found it would be helpful to talk about the concepts if a prelude was used instead of `extern crate`.

### How should we test and review this PR?

Yes, this included some `use` clean ups in tangentially-related commit but its already painful enough
walking through every test file, I didn't want to do it twice.

### Additional information
2024-07-13 14:00:09 +00:00
bors
916c5a4f36 Auto merge of #14202 - pietroalbini:pa-publish, r=weihanglo
Add workflow to publish Cargo automatically

One of the last manual pieces of the Rust release process is publishing Cargo, and as it happens after the release itself it is often forgotten (I am often guilty of that). This PR aims to fully automate that.

Nowadays tagging Cargo happens automatically, as the release process creates and pushes a signed tag for the release. So the only piece remaining is automatically executing the `publish.py` script. This PR adds a workflow triggered by the tag push to run `publish.py` with a [rust-lang-owner](https://crates.io/users/rust-lang-owner) scoped token.

The secret is stored in the [`release` environment](https://github.com/rust-lang/cargo/settings/environments/3357627654/edit), which can only be used during tag pushes.

cc `@Mark-Simulacrum`
2024-07-13 13:28:54 +00:00
Ed Page
e2e2f311aa docs(contrib): Note reqirement for prelude 2024-07-12 15:57:01 -05:00
Ed Page
5b9799c6f4 refactor: Migrate from extern crate to test-support prelude
We now include the prelude in so many places, this simplifies how we can
present how `cargo-test-support` works.

Yes, this included some `use` clean ups but its already painful enough
walking through every test file, I didn't want to do it twice.
2024-07-12 15:57:00 -05:00
Ed Page
090064cc14 feat(test): Add cargo_test to test-support prelude 2024-07-12 15:56:22 -05:00
bors
67a452bc56 Auto merge of #14245 - eth3lbert:snapbox-implicit-features, r=epage
test: migrate implicit_features to snapbox

### What does this PR try to resolve?

Part of https://github.com/rust-lang/cargo/issues/14039.

Migrate following to snapbox:

- `tests/testsuite/implicit_features.rs`
2024-07-12 19:34:11 +00:00