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

Apply --all if workspace is virtual #4025

Conversation

rsertelon
Copy link
Contributor

No description provided.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Awesome, thanks! Could you also add some tests for this as well?

@rsertelon
Copy link
Contributor Author

Will do this evening (GMT+1/2)

@rsertelon
Copy link
Contributor Author

I've fixed one test that failed because the virtual build was supposed to fail before this PR.

However, I don't really see a way of testing the modification appart from trying to run cargo with a virtual build and verify it returns with a status 0.

Is that actually all that's testable?

@matklad
Copy link
Member

matklad commented May 12, 2017

However, I don't really see a way of testing the modification appart from trying to run cargo with a virtual build and verify it returns with a status 0.

cargo test would be a convenient command to check that everything is tested: you'll need a workspace with a virtual manifest and two members, foo and bar. You then run cargo test in the virtual package and verify that stdout contains lines test_foo, test_bar. Of course we wouldn't check all other subcommands this way, but the proper fix for this would be to get rid of the duplication somehow.

@rsertelon
Copy link
Contributor Author

Thanks for the pointer @matklad Won't have time this week-end, but will be back on it next week!

@rsertelon
Copy link
Contributor Author

I think I've got this. I copied existing tests for virtual workspace, and removed the --all argument and if test fails, it means that the automatic add of --all is broken.

What do you think?


let spec = if options.flag_all {
let spec = if options.flag_all || ws.is_virtual() {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, won't this break a use case when you are in the root of the workspace, but want to exercise a particular package?

I am thinking about something like this:

ws_root/
  Cargo.toml
  foo/
    Cargo.toml
  bar/
    Cargo.toml
$ pwd
~/projects/ws_root/
$ cargo test --pkg foo

If I am right, and the tests are green, this also means that some test is missing :)

@bors
Copy link
Contributor

bors commented May 28, 2017

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

@alexcrichton
Copy link
Member

Closing due to inactivity, but please feel free to resubmit with a rebase!

bors added a commit that referenced this pull request Jul 28, 2017
Rebased and fixed 4025: Apply --all if workspace is virtual

- fixes #4021
- rebased #4025
- fixed issue issue described by @matklad in #4025 (review)
- added test `build_virtual_manifest_one_project` which covers the fix
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.

6 participants