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 hard-coded hashes from codegen tests #125963

Merged

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Jun 4, 2024

This removes hard-coded hashes from the codegen and assembly tests. These use FileCheck, which supports eliding part of the pattern being matched, including by capturing it as a pattern parameter for later matching-on. This is much more appropriate than asking contributors to engage with deliberately-opaque identifier schemes.

In order to reduce the likelihood of error, every hash-coded segment I've touched now expects a certain length. This correctly represents these cases, as our hash outputs have a predetermined amount of entropy attached to them.

This is not done for the UI test suite as those are comparatively easy to simply --bless, whereas that would be inappropriate for codegen tests. It is also not done for debuginfo tests as those tests do not support such elision in a correct and useful way.

When things like our internal hashing or representations change,
it is inappropriate for these tests to suddenly fail for no reason.
The chance of error is reduced if we instead pattern-match.
@rustbot
Copy link
Collaborator

rustbot commented Jun 4, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 4, 2024
@workingjubilee workingjubilee force-pushed the remove-hashes-from-codegen-tests branch from 81c0ae4 to fb6fbf0 Compare June 5, 2024 21:30
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 9, 2024

📌 Commit fb6fbf0 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 Jun 9, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Jun 9, 2024
…codegen-tests, r=Mark-Simulacrum

Remove hard-coded hashes from codegen tests

This removes hard-coded hashes from the codegen and assembly tests. These use FileCheck, which supports eliding part of the pattern being matched, including by capturing it as a pattern parameter for later matching-on. This is much more appropriate than asking contributors to engage with deliberately-opaque identifier schemes.

In order to reduce the likelihood of error, every hash-coded segment I've touched now expects a certain length. This correctly represents these cases, as our hash outputs have a predetermined amount of entropy attached to them.

This is not done for the UI test suite as those are comparatively easy to simply `--bless`, whereas that would be inappropriate for codegen tests. It is also not done for debuginfo tests as those tests do not support such elision in a correct and useful way.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 9, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#125041 (Enable GVN for `AggregateKind::RawPtr`)
 - rust-lang#125253 (Add `FRAC_1_SQRT_2PI` constant to f16/f32/f64/f128)
 - rust-lang#125465 (bootstrap: vendor crates required by opt-dist to collect profiles )
 - rust-lang#125470 (Add release notes for 1.79.0)
 - rust-lang#125963 (Remove hard-coded hashes from codegen tests)
 - rust-lang#126188 (Fix documentation for `impl_common_helpers` in `run-make-support`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3720757 into rust-lang:master Jun 9, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 9, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 9, 2024
Rollup merge of rust-lang#125963 - workingjubilee:remove-hashes-from-codegen-tests, r=Mark-Simulacrum

Remove hard-coded hashes from codegen tests

This removes hard-coded hashes from the codegen and assembly tests. These use FileCheck, which supports eliding part of the pattern being matched, including by capturing it as a pattern parameter for later matching-on. This is much more appropriate than asking contributors to engage with deliberately-opaque identifier schemes.

In order to reduce the likelihood of error, every hash-coded segment I've touched now expects a certain length. This correctly represents these cases, as our hash outputs have a predetermined amount of entropy attached to them.

This is not done for the UI test suite as those are comparatively easy to simply `--bless`, whereas that would be inappropriate for codegen tests. It is also not done for debuginfo tests as those tests do not support such elision in a correct and useful way.
@workingjubilee workingjubilee deleted the remove-hashes-from-codegen-tests branch June 10, 2024 19:22
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants