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

GR: resolve tests & mock client #909

Merged
merged 6 commits into from
Apr 11, 2024
Merged

Conversation

michaelkedar
Copy link
Member

Some tests checking dependency resolution works as expected and correctly finds the vulnerable dependency chains.

Includes a new MockResolutionClient so I can test guided resolution on toy data without relying on the live OSV / deps.dev APIs.

@michaelkedar
Copy link
Member Author

dep.dev nicely made their schema submodule public for me to load local clients/resolution graphs from a string, so I may be able to make these other tests nicer 🙂

Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

this is awesome!!

@michaelkedar michaelkedar merged commit b6c013e into google:main Apr 11, 2024
12 checks passed
michaelkedar added a commit that referenced this pull request May 9, 2024
#967)

Made a go script that creates a universe file for the
`MockResolutionClient` (#909) from the current real deps.dev & OSV data
used during in-place / relock / relax computation.

This has let me add some real-world in-place & relax patch generation
test cases to test for regression without it breaking constantly due to
new versions. I've only added one universe because the files are pretty
large.

The in-place/relax patch generation tests are basically end-to-end tests
- it's not really written in a way that makes testing only the patch
computation functionality possible. (This might be a code smell, but I
don't think it's practical to structure the code in such a way).
josieang pushed a commit to josieang/osv-scanner that referenced this pull request Jun 6, 2024
google#967)

Made a go script that creates a universe file for the
`MockResolutionClient` (google#909) from the current real deps.dev & OSV data
used during in-place / relock / relax computation.

This has let me add some real-world in-place & relax patch generation
test cases to test for regression without it breaking constantly due to
new versions. I've only added one universe because the files are pretty
large.

The in-place/relax patch generation tests are basically end-to-end tests
- it's not really written in a way that makes testing only the patch
computation functionality possible. (This might be a code smell, but I
don't think it's practical to structure the code in such a way).
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.

None yet

3 participants