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 test to snapbox #14226

Merged
merged 1 commit into from
Jul 10, 2024
Merged

test: migrate test to snapbox #14226

merged 1 commit into from
Jul 10, 2024

Conversation

eth3lbert
Copy link
Contributor

What does this PR try to resolve?

Part of #14039.

Migrate following to snapbox:

  • tests/testsuite/test.rs

@rustbot
Copy link
Collaborator

rustbot commented Jul 10, 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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 10, 2024
@eth3lbert
Copy link
Contributor Author

r? @epage

Comment on lines 2878 to 2885
// .with_stdout_data(str![[r#"
// running 0 tests
// test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
// test sub_one_test ... ok
// test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
// test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in [ELAPSED]s
// ...
// "#]].unordered())
Copy link
Contributor

Choose a reason for hiding this comment

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

Whats up with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! I forgot to clean up!

Comment on lines 1883 to 1885
.with_stderr_data(
str![[r#"
[RUNNING] `rustc [..]myexm1.rs [..]--crate-type bin[..]`
[RUNNING] `rustc [..]myexm2.rs [..]--test[..]`
...
"#]]
.unordered(),
)
.with_stderr_does_not_contain("[RUNNING] [..]myexm1-[..]")
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's revert this

@eth3lbert
Copy link
Contributor Author

Since this is likely still under review, I'll address the feedback with a series of follow-up fixup commits and then rebase with squash.

@epage
Copy link
Contributor

epage commented Jul 10, 2024

Feel free to squash

tests/testsuite/test.rs Outdated Show resolved Hide resolved
.run();
}

#[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.

with_stderr_does_not_contain is being used in this function.

.run();
}

#[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.

with_stderr_does_not_contain is being used in this function.

.run();
}

#[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.

with_stdout_does_not_contain is being used in this function.

@@ -3355,6 +3644,7 @@ fn test_virtual_manifest_one_project() {
.run();
}

#[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.

with_stdout_does_not_contain is being used in this function.

@@ -3585,6 +3897,7 @@ fn doctest_and_registry() {
p.cargo("test --workspace -v").run();
}

#[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.

This seems similar to #14113 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm keeping this since it failed in CI:
https://github.com/rust-lang/cargo/actions/runs/9866499136/job/27245347236?pr=14226#step:11:4052

--- Expected
++++ actual:   stderr
   1      - ...
   2      - \\?\D:\a\cargo\cargo\target\debug\cargo.exe
   3      - ...
        1 + [COMPILING] foo v0.5.0 ([ROOT]/foo)
        2 + [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
        3 + [RUNNING] unittests src/lib.rs (target/debug/deps/foo-[HASH][EXE])
        4 + //?/D:/a/cargo/cargo/target/debug/cargo[EXE]

and
https://github.com/rust-lang/cargo/actions/runs/9866874620/job/27246366772?pr=14226#step:11:4053

 --- Expected
++++ actual:   stderr
   1      - ...
   2      - \\?\C:\Users\runneradmin\.cargo\bin\rustc.exe
   3      - ...
        1 + [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
        2 + [RUNNING] unittests src/lib.rs (target/debug/deps/foo-[HASH][EXE])
        3 + //?/C:/Users/runneradmin/.cargo/bin/rustc[EXE]

.with_status(101)
.run();
}

#[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.

with_json is being used in this function.

@@ -4079,6 +4419,7 @@ fn json_artifact_includes_test_flag() {
.run();
}

#[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.

with_json is being used in this function.

@@ -4116,6 +4457,7 @@ fn json_artifact_includes_executable_for_library_tests() {
.run();
}

#[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.

with_json is being used in this function.

.run();
}

#[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.

with_stderr_does_not_contain is being used in this function.

.with_status(101)
.run();
}

#[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.

with_stderr_does_not_contain is being used in this function.

@epage
Copy link
Contributor

epage commented Jul 10, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 10, 2024

📌 Commit b3b814e has been approved by epage

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 Jul 10, 2024
@bors
Copy link
Contributor

bors commented Jul 10, 2024

⌛ Testing commit b3b814e with merge 4e19f31...

@bors
Copy link
Contributor

bors commented Jul 10, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing 4e19f31 to master...

@bors bors merged commit 4e19f31 into rust-lang:master Jul 10, 2024
22 checks passed
@eth3lbert eth3lbert deleted the snapbox-test branch July 10, 2024 18:54
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2024
Update cargo

31 commits in 154fdac39ae9629954e19e9986fd2cf2cdd8d964..a2b58c3dad4d554ba01ed6c45c41ff85390560f2
2024-07-07 01:28:23 +0000 to 2024-07-16 00:52:02 +0000
- chore(ci): bump CI tools (rust-lang/cargo#14257)
- test: migrate fetch and list_availables to snapbox (rust-lang/cargo#14214)
- chore: downgrade to [email protected] (rust-lang/cargo#14254)
- perf(source): Don't `du` on every git source load (rust-lang/cargo#14252)
- fix(source): Don't warn about unreferenced duplicate packages (rust-lang/cargo#14239)
- feat(test): Add cargo_test to test-support prelude (rust-lang/cargo#14243)
- Add workflow to publish Cargo automatically (rust-lang/cargo#14202)
- test: migrate implicit_features to snapbox (rust-lang/cargo#14245)
- test: migrate build-std/main to snapbox (rust-lang/cargo#14241)
- test: migrate check_cfg to snapbox (rust-lang/cargo#14235)
- refactor(source): More RecursivePathSource clean up (rust-lang/cargo#14231)
- Add more profiling traces (rust-lang/cargo#14238)
- fix(overrides): Don't warn on duplicate packages from using '..' (rust-lang/cargo#14234)
- fix(test): Redact elapsed time in the minutes time frame (rust-lang/cargo#14233)
- test: Migrate lto tests to snapbox (rust-lang/cargo#14209)
- fix: Ensure dep/feature activates the dependency on 2024 (rust-lang/cargo#14221)
- chore(docs): update index of reference (rust-lang/cargo#14228)
- test: migrate test to snapbox (rust-lang/cargo#14226)
- chore: remove duplicate words (rust-lang/cargo#14229)
- docs(contrib): Document things I look for in RFCs (rust-lang/cargo#14222)
- docs(ref): Note MSRV for features in the docs (rust-lang/cargo#14224)
- test(progress): Resolve flakiness (rust-lang/cargo#14223)
- fix(test): Reduce over-prescription to the caller (rust-lang/cargo#14217)
- refactor: move get_source_id out of registry (rust-lang/cargo#14218)
- fix: rename to `rustdoc::broken_intra_doc_links` (rust-lang/cargo#14215)
- test: migrate member_errors, multitarget and new to snapbox (rust-lang/cargo#14210)
- test: migrate generate_lockfile and glob_targets to snapbox (rust-lang/cargo#14200)
- test: Ensure --list test works with cargo-bloat (rust-lang/cargo#14213)
- dont make new constant InternedString in hot path (rust-lang/cargo#14211)
- Fix compatible_with_older_cargo test. (rust-lang/cargo#14212)
- test: migrate metabuild, metadata and net_config to snapbox (rust-lang/cargo#14162)
@rustbot rustbot added this to the 1.81.0 milestone Jul 17, 2024
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.

5 participants