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

Improve backend tests #92

Closed
sylvanie85 opened this issue Jun 19, 2024 · 1 comment · Fixed by #122
Closed

Improve backend tests #92

sylvanie85 opened this issue Jun 19, 2024 · 1 comment · Fixed by #122
Labels
good first issue Good for newcomers

Comments

@sylvanie85
Copy link
Contributor

sylvanie85 commented Jun 19, 2024

Context

We want to improve backend testing, currently we test each route with a success case and an error case. The current problem is that our tests are dependent of the datastore and each tests commit changes to the database and therefore shouldn't be committed.

Objective

  1. Add module tests to ensure that all functions work independently of the routes.
  2. Making sure that all routes work.
  3. Deleting the entries in the database if some are created

The file test_manage_folders.py is a good start and an example of what we want for route tests.

Acceptance criteria:

  • new module test for datastore functions
  • all routes have a unit test using a mock/patch for datastore functions :
  • an end-to-end test verifies everything
  • coverage must be at least 80% (pytest --cov=. --cov-fail-under=80 tests/ )
@github-project-automation github-project-automation bot moved this to Todo in Nachet Jun 19, 2024
@Francois-Werbrouck Francois-Werbrouck added the good first issue Good for newcomers label Jun 19, 2024
@sylvanie85 sylvanie85 linked a pull request Aug 21, 2024 that will close this issue
@sylvanie85 sylvanie85 moved this from Todo to In Progress in Nachet Aug 22, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Nachet Aug 23, 2024
This was referenced Aug 23, 2024
@sylvanie85
Copy link
Contributor Author

I closed this issue so as not to leave any work pending before I leave (end of my internship). So far, here's what's been done about the issue:

  • new test module to test each datastore function
  • directory routes have a unit test using a mock/patch for datastore functions
  • Required test coverage of 80% reached

I've opened a new issue ( #123 ) that follows this one because there's still a lot of work to be done on route testing with mocks to avoid using the database and Azure storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants