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

Add xtask option to run a single snapshot test by name #585

Merged
merged 3 commits into from
Sep 24, 2021

Conversation

justahero
Copy link
Contributor

@justahero justahero commented Sep 23, 2021

This is to only run a single snapshot test when checking things without running all tests again.

cargo xtask test-snapshot log

will only run the log snapshot test. In case no test name is given, all tests are run as before. The test name of the positional parameter (<single>) is checked against the allowed list of snapshot tests.

This is to only run a single snapshot test when checking things without
running all tests again.
Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

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

Implementation looks good, feel free to send to bors

xtask/src/main.rs Outdated Show resolved Hide resolved
match source {
"all" => Ok(Snapshot::All),
test => {
if ALL_SNAPSHOT_TESTS.contains(&test) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't work with the conditionally-available alloc test, but that's probably not a big problem

This re-adds the logic to validate a given test with the available ones.
@jonas-schievink
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 24, 2021

Build succeeded:

@bors bors bot merged commit 43f025f into main Sep 24, 2021
@bors bors bot deleted the feature/run-single-snapshot-test branch September 24, 2021 14:27
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