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

[Testing] Mock 10% Persistence Module in Utility Tests #261

Closed
5 tasks
andrewnguyen22 opened this issue Sep 30, 2022 · 4 comments
Closed
5 tasks

[Testing] Mock 10% Persistence Module in Utility Tests #261

andrewnguyen22 opened this issue Sep 30, 2022 · 4 comments
Assignees
Labels
code health Nice to have code improvement persistence Persistence specific changes tooling tooling to support development, testing et al utility Utility specific changes

Comments

@andrewnguyen22
Copy link
Contributor

andrewnguyen22 commented Sep 30, 2022

Objective

Mock the Persistence Module for all Utility Testing

Origin Document

The Utility Module relies on the Persistence Module in order to execute all of it's testing:

See

func newTestPersistenceModule(_ *testing.M, databaseUrl string) modules.PersistenceModule {

Under utility/test

Goals

  • Enabling utility tests for persistence business logic that doesn't exist
  • Remove cross module imports in Utility
  • Allow complete encapsulation of test suite in Utility
  • Create a clear and understandable Mock

Deliverable

  • Code complete implementation
  • Plenty of comments in the Mock
  • Updated changelog

Non-goals / Non-deliverables

  • Little nits that have nothing to do with the issue

General issue deliverables

  • Update the appropriate CHANGELOG
  • Update any relevant READMEs (local and/or global)
  • Update any relevant global documentation & references
  • If applicable, update the source code tree explanation
  • If applicable, add or update a state, sequence or flowchart diagram using mermaid

[Optional] Testing Methodology

  • _REPLACE_ME: Make sure to update the testing methodology appropriately_
  • Task specific tests: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @andrewnguyen22

@andrewnguyen22 andrewnguyen22 added the code health Nice to have code improvement label Sep 30, 2022
@Olshansk Olshansk changed the title [TECHDEBT] Mock Persistence Module in Utility Tests [Testing] Mock Persistence Module in Utility Tests Oct 5, 2022
@Olshansk Olshansk added utility Utility specific changes tooling tooling to support development, testing et al persistence Persistence specific changes labels Oct 5, 2022
@Olshansk
Copy link
Member

Olshansk commented Oct 6, 2022

Idea posted in #290 as a starting point for a discussion.

@jessicadaugherty jessicadaugherty changed the title [Testing] Mock Persistence Module in Utility Tests [Testing] Mock 10% Persistence Module in Utility Tests Oct 19, 2022
@Olshansk
Copy link
Member

I scrapped the first iteration of the idea (using a passthrough) and submitted a second one (using mocks only). Looking for preliminary feedback to see if it meets the requirements of the ticket before I put more effort into it

@Olshansk
Copy link
Member

See #290 as a reference for future iterations on this work

@Olshansk
Copy link
Member

We have been using the persistence module directly for utility tests, so am closing this out until we refactor the test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Nice to have code improvement persistence Persistence specific changes tooling tooling to support development, testing et al utility Utility specific changes
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants