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

[storage] Interface Refactor + Test Cleanup #254

Merged
merged 30 commits into from
Nov 30, 2020

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Nov 27, 2020

To make it easier to test modules, we've decided to refactor the storage package into storage/database and storage/modules. This allows us to use generated mocks when testing storage/modules (removes a circular dependency that prohibited use of interfaces defined in storage) instead of relying on hand-rolled mocks 🤮 .

This PR adds no new functionality!

Changes

  • refactor storage into database, modules, encoder, and errors
  • fix existing tests from refactor
  • use mocks for tests instead of hand-rolled mocks
    • BalanceStorage
    • BroadcastStorage
    • CoinStorage
  • fix import ordering
    • run goimports-reviser in check-gen

@coveralls
Copy link

coveralls commented Nov 27, 2020

Pull Request Test Coverage Report for Build 12479

  • 87 of 313 (27.8%) changed or added relevant lines in 11 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 78.203%

Changes Missing Coverage Covered Lines Changed/Added Lines %
storage/modules/balance_storage.go 11 12 91.67%
storage/database/badger_database_configuration.go 4 6 66.67%
storage/modules/counter_storage.go 0 2 0.0%
storage/modules/coin_storage.go 11 32 34.38%
storage/modules/key_storage.go 5 29 17.24%
storage/database/badger_database.go 13 40 32.5%
storage/modules/broadcast_storage.go 1 32 3.13%
storage/modules/job_storage.go 4 37 10.81%
storage/modules/block_storage.go 30 65 46.15%
storage/encoder/encoder.go 0 50 0.0%
Totals Coverage Status
Change from base Build 12213: -0.4%
Covered Lines: 7771
Relevant Lines: 9937

💛 - Coveralls

@patrick-ogrady patrick-ogrady changed the title [WIP][storage] Interface Refactor [WIP][storage] Interface Refactor + Test Cleanup Nov 30, 2020
@patrick-ogrady patrick-ogrady changed the title [WIP][storage] Interface Refactor + Test Cleanup [storage] Interface Refactor + Test Cleanup Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants