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

Fix package_default_run test. #9577

Merged
merged 5 commits into from
Jun 12, 2021
Merged

Fix package_default_run test. #9577

merged 5 commits into from
Jun 12, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 11, 2021

The package_default_run test was checking the output of cargo metadata, which included the "targets" field. Unfortunately the order of the targets in this test depend on the filesystem order, so the test may randomly fail.

The fix here is to just check for the one field that this test was interested in.

An alternate solution would be to sort the targets. Another alternate solution would be to use "{...}" for the targets to ignore them. I kinda liked simplifying it to check just one field.

This includes a series of commits that are just general changes to the test infrastructure:

  • Change cargo-test-support to use anyhow.
  • Remove unused ErrMsg.
  • Fix a bug with verify_checks_output.
  • Remove the weird Debug impl for Execs.
  • Added a helper function for getting the JSON output from cargo. (I can imagine a lot of possible enhancements here.)

ehuss added 5 commits June 11, 2021 12:37
This was accidentally broken in
rust-lang@cc5e9df
causing it to not check in the error case (which is the only case that mattered).
That message was not helpful.
This is a helper to run the process and return a JSON object.
The output was checking the `targets`, whose order depends on the
filesystem order. Instead of checking all the output, just
check the one field this test is for.
@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 11, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 12, 2021

📌 Commit 2492bf5 has been approved by alexcrichton

@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 Jun 12, 2021
@bors
Copy link
Contributor

bors commented Jun 12, 2021

⌛ Testing commit 2492bf5 with merge 4445667...

@bors
Copy link
Contributor

bors commented Jun 12, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 4445667 to master...

@bors bors merged commit 4445667 into rust-lang:master Jun 12, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 12, 2021
Update cargo

11 commits in aa8b09297bb3156b849e73db48af4cd050492fe6..44456677b5d1d82fe981c955dc5c67734b31f340
2021-06-09 00:28:53 +0000 to 2021-06-12 18:00:01 +0000
- Fix package_default_run test. (rust-lang/cargo#9577)
- Change how the fix_deny_warnings_but_not_others test works (rust-lang/cargo#9571)
- Add mising documentation regarding `cargo doc` (rust-lang/cargo#9565)
- Implement warning for ignored trailing arguments (rust-lang/cargo#9561)
- Make clippy happy (rust-lang/cargo#9569)
- Fix rustc/rustdoc config values to be config-relative. (rust-lang/cargo#9566)
- Update rustfix. (rust-lang/cargo#9567)
- Warn if an "all" target is specified, but we don't match anything (rust-lang/cargo#9549)
- add default_run to SerializedPackage (rust-lang/cargo#9550)
- respect user choice of lib/bin over heuristics (rust-lang/cargo#9522)
- Add a mean to mutably access the members of a workspace (rust-lang/cargo#9547)
@ehuss ehuss added this to the 1.55.0 milestone Feb 6, 2022
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.

4 participants