Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Integration tests #326

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

NicolasGrosjean
Copy link
Contributor

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.

@kshitijrajsharma
Copy link
Member

kshitijrajsharma commented Sep 19, 2022

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

@NicolasGrosjean
Copy link
Contributor Author

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 ?

@kshitijrajsharma
Copy link
Member

kshitijrajsharma commented Sep 19, 2022

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

@NicolasGrosjean NicolasGrosjean force-pushed the feature/integration_tests branch from 7980056 to d31e90c Compare September 23, 2022 09:20
@kshitijrajsharma
Copy link
Member

kshitijrajsharma commented Sep 23, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants