Commit graph

772 commits

Author SHA1 Message Date
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
hi-rustin 40ff7be1ad
fix: remove symlink on Windows
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-05-23 21:18:33 +08:00
hi-rustin 0e1b115ccd
test: add case for the symlink file
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-05-21 20:16:35 +08:00
hi-rustin 8b0161ede4
test: add a test case for removing symlink dir
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-05-21 20:00:56 +08:00
Eric Huss cf7857354f Fix warning about unused Permissions 2024-05-20 11:40:44 -07:00
Urgau 1e4857a4d9 Allow lint config to have extra custom configs
And report the unused manifest key warning for every key that we do not
use, which is currently every of them.
2024-05-16 17:03:42 +02: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
Steven Engler 36a63b4039 fix: preserve file permissions on unix during write_atomic
Preseves u/g/o r/w/x permissions on unix platforms.
2024-05-14 22:50:28 -04:00
Steven Engler 038ccd29c0 test: write_atomic changes file permissions to 0o600 on unix 2024-05-14 22:48:34 -04:00
Weihang Lo a47766149f
test(rustfix): bless multiple-solutions.nightly.rs 2024-05-09 09:30:25 -04:00
Weihang Lo 26bcf58bfe
test(rustfix): run some tests only on nightly 2024-05-09 09:30:25 -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
Thibault Saunier 4634aa6403 cargo-util: Bump version 2024-05-02 10:20:00 -04:00
Thibault Saunier defff445fa Workaround copying file returning EAGAIN on ZFS on mac OS
Falling back to hard_link when that happens, retrying can lead to very
long wait before copying works (up to 4secs in my tests) while
hard_linking works straight away.

Looks related to https://github.com/openzfsonosx/zfs/issues/809

Closes #13838
2024-05-02 08:32:38 -04:00
Ed Page 627b1d1470 feat(fix): Migrate inherited deps with ignored default-features 2024-05-01 12:43:47 -05:00
Ed Page 1e6047763d fix(toml): Warn, rather than fail publish, if build.rs is excluded
This could offer a minor performance gain when reading this manifest
since the target doesn't need to be discovered.
2024-04-29 12:25:19 -05:00
Ed Page 39f1a210b8 perf(toml): Avoid looking up readme on published packages
Not much of a performance gain;
this is mostly done to be consistent with the target work.
2024-04-29 12:25:19 -05:00
Ed Page bdd4bda518 fix(toml)!: Remove support for inheriting badges
We allowed `[badges]` to inherit from `[workspace.package.badges]`

This was a bug:
- This was not specified in the RFC
- We did not document this
- Even if someone were to try to guess to use this, it is inconsistent
  with how inheritance works because this should inherit from
  `workspace.badges` instead of `workspace.package.badges`

While keeping in mind that `[badges]` is effectively deprecated.

In that context, I think its safe to break support for this without a
transition period.

Fixes #13643
2024-04-22 14:22:01 -05:00
Ed Page 705c4f1cae chore(ci): Don't check cargo against beta channel
We already only partially check it and it has been a source of false
positives.

While there is trust in the job, contributors and maintainers go into
the job assuming there is a problem and it takes time to break that
assumption.

If we lose trust in the job, we then won't trust it when it fails for
other reasons.

This also increases the risk of us not seeing other problems
`bump-checks` is meant to find if the steps in the job get re-arranged
to make this one of the early ones.
2024-04-29 09:05:33 -05:00
bors 70fb498994 Auto merge of #13797 - Muscraft:cleanup-linting-system, r=epage
Cleanup linting system

There are a number of problems with the current linting system, most notably that lints could run without `-Zcargo-lints` being set. This PR fixes that issue and a few others that are low-hanging fruit.
2024-04-24 16:31:40 +00:00
bors 125aa57ad2 Auto merge of #13782 - klensy:llibc, r=weihanglo
gate some libc usages under cfg(unix), drop os_info features

Places few `libc` usages under `cfg(unix)`. That didn't remove it from tree, but still looks cleaner.
Drop features from os_info crate, as serde support currently unused.
2024-04-23 17:32:32 +00:00
Scott Schafer 11d6013c1d
fix(cargo-lints): Respect Forbid lint level 2024-04-20 20:12:47 -06:00
klensy 3215929365 gate some libc usages under cfg(unix) 2024-04-19 15:27:21 +03: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
Ed Page 6d8d3b6420 fix(schemas): Allow parsing pre-release with X 2024-04-17 16:49:22 -05:00
Ed Page 6f22e9dbee test(schemas): Add PartialVersion unit tests 2024-04-17 16:47:51 -05:00
Ed Page 3a2cc82789 test(msrv): Migrate most parse tests to unit tests 2024-04-17 16:47:29 -05:00
Ed Page 675d67d093 fix(msrv): Error, rather than panic, on rust-version 'x'
Fixes #13768
2024-04-17 15:10:18 -05:00
Weihang Lo eacdfd2917
test: fix tests to assert unxpected querystrring error 2024-04-15 20:25:01 -04:00
Weihang Lo 99b4a49530
test: assert error kind for pkgidspec parsing 2024-04-15 20:25:01 -04: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
Weihang Lo 95edc06e5b
fix(rustfix): dont apply same suggestion twice
This assumes that if any of the machine applicable fixes in
a diagnostic suggestion is a duplicate, we should see the
entire suggestion as a duplicate.
2024-04-10 11:54:33 -04:00
Weihang Lo 5b05a3bb5a
test(rustfix): demonstrate duplicate suggestions 2024-04-10 11:53:37 -04:00