-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add tests for MongoDB and fix bugs #237
Conversation
@@ -71,7 +71,7 @@ def test_hierarchy_update() -> None: | |||
'Protein': {'X': 50 * units.mg / units.mL}}}} | |||
|
|||
# make a txtl composite, embedded under an 'agents' store | |||
txtl_composer = AgentDivision({}) | |||
txtl_composer = AgentDivision({'growth': {'default_growth_noise': 0}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test randomly failed on me once, so I'm hoping this change makes it more reproducible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great @thalassemia!
Just a question about the pytest workflow -- how does this mongo image work? Does github host this?
The image is hosted on Docker Hub: https://hub.docker.com/_/mongo. In this PR, I pinned the 6.0.13 version of the image for no particular reason. We could set the tag to |
Adding MongoDB to the test environment proved very straightforward thanks to service containers. I repurposed an existing script to test large emits, query capabilities, and manual insertion of documents. Along the way, I fixed three issues:
time
key was not being added to broken-down emits whentime
was 0delete_experiment_from_database
failed when using multiple CPU processesdata_to_database
were not retrievable bydata_from_database
unless a specific structure was adhered toAccording to
pytest
, coverage ofemitter.py
went from 44% to 90% with this PR. Most of the remaining untested code is in the MongoDB Atlas functions.By creating this pull request, I agree to the Contributor License
Agreement, which is available in
CLA.md
at the top level of thisrepository.