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

tests: improve coverage to 82% #19

Merged
merged 5 commits into from
Jun 6, 2022
Merged

Conversation

kylejb
Copy link
Member

@kylejb kylejb commented Jun 5, 2022

Description

  • Improve coverage.
  • Create test database when PYTHON_ENV=test when running alembic migration head.
  • Create Database class to abstract connection and session.
  • Fix schemas to support seeding of data with geom and location column as type string.
  • Enable VSCode debugger with FastAPI server.
  • Create issue to investigate best approach to resetting DB for testing.

Documentation

New commands:

  • Run pytest --cov to generate coverage report in CLI.
  • Run ./scripts/test.sh to generate coverage report

TODOs

Please ensure all of these TODOs are completed before asking for a review.

  • Ensure the branch is named correctly with the issue number. e.g: feat/310-new-endpoint or bug/322-fix-missing-param.
  • Update the docs.
  • Keep the changes backward compatible where possible.
  • Run the pre-commit checks successfully.
  • Run the relevant tests successfully.

Related Issues

Closes #15

@kylejb kylejb added chore enhancement Improvements or additions to existing feature dependencies Pull requests that update a dependency file labels Jun 5, 2022
@kylejb kylejb force-pushed the feat/15-improve-test-coverage branch from 1feb0e1 to 6e7bcc3 Compare June 5, 2022 13:49
@kylejb kylejb marked this pull request as ready for review June 5, 2022 13:52
@kylejb kylejb requested a review from a team June 5, 2022 13:52
@kylejb kylejb force-pushed the feat/15-improve-test-coverage branch 3 times, most recently from b57176c to a09a67b Compare June 5, 2022 21:18
@kylejb kylejb temporarily deployed to test June 6, 2022 04:20 Inactive
Grieze
Grieze previously approved these changes Jun 6, 2022
@Grieze
Copy link
Collaborator

Grieze commented Jun 6, 2022

LGTM!

* deps: add pytest-cov and update all

* feat: script to drop and create test db with postgis

* fix: event loop runtime error with db singleton

* fix(dockerfile): set coverage threshold to 80%

* fix(schemas): allow geom as str when seeding

* chore(server): add launch config for debugger process
@kylejb kylejb force-pushed the feat/15-improve-test-coverage branch from f4b3313 to cb4f8b4 Compare June 6, 2022 18:46
@kylejb kylejb temporarily deployed to test June 6, 2022 18:46 Inactive
@kylejb kylejb requested a review from Grieze June 6, 2022 18:48
@kylejb kylejb merged commit be37925 into main Jun 6, 2022
@kylejb kylejb deleted the feat/15-improve-test-coverage branch June 6, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement Improvements or additions to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve testing coverage to at least 80%
2 participants