-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Change tests to support rustc
wording changes
#14135
Conversation
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of `rustc` for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`.
@@ -347,7 +347,8 @@ fn rustc_check_err() { | |||
.with_status(101) | |||
.with_stderr_contains("[CHECKING] bar [..]") | |||
.with_stderr_contains("[CHECKING] foo [..]") | |||
.with_stderr_contains("[..]cannot find function `qux` in [..] `bar`") | |||
.with_stderr_contains("[..]cannot find function `qux`[..]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we stop asserting the string, and instead check only the appearance of E0425
? I feel like the error code will always be there, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error code will indeed always be there. I'm ok with either approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epage
Any opinion on adding a redaction for the first line rustc diagnostic message? Something like
error[E0425]: [RUSTC_ERROR_MESSAGE]
We still need to use ...
to omit the multiline sub-diagnostics though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, not a bad idea, but you can already accomplish that with error[E025]: [..]
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we only match on the error number and not the error message? I guess that would be specific enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, not a bad idea, but you can already accomplish that with error[E025]: [..] right?
The more we can auto-redact, the easier to is to write new tests and do the right thing (or update existing tests)
Let's not block rustc change. We can clean up then. Thank you! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 10 commits in bc89bffa5987d4af8f71011c7557119b39e44a65..4ed7bee47f7dd4416b36fada1909e9a62c546246 2024-06-22 00:36:36 +0000 to 2024-06-25 16:28:22 +0000 - test: omit target-dir name (rust-lang/cargo#14142) - test: migrate offline, open_namespaces and owner to snapbox (rust-lang/cargo#14138) - docs: remove stray comment (rust-lang/cargo#14133) - Change tests to support `rustc` wording changes (rust-lang/cargo#14135) - deps: dont use tracing-attributes for workspace, use for cargo only (rust-lang/cargo#14122) - Include vcs_info even if workspace is dirty (rust-lang/cargo#13960) - test: migrate profile* to snapbox (rust-lang/cargo#14128) - test: migrate path and paths to snapbox (rust-lang/cargo#14109) - test: migrate rustflags, rustup and script to snapbox (rust-lang/cargo#14126) - test: migrate rename_deps, replace, required_features and run to snapbox (rust-lang/cargo#14127)
Update cargo 10 commits in bc89bffa5987d4af8f71011c7557119b39e44a65..4ed7bee47f7dd4416b36fada1909e9a62c546246 2024-06-22 00:36:36 +0000 to 2024-06-25 16:28:22 +0000 - test: omit target-dir name (rust-lang/cargo#14142) - test: migrate offline, open_namespaces and owner to snapbox (rust-lang/cargo#14138) - docs: remove stray comment (rust-lang/cargo#14133) - Change tests to support `rustc` wording changes (rust-lang/cargo#14135) - deps: dont use tracing-attributes for workspace, use for cargo only (rust-lang/cargo#14122) - Include vcs_info even if workspace is dirty (rust-lang/cargo#13960) - test: migrate profile* to snapbox (rust-lang/cargo#14128) - test: migrate path and paths to snapbox (rust-lang/cargo#14109) - test: migrate rustflags, rustup and script to snapbox (rust-lang/cargo#14126) - test: migrate rename_deps, replace, required_features and run to snapbox (rust-lang/cargo#14127)
Update cargo 10 commits in bc89bffa5987d4af8f71011c7557119b39e44a65..4ed7bee47f7dd4416b36fada1909e9a62c546246 2024-06-22 00:36:36 +0000 to 2024-06-25 16:28:22 +0000 - test: omit target-dir name (rust-lang/cargo#14142) - test: migrate offline, open_namespaces and owner to snapbox (rust-lang/cargo#14138) - docs: remove stray comment (rust-lang/cargo#14133) - Change tests to support `rustc` wording changes (rust-lang/cargo#14135) - deps: dont use tracing-attributes for workspace, use for cargo only (rust-lang/cargo#14122) - Include vcs_info even if workspace is dirty (rust-lang/cargo#13960) - test: migrate profile* to snapbox (rust-lang/cargo#14128) - test: migrate path and paths to snapbox (rust-lang/cargo#14109) - test: migrate rustflags, rustup and script to snapbox (rust-lang/cargo#14126) - test: migrate rename_deps, replace, required_features and run to snapbox (rust-lang/cargo#14127)
Update cargo 10 commits in bc89bffa5987d4af8f71011c7557119b39e44a65..4ed7bee47f7dd4416b36fada1909e9a62c546246 2024-06-22 00:36:36 +0000 to 2024-06-25 16:28:22 +0000 - test: omit target-dir name (rust-lang/cargo#14142) - test: migrate offline, open_namespaces and owner to snapbox (rust-lang/cargo#14138) - docs: remove stray comment (rust-lang/cargo#14133) - Change tests to support `rustc` wording changes (rust-lang/cargo#14135) - deps: dont use tracing-attributes for workspace, use for cargo only (rust-lang/cargo#14122) - Include vcs_info even if workspace is dirty (rust-lang/cargo#13960) - test: migrate profile* to snapbox (rust-lang/cargo#14128) - test: migrate path and paths to snapbox (rust-lang/cargo#14109) - test: migrate rustflags, rustup and script to snapbox (rust-lang/cargo#14126) - test: migrate rename_deps, replace, required_features and run to snapbox (rust-lang/cargo#14127)
Update cargo 10 commits in bc89bffa5987d4af8f71011c7557119b39e44a65..4ed7bee47f7dd4416b36fada1909e9a62c546246 2024-06-22 00:36:36 +0000 to 2024-06-25 16:28:22 +0000 - test: omit target-dir name (rust-lang/cargo#14142) - test: migrate offline, open_namespaces and owner to snapbox (rust-lang/cargo#14138) - docs: remove stray comment (rust-lang/cargo#14133) - Change tests to support `rustc` wording changes (rust-lang/cargo#14135) - deps: dont use tracing-attributes for workspace, use for cargo only (rust-lang/cargo#14122) - Include vcs_info even if workspace is dirty (rust-lang/cargo#13960) - test: migrate profile* to snapbox (rust-lang/cargo#14128) - test: migrate path and paths to snapbox (rust-lang/cargo#14109) - test: migrate rustflags, rustup and script to snapbox (rust-lang/cargo#14126) - test: migrate rename_deps, replace, required_features and run to snapbox (rust-lang/cargo#14127)
Change tests to support `rustc` wording changes With rust-lang/rust#126818 the output of rustc for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land in `rustc`. Follow up to #14135. Noticed in https://github.com/rust-lang-ci/rust/actions/runs/10192263962/job/28194880547#step:25:7529 when trying to land rust-lang/rust#126818.
Between rust-lang/rust#126810 and rust-lang/rust#126810 the output of
rustc
for resolution errors is going to change in such a way that some existing cargo tests will fail. Change them to support both the current and future output, so that those PRs can land inrustc
.