Skip to content

Conversation

@NeilMathew-git
Copy link

This PR adds two mock-based unit tests for the update_ecosystems method in osv_source.py to improve coverage without relying on external API calls or real gsutil interactions.

test_update_ecosystems_mocked:
Uses patch to mock out aio_run_command and simulate a basic case where a single ecosystem (ecosystem1) is listed and includes an all.zip file. Verifies that it's correctly recognized and stored.

test_update_ecosystems:
Tests the scenario where multiple ecosystems (python, rust) are listed, but only one (python) includes all.zip. Confirms that rust is excluded from the final result.

Copy link
Collaborator

@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.

Heads up: it still looks like some of the test code is in the incorrect file.

@NeilMathew-git
Copy link
Author

Sorry, I forgot to add one of the files when commiting. I just edited the PR on github directly, let me know if there is any other problem.

Copy link
Collaborator

@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.

Still some rogue imports left in osv_source.py.

If you're not sure how to check what's in your PR on the command line, don't forget that you can click the "files changed" tab on github's web interface to see what you're submitting so you can fix it up without waiting for review!

@terriko
Copy link
Collaborator

terriko commented Jun 13, 2025

I'm going to close this since it's been a month without action and I'm guessing you've moved on now that gsoc applications are done, but do feel free to re-open if you want to work on it later!

@terriko terriko closed this Jun 13, 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