Open NicolasGrosjean opened 2 years ago
Indeed and Excellent ! I am glad you understood the issue and picked up with implementation ! @NicolasGrosjean This is exactly what I meant by the issue and it's a good start already ! Instead of checking exact same json output for that particular countries endpoint because based on the database configuration somebody can only include their own country to run underpass / galaxy api for their usage . I will recommend checking on one level down which is checking response type to check either it is a geojson or not and also check for either the return response is empty or contains any feature ! I will be happy to help for other endpoints if you need any assistance
In a1a7d62, there are 2 failing tests with some weird cases which shouldn't happen with the UI.
@kshitijrajsharma Do you want I open an issue at each endpoint with at least one failing test, or at the end with all failing tests, or simply let you create issue(s) when you think it is necessary ?
Sure @NicolasGrosjean we can work on failing test ! Go ahead file the issue and we can prioritize ! What we can do on tests is we can actually setup the DB with .sql file in github workflow directly so that even tests can run under all those config blocks , for eg : raw data insight TM ! And also developers can also replicate the process looking at the github workflow too ! Fireup the issue with your idea and we can discuss it further on issue before implementation and I think it can be done after all endpoint test , because it is related with setting up the test
I have raised A PR ( though it's draft , I will be more testing it before making it ready ) which solves your github unit test breaking problem and will also enable for you to extend the testing with sample data because unitest will be using a testing database with the sample sql provided in both github workflow and testing too with the mock of psql
Add integrations (end to end ?) tests to solve the issue Improve tests , Make sure tests are readable and contains request body for each API endpoint #279 .
Before doing normal and error tests for each endpoint, I need to know if it is what you expected @kshitijrajsharma.
For the moment, it breaks the GitHub test workflow. I spent some time to use the same Postgres mechanism as test_app but I failed with the dynamic postgres port. Any help is welcome but it can wait until I have written more tests.