Commit graph

13647 commits

Author SHA1 Message Date
hi-rustin
04d592c7ad Make some blocking tests non-blocking by using API server 2023-02-23 09:11:52 +08:00
bors
9d5b32f503 Auto merge of #11758 - weihanglo:jobqueue, r=epage
refactor(job_queue): docs and move types around
2023-02-22 23:04:16 +00:00
bors
aa51b11c9a Auto merge of #11757 - ehuss:test-env-cleanup, r=epage
Scrub more of the test environment

This adds a few environment variables that if set outside the testsuite will cause problems.
This also has a separate commit which sorts the environment list.
2023-02-22 22:18:12 +00:00
bors
239ff787dc Auto merge of #11754 - kylematsuda:more-config-env, r=ehuss
Make more reads of environment variables go through the `Config`

As discussed in #11588, it's better to make reads of environment variables go through the `Config` instead of calling `std::env::var` or `env::var_os` everywhere.

Most of the "easy" places to change this in `src/` were handled in https://github.com/rust-lang/cargo/pull/11727. This PR fixes a few remaining call sites that were missed in #11727, namely:

- `LocalFingerprint::find_stale_item`
- `util::profile::start` and `Profiler`
- `util::rustc::rustc_fingerprint`

After doing this, there are a few remaining calls to `env::var` in `src/` but those probably require more discussion to fix.
2023-02-22 21:29:24 +00:00
Weihang Lo
ff7b54d9c2
refactor: move JobState to job_state.rs
Also add two new methods:

- `JobState::new` to create new `JobState`
- `JobState::run_to_finish` is extracted from old [`doit`][1].

[1]: 7ddcf0fe33/src/cargo/core/compiler/job_queue.rs (L1122-L1168)
2023-02-22 17:13:14 +00:00
Weihang Lo
69f4b5c696
refactor: rename job.rs -> job_queue/job.rs 2023-02-22 16:59:16 +00:00
Eric Huss
0fcacd0e6c Scrub more environment variables from the test environment. 2023-02-22 08:56:53 -08:00
Eric Huss
969c12dc89 Sort and organize the env_remove list. 2023-02-22 08:55:29 -08:00
Kyle Matsuda
5035cb2138 remove env::var from util::rustc::rustc_fingerprint 2023-02-22 09:36:29 -07:00
Weihang Lo
5e2f3ca152
refactor: rename job_queue.rs -> job_queue/mod.rs 2023-02-22 14:59:37 +00:00
Weihang Lo
05898e1683
doc: enhancement of job_queue mod-level odc 2023-02-22 14:59:37 +00:00
bors
7ddcf0fe33 Auto merge of #11755 - rust-lang:revert-11749-update-curl, r=weihanglo
Revert "Update curl-sys to use libcurl 7.88.1"

Reverts rust-lang/cargo#11749 due to a pipewait issue, see rust-lang/cargo#11746
2023-02-22 14:59:06 +00:00
Eric Huss
43a27cbcde
Revert "Update curl-sys to use libcurl 7.88.1" 2023-02-22 06:55:20 -08:00
bors
f3de2de2c8 Auto merge of #11748 - tshepang:patch-1, r=weihanglo
use consistent case
2023-02-22 08:53:39 +00:00
bors
0c331721d9 Auto merge of #11725 - Muscraft:reduce-build-in-tests, r=ehuss
Switch some tests from `build` to `check`

#11341 brought up issues with cargo's `testsute` size and speed. One of the suggested fixes was switching most tests to `check` instead of `build`. This PR did that.

Before size on `nightly`: 4.4GB

After size on `nightly`: 4.2GB

Regex to find `build` in `tests/testsuite`: `cargo\(".*build.*\)`
Before: 1607
After: 626

Note I did not remove all `build` I only did the easy ones that required minimal changes. I also tried not to touch systems I was unsure about. There could be other uses of `build` I missed as well.

I still need to play around with `opt-level`, `debug=0`, and a few other tweaks, but there should be more time/memory to drop.

Each test file changed is in a commit of its own, so you should look commit by commit.
2023-02-21 23:27:36 +00:00
bors
1c3f7a56f8 Auto merge of #11753 - arlosi:sparse-warn-space, r=weihanglo
Fix typo in sparse-registry warning message

Fixes #11752

Message now shows as:
```
warning: flag `-Z sparse-registry` has been stabilized in the 1.68 release, and is no longer necessary
  This flag currently still sets the default protocol to `sparse` when accessing crates.io. However, this will be removed in the future.
  The stable equivalent is to set the config value `registries.crates-io.protocol = 'sparse'`
  or environment variable `CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse`
```
2023-02-21 20:47:24 +00:00
Arlo Siemsen
648a8a26fd Fix typo in sparse-registry warning message 2023-02-21 14:14:04 -06:00
Kyle Matsuda
f73a638e54 remove env::var from LocalFingerprint::find_stale_item 2023-02-21 13:03:02 -07:00
bors
b6c7fbeb13 Auto merge of #11750 - klensy:pe, r=arlosi
reuse url encoding from `url` crate, don't use separate `percent-encoding`

Reuse encoding from `url`, don't use separate `percent-encoding`.
2023-02-21 17:50:08 +00:00
bors
7b98113f6c Auto merge of #11727 - kylematsuda:config-env, r=ehuss
Read environment variables through `Config` instead of `std::env::var(_os)`

### What does this PR try to resolve?

Adds two new methods `get_env` and `get_env_os` for reading environment variables from the `Config` and uses them to replace the many of the calls to `std::env::var` and `var_os`  (see the discussion in #11588).

Closes #11588
2023-02-21 16:31:51 +00:00
klensy
37d429ca67 reuse url encoding from url crate, don't use separate percent-encoding 2023-02-21 18:57:25 +03:00
bors
e48bc219e3 Auto merge of #11749 - ehuss:update-curl, r=weihanglo
Update curl-sys to use libcurl 7.88.1

This updates curl-sys to update the vendored curl from 7.86.0 to 7.88.1. The changelog is at https://curl.se/changes.html.
2023-02-21 15:41:39 +00:00
Eric Huss
a616356b39 Update curl-sys to use libcurl 7.88.1 2023-02-21 06:44:36 -08:00
bors
ddfe87fc46 Auto merge of #11747 - klensy:mdman-dep, r=weihanglo
mdman: update pretty_assertions to reduce deps

This reduces deps in rust repo by dropping `ansi_term 0.11.0` and `difference` crates. `yansi` and `diff` already used there (rust repo).
2023-02-21 13:11:26 +00:00
Tshepang Mbambo
640ff8d593
use consistent case 2023-02-21 14:28:00 +02:00
klensy
a485a8a4b8 mdman: update pretty_assertions to reduce duplicated deps 2023-02-21 14:39:30 +03:00
bors
d1d16f2773 Auto merge of #11745 - Muscraft:cleanup-tests, r=epage
Cleanup tests

When working on #11738 I noticed a few tests that needed to be cleaned up. It [was suggested](https://github.com/rust-lang/cargo/pull/11738#discussion_r1111128128) to split the test changes into their own PR.

- `bad_config::bad1`
  - This was trying to match `config` which would get matched in the wrong place due to the test name having `config` in it
  - Fixed by making the match `/config`
- `build_script::panic_abort_with_build_scripts`
  - This test was failing as it was making sure `panic` was not in the output. After this change, it could match the test name and fail.
  - To fix this I updated it to look at `panic=abort` which appears to be what it was originally looking for (#5711). `@ehuss` please let me know if I misread what the test was testing.
- `cargo_command::cargo_subcommand_args`
  - This test had `#[test]` above `#[cargo_test]` which caused it to throw an error removing it fixed the issue

During this time I also ran into issues with `cargo_remove` tests being named `fn case()` which is different from how tests are normally named. I talked with `@epage` and it was decided that `fn case()` should probably be used for all `snapbox` tests since the unique test name is already the folder name. I went ahead and renamed all tests within `cargo_add/` and `init/` to match this style.

This PR should be reviewed commit by commit.
2023-02-21 00:38:06 +00:00
Scott Schafer
45c9c8e905 chore: update workspaces tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
221938a2a0 chore: update vendor tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
b974cacb50 chore: update update tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
866daf4f22 chore: update rustflags tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
43f9b8ea83 chore: update rust_version tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
6282282fb0 chore: update replace tests to use check 2023-02-20 12:22:29 -06:00
Scott Schafer
ab1794bda4 chore: update registry_auth tests to use check 2023-02-20 12:22:24 -06:00
Scott Schafer
98c746629b chore: update registry tests to use check 2023-02-20 12:22:24 -06:00
Scott Schafer
1b9af485c1 chore: update pub_priv tests to use check 2023-02-20 12:22:24 -06:00
Scott Schafer
41738bea7e chore: update progress tests to use check 2023-02-20 12:22:24 -06:00
Scott Schafer
8d66a0265d chore: update profile_overrides tests to use check 2023-02-20 12:21:55 -06:00
Scott Schafer
a726b8d682 chore: update proc_macro tests to use check 2023-02-20 12:21:35 -06:00
Scott Schafer
341c400487 chore: update paths tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
577594770e chore: update path tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
730e2196b7 chore: update patch tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
7b14e72cc6 chore: update package_features tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
de2e97403f chore: update package tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
e3d3bb6b04 chore: update offline tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
fb755a3dd1 chore: update net_config tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
1dd8536935 chore: update metabuild tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
8f4f77e894 chore: update message_format tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
9a46caf1ed chore: update lockfile_compat tests to use check 2023-02-20 12:21:27 -06:00
Scott Schafer
de704f5093 chore: update local_registry tests to use check 2023-02-20 12:21:27 -06:00