Skip to content

Allow #[ignore] tests to run in rustfmt's test suite #5397

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

Merged

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Jun 21, 2022

There are some tests in the rustfmt test suite that are ignored by default. I believe these tests are ignored because they have caused issues with the the rust-lang/rust test suite.

However, we recently experienced an issue (#5395) that would have been avoided had these tests been running.

With the introduction of the new #[rustfmt_only_ci_test] attribute macro we can run these tests when the RUSTFMT_CI environment variable is set, which will presumably only be set during rustfmts CI runs. When the environment variable is not set the #[rustfmt_only_ci_test] will be replaced with an #[ignore].

@ytmimi
Copy link
Contributor Author

ytmimi commented Jun 21, 2022

Until #5395 is resolved it's expected that the tests::cargo-fmt::version test will fail

#[test]
fn version() {
assert_that!(&["--version"], starts_with("rustfmt "));
assert_that!(&["--version"], starts_with("rustfmt "));
assert_that!(&["--", "-V"], starts_with("rustfmt "));
assert_that!(&["--", "--version"], starts_with("rustfmt "));
}

There are some tests in the rustfmt test suite that are ignored by
default. I believe these tests are ignored because they have caused
issues with the the `rust-lang/rust` test suite.

However, we recently experienced an issue (5395) that would have been
avoided had these tests been running.

With the introduction of the new `#[rustfmt_only_ci_test]` attribute
macro we can run these tests when the `RUSTFMT_CI` environment variable
is set, which will presumably only be set during rustfmts CI runs.
When the environment variable is not set the `#[rustfmt_only_ci_test]`
will be replaced with an `#[ignore]`.
@ytmimi ytmimi force-pushed the run_ignore_tests_on_rustfmt_ci branch from dcf1e38 to a64405f Compare June 22, 2022 23:29
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on this! let's give it a shot, although will need to keep an eye on it during the next sync

@calebcartwright calebcartwright merged commit b3d4fb4 into rust-lang:master Jun 29, 2022
@ytmimi
Copy link
Contributor Author

ytmimi commented Jun 30, 2022

I'm hopeful that this will help us avoid situations like #5395 🤞🏼

@ytmimi ytmimi deleted the run_ignore_tests_on_rustfmt_ci branch August 7, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants