Skip to content

Add test database and CI integration#121

Open
Javiercerna wants to merge 14 commits into
qAIRa:masterfrom
Javiercerna:tests
Open

Add test database and CI integration#121
Javiercerna wants to merge 14 commits into
qAIRa:masterfrom
Javiercerna:tests

Conversation

@Javiercerna

@Javiercerna Javiercerna commented Oct 10, 2021

Copy link
Copy Markdown

Description

Focus on this two questions:

  1. What is this change?
  • Adds setup isolated tests using a test database: Dockerfile + docker-compose.yml + Makefile
  • Fixes most of the tests, but leaves a TODO in the fixes that might involve changing the database schema or some queries that fail with the current database schema.
  • Adds both Github Actions and CircleCI integrations. For Github Actions, everything is setup automatically if this PR is merged. For CircleCI someone in the qAIRa organization would need to authorize and setup CircleCI using this guide: https://circleci.com/docs/2.0/getting-started/#setting-up-circleci
  • Updates README with section for tests.
  1. Why make this change?
    Fixes API testing without DB interacting #74

Some more specific explanations, @GersonMontesinos:

  • project/test/__init__.py has the objects that are added to the database before running the tests. There are other options (e.g. loading from a database dump), but I decided to keep it this way for now because there are some database schema that you should check and fix first (there are a lot of fields that are nullable=False which shouldn't be, like "flight_end" in the DroneFlightLog table).
  • Regarding Github Actions vs CircleCI, I included both options because I wanted to try both, but I can keep only the one you want to use. I liked Github Actions better because it was integrated on Github, it didn't require any setup or public keys, and the steps are the same that anybody would run in their local machine (the Makefile commands).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Tested with the unit tests running in the Docker setup and the CI integrations (Github Actions & CircleCI)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@Javiercerna

Copy link
Copy Markdown
Author

Hey, @GersonMontesinos, did you have some time to go through this? Please let me know if you have any questions 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API testing without DB interacting

1 participant