-
Notifications
You must be signed in to change notification settings - Fork 2
Fix #3 - Route Testing #13
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
base: main
Are you sure you want to change the base?
Conversation
Hi, @mansogf ! To make proper tests to user creation I suggest the creation of a route to delete users, so the tests can work more than once. For example the create user test would fail if the user already exists. |
- install sqlalchemy-utils to create and drop database - try to override the get-db, this is popping a lot of errors,we need to fix that
i am trying to make the tests work inside a test database as stated in this discussion: fastapi/full-stack-fastapi-template#125 |
Co-authored-by: Gabriel Tiveron <[email protected]>
and change the user test to try make it work Co-authored-by: Gabriel Tiveron <[email protected]>
so far we make the test database, user route and accuracy-type route are tested, there is more work to do. |
papers route are done |
Hi, @mansogf and @andrewlucasgs ! The majority of routes tests were developed, as well as the test environment. Some routes seems to be test routes, that are not used in the project scope like the util's routes, and others we weren't able to test, like the sota, papers_with_code_itegration and model routes. |
Hi @GabrielTiveron and @aquiles23, what a great work you've done!! The sota and papers_with_code_itegration are used to retrieve data in specif structure. The Sota route serve models data with accuracy_values grouped by task and datasets, so this only work properly if you have inserted in your database, all entities related to this structure. The same happens with papers_with_code_itegration route, as it retrieves data used by paper with code about computing power for each of models. |
ok @andrewlucasgs, how can i populate the models? its POST route aways return 500 status code to me and i don't know what a |
Currently we don't have a post route on models, a model is created after the status of a submission is set to approved by updating it. And task_dataset_id is the identifier of many to many association table between tasks and dastasets. |
- change cpu,tpu,gpu fixture to be in the conftest.py - create model get route test - create submission and model fixture in the conftest.py
@GabrielTiveron @andrewlucasgs we make route tests models, sota, the submission approve flow and paper_with_code_integration. |
@mansogf @andrewlucasgs Hey! All routes are tested and this pull request is ready to be accepted! There are some warnings after running the route tests, but it's related to functions in the development set. The tests developed cover all the routes marked above, and most of them cover success and failure case tests. |
Issue
Related to issue #3
Notes
To begin with, some files were reallocated to let the imports to the test files working well.
In order to run the test set, you just need to run the command
make test
in the root folder.The test environment consists of a new docker-compose file which has a database container without volumes, so the tests can run over and over without leaving data behind. You can also run the test docker to debug tests while developing new routes. To do so, you can run the test docker with the command
sudo docker-compose -f test.docker-compose.yml up
also in the root folder, and then run the tests withsudo docker-compose -f test.docker-compose.yml exec backend-tests pytest
.The routes to be tested are listed below: