Skip to content

Test OSV update ecosystems (#4100) #5069

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

Closed

Conversation

NeilMathew-git
Copy link

@NeilMathew-git NeilMathew-git commented May 5, 2025

This PR adds a mock-based unit test for the update_ecosystems method in OSV_Source, ensuring it correctly detects valid ecosystems when gsutil responses are mocked. This improves test coverage for the OSV data source and verifies ecosystem parsing logic in isolation from the actual network.

This contributes to the broader effort discussed in [Issue #4100]: Adding alternative vulnerability data sources. While this test doesn't implement new sources, it lays groundwork for robust testing around OSV integration and will help validate any future improvements to its logic.

My earlier PR accidentally showed "0 lines changed" because I forgot to properly stage and commit the updated test file before pushing. This PR fixes that (I hope).

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

I've set the tests to run so you can see the CI feedback, but ... why is there a testing being added in the data_sources/osv_source.py file? that's not the correct location for tests.

@NeilMathew-git
Copy link
Author

Sorry, I mistakenly left the test block in data_sources/osv_source.py while experimenting. I've cleaned it up and moved all testing code to the test file. I'll create a new PR and address the CI feedback shortly.

@terriko
Copy link
Contributor

terriko commented May 7, 2025

Looks like this has been replaced by #5073 so I'll close this one now.

@terriko terriko closed this May 7, 2025
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