443 Commits

Author SHA1 Message Date
eth3lbert
03a0b5c999
Auto-redact not found 2024-06-27 12:55:34 +08:00
eth3lbert
cfabfe5467
test: Auto-redact target dir hashes 2024-06-23 11:10:15 +08:00
eth3lbert
91569f84b0
test: Add auto-redaction for not found error 2024-06-22 05:13:58 +08:00
Ed Page
fd8a91d185 fix(test): Un-redact Packaged files
This is a partial revert of ##14121
(e11d1722bb6e1e58c91adb1964993c74b45f4293)

Our focus for redacting (auto or with globs) includes
- run-specific information (timing, hashes, platform-specific wording)
- rustc-specific information

(We tend to use globs for rustc-specific information because there might
be some very specific times we need to care about some of the details)

However, "Packaged files" does not fit into any of that and, for now, we
are erring on the side of redacting less, rather than more, with the
move to snapbox.
As we see how it works out and what the underlying requirements are, we
can revisit this.
2024-06-21 11:05:41 -04:00
bors
922960916d Auto merge of #14121 - dieterplex:redact-file-num, r=weihanglo
test: Auto-redact file number

This is from <https://github.com/rust-lang/cargo/pull/14096#discussion_r1648889843>.

Although the number of files in `cargo package` is important,
we have `validate_crate_contents` and `validate_upload_with_contents`
that verify the exact contents.
Redacting `Packaged` status should be fine.
2024-06-21 13:14:27 +00:00
d1t2
e11d1722bb
test: Auto-redact file number 2024-06-19 20:00:56 +08:00
Weihang Lo
6a684edcb6
test: fix the [FINISHED] escape 2024-06-18 13:58:56 -04:00
Weihang Lo
153856fe14
test: prefer raw string for regex reduction 2024-06-18 13:58:13 -04:00
Weihang Lo
f4985827d7
chore: bump cargo-test-{support,macro} due to public API changes 2024-06-17 11:37:21 -04:00
Lawrence Chou
fde1321381
Remove Execs::run_expect_error to avoid #14076 2024-06-16 09:13:24 +08:00
renovate[bot]
a018e3a946
chore(deps): update msrv (1 version) to v1.79 2024-06-13 17:27:19 +00:00
Scott Schafer
190ef86d06
test: Auto-redact file hash 2024-06-12 13:27:08 -06:00
Scott Schafer
875a25fba7
test: Auto-redact exit status 2024-06-12 13:27:08 -06:00
Scott Schafer
02459b707f
test: Auto-redact bench timing results 2024-06-12 13:27:08 -06:00
Scott Schafer
6a7b15a61e
test: Auto-redact host target and alt target 2024-06-12 13:27:08 -06:00
Scott Schafer
d7de93777d
test: Only compile regex replacements once 2024-06-12 13:26:54 -06:00
Scott Schafer
6914c2958f
test: Merge common redactions 2024-06-12 09:28:24 -06:00
bors
4dcbca118a Auto merge of #13926 - tweag:overlay, r=epage
Add local registry overlays

This PR adds (private to cargo internals) support for local registry overlays, in which you can locally pretend to add packages to remote registries; the local packages will have the same source ids as the remote registry that you're overlaying.

There are two ways to set up these overlays: programmatically using `GlobalContext::local_overlays` and through the `__CARGO_TEST_PACKAGE_CONFUSION_VULNERABILITY_DO_NOT_USE_THIS` environment variable. You can't set up these overlays with `.cargo/config`.

The motivation for this is [packaging workspaces](https://github.com/rust-lang/cargo/issues/10948). When we're packing a workspace, we'd like to be able to pretend (for lockfile generation and verification) that some workspace packages are already published even though they aren't.
2024-06-11 16:27:02 +00:00
Weihang Lo
c5a6a6cfa4
test: auto-redact elapsed time from libtest output 2024-06-10 20:54:32 -04:00
Joe Neeman
ba9dd1ea2e Adds tests for source overlays. 2024-06-10 18:32:22 -05:00
Ed Page
dc5ac62cab fix(test): Deprecate non-snapbox assertions
While this is noisy and hides other deprecations, I figured deprecations would
make it easier for people to discover what tasks remain and allow us to
divide and conquer this work rather than doing a heroic PR.
In theory, this will be short lived and we'll go back to seeing
deprecations in our tests.
2024-06-10 10:20:52 -05:00
Ed Page
ff2ddebc71 feat(test): Allow snapshotting of Execs 2024-06-10 10:20:52 -05:00
Ed Page
0761937bc7 feat(test): Auto-redact registry source hashes 2024-06-10 10:20:52 -05:00
Ed Page
8b7de1ea81 feat(test): Auto-redact crate sizes from cargo-package 2024-06-10 10:20:52 -05:00
Ed Page
15e3412b2f fix(test): Ensure panics show test code, not lib 2024-06-10 10:20:52 -05:00
Ed Page
d028cfaba3 chore(test): Bump cargo-test-support to 0.2.2 2024-06-10 10:20:52 -05:00
Tor Hovland
031b410181 feat: Implement cargo update --breaking. 2024-06-07 09:13:28 +02:00
bors
4b681c7338 Auto merge of #13980 - epage:compare, r=hi-rustin
refactor: Transition direct assertions from cargo-test-support to snapbox

### What does this PR try to resolve?

Cargo has a bespoke testing framework for functional tests
- Extra stuff for us to maintain
- Don't leverage benefits from contributions related to other projects
- Less incentive to be thoroughly documented

UI tests are written using snapbox.  The latest release of snapbox (#13963) was geared at supporting cargo's needs in the hope that we can consolidate on testing frameworks.

Besides having a single set of semantics, benefits we'd gain include
- Updating of test snapshots
- Fancier redacting of test output (e.g. #13973)

This is the first incremental step in this direction.  This replaces direct assertions with snapbox assertions.  This still leaves all of the CLI output assertions. These will be done incrementally.

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

### Additional information
2024-06-02 14:48:01 +00:00
renovate[bot]
a2e32f2493
chore(deps): update alpine docker tag to v3.20 2024-06-01 00:52:26 +00:00
Ed Page
995746b937 refactor: Port from matches_contains to assert_e2e 2024-05-29 14:08:10 -05:00
Ed Page
eee1053384 refactor: Port from matches_unordered to assert_e2e 2024-05-29 14:08:10 -05:00
Ed Page
3054936cab refactor: Port from assert_matches_exact to assert_e2e
This leaves off `validate_crate_contents` as that would be an effort on
its own
2024-05-29 14:08:10 -05:00
Ed Page
fe5c2d393a refactor(test): Pull out end-to-end literal redactions 2024-05-29 14:08:10 -05:00
Ed Page
ea36ed09f3 refactor(test): Share redactions between ui and e2e 2024-05-29 14:08:10 -05:00
Ed Page
94119af2a5 docs(test): Clarify role of assert_ui 2024-05-29 14:08:10 -05:00
Ed Page
f22c43b87d fix(test)!: Hide API that isnt used by Cargo 2024-05-29 14:08:10 -05:00
Ed Page
5ea1c8fea9 feat(test): Auto-redact elapsed time 2024-05-27 21:27:25 -05:00
Ed Page
9af864ee55 refactor: Resolve deprecations 2024-05-27 21:27:03 -05:00
Ed Page
eafc743c0d chore: Update to snapbox 0.6
We needed to tweak the redactions because snapbox no longer normalizes
slashes on redactions unless the data type is a `PathBuf`.
2024-05-27 21:26:20 -05:00
Ed Page
0bd034cd06 refactor(test): Split up calls by type 2024-05-27 21:24:43 -05:00
Ed Page
4a6f25c112 refactor: Resolve snapbox deprecations 2024-05-27 10:28:13 -05:00
Weihang Lo
2fd4b440bc
test: use git clone --bare instead of manual mv 2024-05-16 00:14:12 -04:00
Weihang Lo
699f6f454d
test: set safe.directory for git repo in apache container
See f4aa8c8bb1
2024-05-16 00:14:12 -04:00
Ed Page
befb66d9ce style(test): Remove check-cfg warning
This is currently breaking CI because we run effectively `RUSTDOCFLAGS=-Dwarnings cargo +nightly doc`
2024-05-06 16:52:29 +02:00
bors
97181c67e1 Auto merge of #13851 - weihanglo:macos, r=epage
refactor: remove unnecessary branch for link binary on macOS
2024-05-02 20:11:50 +00:00
Weihang Lo
f8aead9338
refactor: remove unnecessary branch for link binary on macOS
The other workaround branch should have covered that.
2024-05-02 16:04:26 -04:00
renovate[bot]
05ba4d8cfe chore(deps): update msrv (1 version) to v1.78 2024-05-02 15:07:25 +00:00
Sebastian Thiel
07d2bd7517
reproduce failure when packaging a path-dependency inside a symlinked git repository (#13773) 2024-04-19 07:11:37 +02:00
Josh Stone
a70f23c50b test: don't compress test registry crates
They are still nominally gzipped, but using `Compression::none()` makes
them consistent even across zlib and zlib-ng, and this fixes checksum
differences in the testsuite. There is a one-time update of all those
checksums to catch up with this change though.
2024-04-11 14:58:42 -07:00
Paul Mabileau
f422e96b31
Docs(crates/cargo-test-*): Add external usage warning
As discussed in #10147.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:17:34 +01:00