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

Rewrite test_datebase.py tests as a validation job #345

Open
jsstevenson opened this issue May 30, 2024 · 2 comments
Open

Rewrite test_datebase.py tests as a validation job #345

jsstevenson opened this issue May 30, 2024 · 2 comments
Labels
priority:medium Medium priority test Changes to test code only

Comments

@jsstevenson
Copy link
Member

jsstevenson commented May 30, 2024

Many of the cases in test_database.py query an existing database to check that certain rules of the model structure are being obeyed. This is helpful, but I'm not sure a pytest case is the best way to employ this. In practice, I think we'd want to have a scheduleable (+ ad-hoc runnable) task or script that runs this over a Neo4j table, and collects a listing of deviations from rules (+ then saves or emails them). It's less helpful to have them as a test because they aren't testing behavior (that eg could've just been changed by a recent commit), they're testing state, which may or may not even be available.

@jsstevenson jsstevenson added priority:medium Medium priority test Changes to test code only labels May 30, 2024
@korikuzma
Copy link
Member

Is this similar to #261 ?

@jsstevenson
Copy link
Member Author

jsstevenson commented May 30, 2024

@korikuzma I think these are sort of orthogonal questions. The tests in test_database are helpful for checking for schema drift over time in a production setting. As they're written, though, they aren't checking correctness of the data upload methods, at least not in a particularly direct or robust way -- just that nothing that's in there is shaped incorrectly. To do that I think we would want to either a) mock DB calls and check correctness there or b) create a test dataset, have a test module manage an upload run of it to a test table, then dump it out and check correctness of the dump (I think this is better suited for CICD if anything since Neo4j Desktop only lets you run one table at once)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:medium Medium priority test Changes to test code only
Projects
None yet
Development

No branches or pull requests

2 participants