Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
Zalathar:sort-groups
May 12, 2023
Merged

Fix instrument-coverage tests by using Python to sort instantiation groups#111179
bors merged 1 commit into
rust-lang:masterfrom
Zalathar:sort-groups

Conversation

@Zalathar

@ZalatharZalathar commented May 4, 2023

Copy link
Copy Markdown
Member

#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
Copy Markdown
Collaborator

r? @Mark-Simulacrum

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

@rustbotrustbot 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
Zalatharforce-pushed the sort-groups branch 2 times, most recently from 9e18099 to 159e54fCompareMay 4, 2023 13:32
@Zalathar

Copy link
Copy Markdown
MemberAuthor

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

@rustbotrustbot 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
Copy Markdown
Member

@bors r+

@bors

bors commented May 6, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 105adf3 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@borsbors 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
Copy Markdown
Member

@bors r-
#111299 (comment)

@borsbors 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
@rustbotrustbot 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
Copy Markdown
MemberAuthor

@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.)

@rustbotrustbot 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
Copy Markdown
MemberAuthor

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

@rustbotrustbot 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
Copy Markdown
Member

@bors r+

@bors

bors commented May 7, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 27a3ce2 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@borsbors 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

bors commented May 10, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 27a3ce2 with merge bfb69532ea3d505d1d92e436b6af47173c475293...

@bors

bors commented May 10, 2023

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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
Copy Markdown
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

bors commented May 10, 2023

Copy link
Copy Markdown
Collaborator

@Zalathar: 🔑 Insufficient privileges: not in try users

@bjorn3

Copy link
Copy Markdown
Member

@bors retry

@borsbors 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:masterMay 12, 2023
@rustbotrustbot 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)A-testsuiteArea: The testsuite used to check the correctness of rustcS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant 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

@Zalathar@rustbot@Mark-Simulacrum@bors@matthiaskrgr@rust-log-analyzer@bjorn3