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

Extract resolver tests to their own crate #7011

Merged
merged 2 commits into from
Jun 18, 2019

Conversation

alexcrichton
Copy link
Member

These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI

@rust-highfive
Copy link

r? @nrc

(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 5, 2019
@alexcrichton alexcrichton requested a review from Eh2406 June 5, 2019 19:56
@Eh2406
Copy link
Contributor

Eh2406 commented Jun 6, 2019

I have 2 open resolver related PRs and hopefully an additional one on the way, all of witch will need to be merged. If this becomes urgent we should land it! If we have some time I'd like to think some more.

The resolver test have different dependencies, tooling, and structure. I like that this gives us a place to make that cleare. This also makes it much lower cost to make them even more different. Like adding benchmarks.

I have some ergonomics concerns. How easy is it to get Jetbrains/RLS to run the tests in there new location? Does that involve an additional copy of /target for all of cargos dependencies? Does this help with the build time for resolver tests? Does this help with the build time for non resolver tests? Do the debug assertions work correctly?

More generally I wonder if this goes far enough. I have for a while thought that we have too many resolver tests. I think a lot of the property based tests are approximations of the new SAT bass test. When we have some experience with the new test, I would strongly consider just removing the other ones. All the example bass test can be made to be of the same form: does some dependencies resolved against a specified index. We could store the outside indexes in a folder of Json or something, and let the SAT framework tell us whether we got the right answer. We could go a step further and just have it output the lock file or error message, and snapshot it. These changes would make it even more true that's a resolver has a different test infrastructure and strategy then everything else.

The thing that would make running the resolver tests much more pleasant is making the resolver a separate crate that does not depend on cargo. The only way I see making that happen is making a trate for each type that cargo gives to the resolver. Then making core/resolver a series of impl ReloverX for X and one call to a library function. But this would be a project.

@bors
Copy link
Collaborator

bors commented Jun 7, 2019

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

@alexcrichton
Copy link
Member Author

This isn't particularly pressing, no, I was largely just interested in getting updates to rust-lang/rust working again which @ehuss mentioned is blocked on smallvec due to a compiler bug, but that compiler bug may have been fixed by this point as well (and needs to be fixed regardless).

For your questions:

How easy is it to get Jetbrains/RLS to run the tests in there new location?

Without being a user of these extensions, I'm not sure!

Does that involve an additional copy of /target for all of cargos dependencies?

Currently, yes, because the integration in rust-lang/rust makes using [workspace] particularly tricky and I don't think we can do it just yet.

Does this help with the build time for resolver tests?

Presumably yes because there's less code to compile!

Does this help with the build time for non resolver tests?

Probably not since this is just a few test being extracted.

Do the debug assertions work correctly?

I believe they should as usual, yes.

The thing that would make running the resolver tests much more pleasant is making the resolver a separate crate that does not depend on cargo

Agreed! You're right in that this'll be super tricky, but it may also be possible (and a good idea) to separate out the core types of Cargo like Summary and such. That would, I think, basically allow the resolver to stand on its own which would be a good idea for sure.

That's certainly a larger undertaking though :)

Copy link
Contributor

@Eh2406 Eh2406 left a comment

Choose a reason for hiding this comment

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

The ergonomics seem to be ok, so I am +1 on this. More aggressive changes can always be made in a follow up.

@@ -182,7 +178,7 @@ pub fn resolve_with_config_raw(

// The largest test in our suite takes less then 30 sec.
// So lets fail the test if we have ben running for two long.
assert!(start.elapsed() < slow_cpu_multiplier(60));
assert!(start.elapsed().as_secs() < 60);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove slow_cpu_multiplier? Do we think that the other people (#6491) running Cargos CI will not run these tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just a big chunk of code to migrate that didn't really seem worth it. The workaround can always be re-added if still necessary.

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 17, 2019

To be clear, with an answer to my nit question and a rebase I think this should be accepted at the earliest convenience. If my PRs ever get in good enough shape to be worth merging, I will happily rebase.

@alexcrichton
Copy link
Member Author

Oh sorry I just ran out of time to rebase this and get it through, I will do so now.

That way when we add more crates we've got a place to put them!
These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI
@alexcrichton
Copy link
Member Author

@bors: r=Eh2406

@bors
Copy link
Collaborator

bors commented Jun 18, 2019

📌 Commit 290a727 has been approved by Eh2406

@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 18, 2019
@bors
Copy link
Collaborator

bors commented Jun 18, 2019

⌛ Testing commit 290a727 with merge 22a8715...

bors added a commit that referenced this pull request Jun 18, 2019
Extract resolver tests to their own crate

These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI
@bors
Copy link
Collaborator

bors commented Jun 18, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Eh2406
Pushing 22a8715 to master...

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 19, 2019

Oh sorry I just ran out of time

It has been clear that you have been very busy for an extended period of time, working on many divers projects each important to keeping this Rust experiment going.
I just wanted to interrupt your todo list to say, Thank you for all the work! Thank you for keeping things going!
I know it is not a replacement for more time nor for more help, but it is what I can do.

bors added a commit that referenced this pull request Jun 21, 2019
Resolver test/debug cleanup

This is several small things salvaged from abandoned PRs and implemented on top of #7011

In working on this I noted that the prop tests are very sensitive to whether backtrace are turned on. Maybe we should set that env to 0 for that builder?
bors added a commit to rust-lang/rust that referenced this pull request Jun 24, 2019
Update cargo

17 commits in 807429e1b6da4e2ec52488ef2f59e77068c31e1f..4c1fa54d10f58d69ac9ff55be68e1b1c25ecb816
2019-06-11 14:06:10 +0000 to 2019-06-24 11:24:18 +0000
- Fix typo in comment (rust-lang/cargo#7066)
- travis: enforce formatting of subcrates as well (rust-lang/cargo#7063)
- _cargo: Make function style consistent (rust-lang/cargo#7060)
- Update some fix comments. (rust-lang/cargo#7061)
- Stabilize default-run (rust-lang/cargo#7056)
- Fix typo in comment (rust-lang/cargo#7054)
- fix(fingerpring): do not touch intermediate artifacts (rust-lang/cargo#7050)
- Resolver test/debug cleanup (rust-lang/cargo#7045)
- Rename to_url → into_url (rust-lang/cargo#7048)
- Remove needless lifetimes (rust-lang/cargo#7047)
- Revert test directory cleaning change. (rust-lang/cargo#7042)
- cargo book /reference/manifest: fix typo (rust-lang/cargo#7041)
- Extract resolver tests to their own crate (rust-lang/cargo#7011)
- ci: Do not install addons on rustfmt build jobs (rust-lang/cargo#7038)
- Support absolute paths in dep-info files (rust-lang/cargo#7030)
- ci: Run cargo fmt on all workspaces (rust-lang/cargo#7033)
- Deprecated ONCE_INIT in favor of Once::new() (rust-lang/cargo#7031)
@alexcrichton alexcrichton deleted the resolver-extract branch July 15, 2019 20:54
@ehuss ehuss added this to the 1.37.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.

6 participants