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

Database provider tests clean-up #80

Open
dstpierre opened this issue May 10, 2023 · 1 comment
Open

Database provider tests clean-up #80

dstpierre opened this issue May 10, 2023 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@dstpierre
Copy link
Member

There's currently 3 implementations of the Persister database/persister.go interface, which includes all database functions.

Each packages have the same (99%) identical tests code. For instance, cecking the number of lines in the memory's base.go file vs. the mongo's one:

$ wc -l database/memory/base_test.go
406 database/memory/base_test.go
$ wc -l database/mongo/base_test.go
406 database/mongo/base_test.go

Brain storming

  1. Can we remove all this duplication and have one set of test that can tests all implementation?
  2. At the moment I created some entry in the Makefile to target specific database engine implementation, this is useful when implementing a new feature to only run tests for the currently develop provider. I would not want to lose this after no. 1.
@dstpierre dstpierre added help wanted Extra attention is needed good first issue Good for newcomers labels May 10, 2023
@dstpierre dstpierre added this to the v1.6 milestone May 17, 2024
@mbezhanov
Copy link

Hi @dstpierre, I opened a draft PR here (#124) to validate the idea.

If that aligns with your initial thoughts, I'd be happy to prepare that PR for merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants