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

Remove unneeded LLVM CI test assertions #139015

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Mar 27, 2025

The download_ci_llvm bootstrap test was checking implementation details of the LLVM CI download check, which isn't very useful. It was essentially testing "if function_that_checks_if_llvm_ci_is_available returns true, we enable CI LLVM", but the usage of the function was an implementation detail. After #138704, the inner implementation has changed, so the test now breaks if LLVM is updated.

I don't think that it's very useful to test implementation details like this, without taking the outside git state into account. Ideally, we should mock the git state for the test, otherwise the test will randomly break when executed in environments which the test does not control (e.g. on CI when a LLVM change happens).

I only kept the part of the test that checks that LLVM CI isn't used when we specify download-ci-llvm = false, as that should hold under all conditions, CI/local, and all git states.

I also kept the if-unchanged assertion, but only on CI, and as a temporary measure. After #138591, we should have a proper way of mocking the git state to make the test robust, and make it test what we actually want.

Fixes this.

r? @ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 27, 2025
@Kobzol Kobzol force-pushed the llvm-ci-test-fixes branch from f0e0183 to 215c2c2 Compare March 27, 2025 11:53
@Kobzol Kobzol marked this pull request as ready for review March 27, 2025 11:53
@rustbot
Copy link
Collaborator

rustbot commented Mar 27, 2025

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@Kobzol
Copy link
Contributor Author

Kobzol commented Mar 27, 2025

CI succeeded with a WIP commit that modified download-ci-llvm-stamp.

r? @onur-ozkan

@onur-ozkan
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 27, 2025

📌 Commit 215c2c2 has been approved by onur-ozkan

It is now in the queue for this repository.

@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 Mar 27, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang#138844 (expand: Leave traces when expanding `cfg` attributes)
 - rust-lang#138926 (Remove `kw::Empty` uses from `rustc_middle`.)
 - rust-lang#138989 (Clean up a few things in rustc_hir_analysis::check::region)
 - rust-lang#138999 (Report compiletest pass mode if forced)
 - rust-lang#139014 (Improve suggest construct with literal syntax instead of calling)
 - rust-lang#139015 (Remove unneeded LLVM CI test assertions)
 - rust-lang#139016 (Add job duration changes to post-merge analysis report)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ecaa35f into rust-lang:master Mar 27, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 27, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2025
Rollup merge of rust-lang#139015 - Kobzol:llvm-ci-test-fixes, r=onur-ozkan

Remove unneeded LLVM CI test assertions

The `download_ci_llvm` bootstrap test was checking implementation details of the LLVM CI download check, which isn't very useful. It was essentially testing "if function_that_checks_if_llvm_ci_is_available returns true, we enable CI LLVM", but the usage of the function was an implementation detail. After rust-lang#138704, the inner implementation has changed, so the test now breaks if LLVM is updated.

I don't think that it's very useful to test implementation details like this, without taking the outside git state into account. Ideally, we should mock the git state for the test, otherwise the test will randomly break when executed in environments which the test does not control (e.g. on CI when a LLVM change happens).

I only kept the part of the test that checks that LLVM CI isn't used when we specify `download-ci-llvm = false`, as that should hold under all conditions, CI/local, and all git states.

I also kept the `if-unchanged` assertion, but only on CI, and as a temporary measure. After rust-lang#138591, we should have a proper way of mocking the git state to make the test robust, and make it test what we actually want.

Fixes [this](rust-lang#138784 (comment)).

r? `@ghost`
@Kobzol Kobzol deleted the llvm-ci-test-fixes branch March 28, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants