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

Refactor resolver tests, transition to PBT #296

Merged
merged 9 commits into from
Apr 24, 2023

Conversation

Nour-Mws
Copy link
Collaborator

@Nour-Mws Nour-Mws commented Apr 6, 2023

This refactor was done to make it easier to test the resolver with the boolean parameters install_deps and identity_mapping (in future PRs).
Without this refactor, the list of parameterized cases for the resolver test will grow by a factor of 2 for each additional parameter. This would require manual maintenance and is increasingly hard to parse.

Copy link
Collaborator

@mknorps mknorps left a comment

Choose a reason for hiding this comment

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

I love that you moved those tests to a separate module and parametrized them with hypothesis!

@Nour-Mws Nour-Mws force-pushed the nour/refactor-resover-tests branch 4 times, most recently from a04fb54 to e7443ab Compare April 17, 2023 21:07
@Nour-Mws Nour-Mws requested a review from mknorps April 17, 2023 21:25
Simplify parametrized tests

Extract the different categories of dependencies in the parameters into
their own lists/dicts:
- non_locally_installed_deps
- locally_installed_deps
- user_defined_deps

Define the toml-formatted user mapping from the user_defined_deps dict once

Instead of manually definining the expected resolved dict of deps for
each case, define a function that constructs this dict by taking advantage
of the fact that the sets of deps extracted above are disjoint.

Move resolver tests into a separate module

Replace parameterized tests with PBT
No change to functionality
@Nour-Mws Nour-Mws force-pushed the nour/refactor-resover-tests branch from e7443ab to 3725cef Compare April 20, 2023 17:27
Copy link
Collaborator

@mknorps mknorps left a comment

Choose a reason for hiding this comment

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

Great work on this @Nour-Mws !
I think this PR is ready to be merged 🚀

If you anyway have some spare 10 minutes, please take a look at some simplification I propose in the branch maria/nour-simplified-refactor. I described them commit by commit.

@Nour-Mws Nour-Mws merged commit 540de0b into main Apr 24, 2023
@Nour-Mws Nour-Mws deleted the nour/refactor-resover-tests branch April 24, 2023 07:06
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.

2 participants