test: audit + restructure tests#273
Conversation
jennifer-bowser
left a comment
There was a problem hiding this comment.
I have a couple of minor tweaks and questions, but overall this looks awesome!! You've made some really good improvements to our testing.
There was a problem hiding this comment.
Everything looks great, with the one exception of this test that's failing because the string that's being compared is getting extra quotation marks inserted somewhere:
FAILED tests/unit/storage/test_postgres.py::test_annotations_crud - assert '"pathogenic"' == 'pathogenic'
EDIT: Here's the more detailed error message:
> assert result[0].annotation_value == ann1.annotation_value
E assert '"pathogenic"' == 'pathogenic'
E
E - pathogenic
E + "pathogenic"
E ? + +
tests/unit/storage/test_postgres.py:282: AssertionError
|
@jennifer-bowser interesting! That test is actually passing in CI and I'm not able to replicate this locally either |
|
stuff I'd be curious about
|
|
I just setup a new anyvar environment and all tests pass on my machine |
|
AHA! (EDIT: I thought the culprit was my postgres version, but apparently that's not the issue after all?? Somehow downgrading my postgres version fixed the issue for me, but CI can run the tests on 17.5 without any problems soooo 🤷🏻♀️ ) A few thoughts, though:
Ok never mind on this too I guess? For some reason I'm only running into this issue some of the time, it's not reliably reproducible for me. Maybe just leave this be for now, it seems my computer is just cursed 😭 |
Yeah I am not sure how to proceed here -- hopefully we feel okay as long as GitHub Actions uses the same image as the docker-compose file? I also tried a few other images, and went ahead and upgraded my local brew instance to v18 just to be safe.
Great find. Yeah, this one had passed for me once so I didn't look too hard, but I'm also seeing a few sporadic instances of failures. I refactored the change you'd made as a setup/teardown fixture following the pattern recommended here and now everything seems to be passing consistently. |
|
yolo |
close #239 close #134 * Add more storage tests. Try to cover stuff that we've added. * Fix interdependence between testing modules. No more need to guarantee an order. In fact, I think individual cases (functions) are no longer interdependent at all. * Organizational changes to tests, trying to add a bit more structure * Consolidate various variation fixtures into `variations.json` so that they can be reused easily across modules. Try to standardize tertiary properties that get used (e.g. params when testing registration), although I think these are usually better added at the test module level (see changes in `test_liftover.py`). Add a basic Pydantic check on their way in to ensure that nothing's breaking. * Add tests CI action. The challenge is that we have a lot of architectural inter-dependencies between things and that's harder to unit test w/o mocks. But we do have decent coverage here.
close #239
close #134
variations.jsonso that they can be reused easily across modules. Try to standardize tertiary properties that get used (e.g. params when testing registration), although I think these are usually better added at the test module level (see changes intest_liftover.py). Add a basic Pydantic check on their way in to ensure that nothing's breaking.This is currently limited to just a single case to prove the concept.(Wait duh this actually covers a lot of stuff -- everything intests/unitexcept liftover which I'm working on a fix for). The challenge is that we have a lot of architectural inter-dependencies between things and that's harder to unit test w/o mocks.