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

test: migrate some files to snapbox #14113

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

heisen-li
Copy link
Contributor

What does this PR try to resolve?

Changes to the following documents were completed:

tests/testsuite/cargo_command.rs
tests/testsuite/cargo_env_config.rs
tests/testsuite/cargo_features.rs
tests/testsuite/cargo_targets.rs

part of #14039

@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2024

r? @ehuss

rustbot has assigned @ehuss.
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 A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2024
}

#[cargo_test]
fn list_builtin_aliases_with_descriptions() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the output on the right is complete, the test case here is deleted.

@@ -132,6 +178,7 @@ fn list_command_looks_at_path_case_mismatch() {
);
}

#[allow(deprecated)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since with_stdout_does_not_contain,add #[allow(deprecated)].

@bors
Copy link
Collaborator

bors commented Jun 23, 2024

☔ The latest upstream changes (presumably #14126) made this pull request unmergeable. Please resolve the merge conflicts.

crates/cargo-test-support/src/compare.rs Outdated Show resolved Hide resolved
crates/cargo-test-support/src/compare.rs Outdated Show resolved Hide resolved
tests/testsuite/cargo_command.rs Outdated Show resolved Hide resolved
@epage
Copy link
Contributor

epage commented Jun 26, 2024

Could you clean up the commit history?

Comment on lines 392 to 395
.with_stdout_data(str![[r#"
[CARGO_PATH]
"#]])
Copy link
Contributor

Choose a reason for hiding this comment

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

So this was already a "self updating" test output and I believe the design of it means that there is little to evolve that we'd need to allow snapshotting more from this.

Should we keep the expected-str generation that was in here before, just switching the assert method used?

Copy link
Contributor Author

@heisen-li heisen-li Jun 26, 2024

Choose a reason for hiding this comment

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

It is not possible to just convert with_stdout to with_stdout_data, such as the error reported below:

--- Expected
++++ actual:   stdout
   1      - /home/heisen/temp/temp/temp/cargo/target/debug/cargo∅
        1 + /home/heisen/temp/temp/temp/cargo/target/debug/cargo

Need to add line breaks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding in a newline is trivial and doesn't invalidate the idea I mentioned that this is unlikely to have surrounding text that gets regularly changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has been modified and you can see if it meets the requirements.

tests/testsuite/version.rs Outdated Show resolved Hide resolved
@heisen-li heisen-li force-pushed the env_features_target branch 5 times, most recently from d13e4b1 to 204d05d Compare June 29, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants