Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

db.py: Add tests and improve consistency #62

Merged
merged 8 commits into from
Jun 4, 2018

Conversation

major
Copy link
Contributor

@major major commented May 31, 2018

Work in progress.

@major major added the enhancement New feature or request label May 31, 2018
@major major self-assigned this May 31, 2018
@major major force-pushed the testing-db-module branch 4 times, most recently from b3f8436 to 34953f2 Compare May 31, 2018 21:56
@cki-project cki-project deleted a comment from codecov bot May 31, 2018
@major
Copy link
Contributor Author

major commented May 31, 2018

This gets us to about 50% coverage on db.py.

@codecov
Copy link

codecov bot commented Jun 1, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7ec0926). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #62   +/-   ##
=========================================
  Coverage          ?   36.07%           
=========================================
  Files             ?        6           
  Lines             ?     1034           
  Branches          ?        0           
=========================================
  Hits              ?      373           
  Misses            ?      661           
  Partials          ?        0
Impacted Files Coverage Δ
tests/test_db.py 100% <100%> (ø)
tests/test_init.py 100% <100%> (ø)
sktm/db.py 50% <100%> (ø)

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 7ec0926...833d685. Read the comment docs.

@major major force-pushed the testing-db-module branch 6 times, most recently from a2e9e0f to 7498efd Compare June 1, 2018 20:26
@major major changed the title [WIP] Refactor/Test db module Database: Add tests and improve consistency Jun 1, 2018
@major major closed this Jun 1, 2018
@major major deleted the testing-db-module branch June 1, 2018 20:29
@major major restored the testing-db-module branch June 1, 2018 20:29
@major major deleted the testing-db-module branch June 1, 2018 20:29
@major major restored the testing-db-module branch June 1, 2018 20:29
@major major reopened this Jun 1, 2018
@major major force-pushed the testing-db-module branch 3 times, most recently from 8cdb7ed to f0251e6 Compare June 1, 2018 21:51
@major
Copy link
Contributor Author

major commented Jun 1, 2018

100% test coverage for db.py!

@major major changed the title Database: Add tests and improve consistency db.py: Add tests and improve consistency Jun 1, 2018
@major major force-pushed the testing-db-module branch 2 times, most recently from 71fdd07 to ce3f336 Compare June 4, 2018 14:33
major added 8 commits June 4, 2018 11:46
Create another method, `create_repoid()` that inserts a new repoid
into the database. Fix comments to meet pydocstyle requirements.

Signed-off-by: Major Hayden <major@redhat.com>
Separate the sourceid creation into the `create_sourceid()` method
and ensure comments meet pydocstyle requirements.

Signed-off-by: Major Hayden <major@redhat.com>
Ensure all methods are using consistent arguments that are easier
to read and understand. Fix comments to meet pydocstyle requirements
and fully explain arguments/returns.

Signed-off-by: Major Hayden <major@redhat.com>
Fixes cki-project#65.

Signed-off-by: Major Hayden <major@redhat.com>
Signed-off-by: Major Hayden <major@redhat.com>
Signed-off-by: Major Hayden <major@redhat.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 203

  • 436 of 436 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+30.4%) to 53.834%

Totals Coverage Status
Change from base Build 202: 30.4%
Covered Lines: 681
Relevant Lines: 1265

💛 - Coveralls

Copy link
Contributor

@dzickusrh dzickusrh left a comment

Choose a reason for hiding this comment

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

Most of the db.py change is cosmetic. The tests are lengthy and just validate the thin db calls, so most tests are obvious. Reading the db.py function makes one scratch their heads if it is doing the right thing, but we can't blame the tests for that.

@dzickusrh dzickusrh merged commit 47a0572 into cki-project:master Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants