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

Knollfear/live db tests #3452

Merged
merged 15 commits into from
Sep 20, 2021
Merged

Knollfear/live db tests #3452

merged 15 commits into from
Sep 20, 2021

Conversation

knollfear
Copy link
Contributor

@knollfear knollfear commented Aug 31, 2021

resolves #3451

Description-
This connects the unit tests to a db during execution.

This pull request changes...

  • unit tests can be run inside docker with the script "unit-test.sh" in the api directory
  • unit tests can be run locally (using docker as the DB) as normal as long as the db is running and configured
  • local DB can be configured by running "setup-test-db.sh" and following the instructions

This pull request also touches…

  • none, this is test code only

This pull request was tested in the follow ways…

  • unit tests complete and do not hang

Steps to manually verify this change...

  1. run unit-test.sh
  2. edit db/knex.test.js to include the test
  3. run unit-test.sh again
  4. execute "setup-test-db.sh" and follow the instructions
  5. run npm run test
  6. stop the db container
  7. run npm run test and it should finish, but fail
  8. restart the db and it will work again

Wiki was updated as well https://github.com/CMSgov/eAPD/wiki/Development-accessibility,-testing,-and-linting

This pull request is ready to review when...

  • Automated tests are updated (and all tests are passing)
  • The change has been documented
  • Associated OpenAPI documentation has been updated
  • Changelog is updated as appropriate
  • The experience passes a basic manual accessibility audit (keyboard nav, screenreader, text scaling) OR an exemption is documented

This pull request can be merged when…

  • Code has been reviewed by someone other than the original author
  • QA has verified the accessibility and functionality related to the change
  • Design has approved the experience
  • Product has approved the experience

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2021

Codecov Report

Merging #3452 (255752e) into development (26b43dd) will increase coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #3452      +/-   ##
===============================================
+ Coverage        88.53%   88.79%   +0.26%     
===============================================
  Files              284      284              
  Lines             5616     5616              
  Branches          1073     1073              
===============================================
+ Hits              4972     4987      +15     
+ Misses             591      576      -15     
  Partials            53       53              
Impacted Files Coverage Δ
api/middleware/errorHandler.js 80.95% <0.00%> (-9.53%) ⬇️
api/files/local.js 100.00% <0.00%> (+80.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26b43dd...255752e. Read the comment docs.

@cms-eapd-bot
Copy link

cms-eapd-bot commented Sep 2, 2021

This deploy was cleaned up.

Copy link
Contributor

@cthulhuplus cthulhuplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ran locally and Knoll explained my comment.

@knollfear knollfear merged commit aa1f515 into development Sep 20, 2021
@knollfear knollfear deleted the knollfear/live-db-tests branch September 20, 2021 21:09
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.

Connect Unit tests to a test database
4 participants