-
Notifications
You must be signed in to change notification settings - Fork 2
Unit Integration Test Coverage
Braden Michelson edited this page Jun 2, 2021
·
7 revisions
Backend testing file: backend/testing.py
Tests are run by running the main function in testing.py. When the testing file is run:
- An empty mock database is created.
- Through GraphQL API calls, mock users and groups are made.
- These users and groups are then used to test most of the GraphQL mutations (ex: post art or leave group)
Backend coverage report (using coverage.py package: https://coverage.readthedocs.io/en/coverage-5.5/):
Name | Stmts | Miss | Cover |
---|---|---|---|
api_types.py | 45 | 0 | 100% |
models.py | 69 | 0 | 100% |
mutations.py | 388 | 101 | 74% |
schema.py | 31 | 0 | 100% |
In creating the mock database, all of the api_types.py, models.py, and schema.py files are covered. We are missing coverage for 26% of the mutations.py. This means that we check most of the functionality of our backend with some special cases missing. With that said, in our current version we have not been able to trigger any backend bugs from the frontend.