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

Fix instrument-coverage tests by using Python to sort instantiation groups #111179

Merged
merged 1 commit into from
May 12, 2023

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented May 4, 2023

#110942 was intended to fix a set of -Cinstrument-coverage tests, but it ended up silently breaking those tests on Linux, for annoying reasons detailed at #111171.

Dealing with diff --ignore-matching-lines across multiple platforms has been such a hassle that I've instead written a simple Python script that can detect instantiation groups in the output of llvm-cov show, and sort them in a predictable order so that they can be used as snapshots for an ordinary invocation of diff.

This approach should be much less error-prone, because it can't accidentally ignore the wrong lines, and any unforeseen problems will tend to result in a Python exception or a failing diff.

@rustbot
Copy link
Collaborator

rustbot commented May 4, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 4, 2023
@Zalathar

This comment was marked as resolved.

@Zalathar Zalathar force-pushed the sort-groups branch 2 times, most recently from 9e18099 to 159e54f Compare May 4, 2023 13:32
@Zalathar
Copy link
Contributor Author

Zalathar commented May 5, 2023

@rustbot label +A-code-coverage +A-testsuite

@rustbot rustbot added A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-testsuite Area: The testsuite used to check the correctness of rustc labels May 5, 2023
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 6, 2023

📌 Commit 105adf3 has been approved by Mark-Simulacrum

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 May 6, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 6, 2023
…acrum

Fix instrument-coverage tests by using Python to sort instantiation groups

rust-lang#110942 was intended to fix a set of `-Cinstrument-coverage` tests, but it ended up silently *breaking* those tests on Linux, for annoying reasons detailed at rust-lang#111171.

Dealing with `diff --ignore-matching-lines` across multiple platforms has been such a hassle that I've instead written a simple Python script that can detect instantiation groups in the output of `llvm-cov show`, and sort them in a predictable order so that they can be used as snapshots for an ordinary invocation of `diff`.

This approach should be much less error-prone, because it can't accidentally ignore the wrong lines, and any unforeseen problems will tend to result in a Python exception or a failing diff.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 6, 2023
…acrum

Fix instrument-coverage tests by using Python to sort instantiation groups

rust-lang#110942 was intended to fix a set of `-Cinstrument-coverage` tests, but it ended up silently *breaking* those tests on Linux, for annoying reasons detailed at rust-lang#111171.

Dealing with `diff --ignore-matching-lines` across multiple platforms has been such a hassle that I've instead written a simple Python script that can detect instantiation groups in the output of `llvm-cov show`, and sort them in a predictable order so that they can be used as snapshots for an ordinary invocation of `diff`.

This approach should be much less error-prone, because it can't accidentally ignore the wrong lines, and any unforeseen problems will tend to result in a Python exception or a failing diff.
@matthiaskrgr
Copy link
Member

@bors r-
#111299 (comment)

@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 May 6, 2023
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels May 7, 2023
@Zalathar
Copy link
Contributor Author

Zalathar commented May 7, 2023

@rustbot label -T-bootstrap -T-infra

(Just temporarily changing CI settings to run the necessary tests for this PR; those changes won't get merged.)

@rustbot rustbot removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels May 7, 2023
@rust-log-analyzer

This comment has been minimized.

@Zalathar
Copy link
Contributor Author

Zalathar commented May 7, 2023

This should be good to go now.

I had thought I could get away with re-enabling two previously-disabled tests, but it turns out they had been disabled for good reason, beyond the scope of just sorting coverage report output. So those two tests remain disabled, which was already the status quo.

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 7, 2023
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 7, 2023

📌 Commit 27a3ce2 has been approved by Mark-Simulacrum

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 May 7, 2023
@bors
Copy link
Contributor

bors commented May 10, 2023

⌛ Testing commit 27a3ce2 with merge bfb69532ea3d505d1d92e436b6af47173c475293...

@bors
Copy link
Contributor

bors commented May 10, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 10, 2023
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@Zalathar

This comment was marked as outdated.

@bors
Copy link
Contributor

bors commented May 10, 2023

@Zalathar: 🔑 Insufficient privileges: not in try users

@bjorn3
Copy link
Member

bjorn3 commented May 11, 2023

@bors retry

@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 May 11, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 12, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#111179 (Fix instrument-coverage tests by using Python to sort instantiation groups)
 - rust-lang#111393 (bump windows crate 0.46 -> 0.48)
 - rust-lang#111441 (Verify copies of mutable pointers in 2 stages in ReferencePropagation)
 - rust-lang#111456 (Update cargo)
 - rust-lang#111490 (Don't ICE in layout computation for placeholder types)
 - rust-lang#111492 (use by ref TokenTree iterator to avoid a few clones)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ea332b5 into rust-lang:master May 12, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 12, 2023
@Zalathar Zalathar deleted the sort-groups branch May 12, 2023 14:21
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 9, 2023
Re-enable some coverage tests on Linux

These tests were originally disabled (on all platforms) in rust-lang#110393, because those changes had made them start failing on Linux for unclear reasons.

I tried to re-enable them unconditionally in rust-lang#111179, since they worked locally on my Mac, but I found that they were still failing on Linux, so I gave up at that time.

Later while working on rust-lang#112300 I was able to re-enable them on Windows and Mac, since those changes made it possible to add specific `ignore-` directives to individual tests. I noticed at the time that the tests actually seemed to be working again on Linux, but by that point I didn't want to risk more CI failures, so I left them disabled on Linux with an intention to re-enable them later.

Now I'm going back to re-enable them on Linux too, since they seem to work fine.

---

Because `run-coverage` tests are sensitive to line numbers, and `x test tidy` doesn't like leading blank lines, I've replaced the old comment/ignore with an informative comment that occupies the same number of lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) A-testsuite Area: The testsuite used to check the correctness of rustc 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) 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