Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

Convert nullcases test to use savant endpoints #117

Open greenmoss opened 6 years ago

greenmoss commented 6 years ago

Currently the test_nullcases test is connecting directly to the database. Create API endoints for savant, and convert test_nullcases to use them.

This will have the nice side effect of getting Travis to pass.

JosiahRegencia commented 6 years ago

I don't really understand it totally. The test cases look for the endpoints, don't they?

JosiahRegencia commented 6 years ago

Endpoints from result.py

greenmoss commented 6 years ago

Check out the db connection string:

https://github.com/Doveps/mono/blob/9aa093188b11025401abc658469aeb25d9e19983/savant/tests/test_basic.py#L35-L46

Compare that to the previous two tests. I would like all of the savant tests to go through savant API endpoints.

JosiahRegencia commented 6 years ago

Made a PR:

https://github.com/Doveps/mono/pull/121

greenmoss commented 6 years ago

I have some minor feedback on #121. Please have a look and update as needed, and I will merge.

For this ticket, please dive a bit deeper with this test. While the API endpoint in #121 does satisfy the conditions, it is not truly "exercising" savant. We want a good test that exercises the null condition. For instance the error condition was "running A + B + C with null resulted in duplicate rows" (if I got that wrong, please correct me). So the test should be "run A + B + C with null, and assert we got a single row".

The PR #121 will be merged, so I will count that as today's report. However please also open a new PR to address my feedback above.

JosiahRegencia commented 6 years ago

From what I understand about the unit tests is that each function declared is run independently from each other.

JosiahRegencia commented 6 years ago

That's why I added psycopg2 queries saving null values. Twice. To show that it doesn't repeat. I've been reading this over and over again, and I couldn't really get it. I only have a theory what you actually mean. I think what you want is that we base the null test cases on the scanned results saved to the database. If that's the case, I guess what I can do is to check for rows with null values and then check if they have duplicates. If they don't, tests pass. If they do, tests fail.