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

Write Database Connection Setup Code For TestDB #1689

Closed
4 tasks
elraphty opened this issue Jun 13, 2024 · 0 comments · Fixed by #1691
Closed
4 tasks

Write Database Connection Setup Code For TestDB #1689

elraphty opened this issue Jun 13, 2024 · 0 comments · Fixed by #1691
Assignees
Labels

Comments

@elraphty
Copy link
Contributor

Context

We currently have a database connection setup for the production database in db/config.go, the config.go file has the initDB function which connects to the Database, and migrates the database tables schemas.

Design

We want to create a new file in the db folder test_config.go which will connect to the test DB and migrate the table schemas for the test DB.

Create a new global variable TestDB in test_config.go with the type of database, and set TestDB.db to the Test Database connection, the db.TestDB will be used to replace the mocked databases in the test handlers.

Acceptance Criteria

  • I've tested on Chrome
  • I've created a test that...
  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 1 day of taking the bounty

Here is an example backend test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant