Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cargo unittests by default with x.py test #90262

Closed
wants to merge 1 commit into from

Conversation

hkratz
Copy link
Contributor

@hkratz hkratz commented Oct 25, 2021

Cargo is vital, so its functionality should be tested for all tier 1 platforms in the CI. This PR includes it in the default x.py testsuite.

This adds about 5 min. to x.py test on my Mac.

@rustbot label A-rustbuild A-testsuite T-cargo T-infra

r? @Mark-Simulacrum

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-testsuite Area: The testsuite used to check the correctness of rustc T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 25, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2021
@Mark-Simulacrum
Copy link
Member

I suspect this makes sense though the time hit will certainly be a bit unfortunate, but in practice test builders are currently not on our long tail for the most part AFAIK (dist-aarch64-apple is) so we should be OK.

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Oct 25, 2021

📌 Commit 34c78b5 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2021
@hkratz
Copy link
Contributor Author

hkratz commented Oct 25, 2021

@Mark-Simulacrum This will fail in the i686 CI until rust-lang/cargo#10004 is fixed or disabled.

@Mark-Simulacrum
Copy link
Member

ah, right

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2021
@infinity0
Copy link
Contributor

In Debian I'm currently using this patch instead:

--- a/src/cargo/core/source/source_id.rs
+++ b/src/cargo/core/source/source_id.rs
@@ -621,7 +621,13 @@
 fn test_cratesio_hash() {
     let config = Config::default().unwrap();
     let crates_io = SourceId::crates_io(&config).unwrap();
-    assert_eq!(crate::util::hex::short_hash(&crates_io), "1ecc6299db9ec823");
+    assert!([
+        "1ecc6299db9ec823", // 64 LE
+        "1285ae84e5963aae", // 32 LE
+        "eae4ba8cbf2ce1c7", // 64 BE
+        "b420f105fcaca6de", // 32 BE
+    ]
+    .contains(&crate::util::hex::short_hash(&crates_io).as_str()));
 }
 
 /// A `Display`able view into a `SourceId` that will write it as a url

@ehuss
Copy link
Contributor

ehuss commented Oct 25, 2021

This will likely add up to 10 to 15 minutes to many builders, including PR builds, which I think is a bit too much.

At a minimum, can this be excluded from PR checks? (x86_64-gnu-llvm-12)

Also, I think this will push on the long tail. x86_64-apple is already taking 2h 55m. dist-aarch64-apple is only taking 3h, so that will likely make x86_64-apple the longest running task, pushing overall CI times.

Personally, I don't think this should be done with such a broad stroke. If the concern is that 32-bit targets are not getting tested, then perhaps we should just add those to Cargo's CI? Having a rust-lang/rust PR break Cargo is extraordinarily rare, and I don't think running these tests so broadly will be very helpful.

@hkratz
Copy link
Contributor Author

hkratz commented Oct 25, 2021

Personally, I don't think this should be done with such a broad stroke. If the concern is that 32-bit targets are not getting tested, then perhaps we should just add those to Cargo's CI? Having a rust-lang/rust PR break Cargo is extraordinarily rare, and I don't think running these tests so broadly will be very helpful.

Sounds reasonable. I can submit a PR for running Cargo's CI against i686 on Windows and Linux instead.

@hkratz hkratz closed this Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants