-
Notifications
You must be signed in to change notification settings - Fork 33
[TECHDEBT] [Persistence] Fix Persistence Module TODOs - Golang Test Cleanup & Teardown #208
Copy link
Copy link
Closed
Labels
code healthNice to have code improvementNice to have code improvementcoreCore infrastructure - protocol relatedCore infrastructure - protocol relatedcore starter taskGood for newcomers, but aimed at core team members though still open for everyoneGood for newcomers, but aimed at core team members though still open for everyonepersistencePersistence specific changesPersistence specific changes
Milestone
Description
Objective
A general cleanup issue is needed to tackle TODO's and ensure the persistence module is usable/readable by refactoring golang-specific Golang test cleanup & teardown as part of #172 and #149.
Origin Document
Should follow issue-#128, issue-#105, issue-#147 and issue-#148 the persistence module is messier and more difficult to understand than the developers would want for organic external contribution.
Goals / Deliverables
- Implement golang-specific Golang test cleanup & teardown.
For example, the usage of:
func CleanupTest() {
PostgresDB.Tx.Rollback(context.TODO())
PersistenceModule.Stop()
}Can be refactored to something like this:
func NewTestingUtilityContext(t *testing.T, height int64) utility.UtilityContext {
...
t.Cleanup(func() {
ctx.Context.Release() // TODO (team) need a golang specific solution for teardown
PostgresDB.Tx.Rollback(context.TODO())
PersistenceModule.Stop()
})
...
return &UtilityContext{...General issue checklist
- Update the appropriate CHANGELOG
- Update the README
- If applicable, update the source code tree explanation
- If applicable, add or update a state, sequence or flowchart diagram using mermaid
- Update any relevant global documentation & references
- Document small issues / TODOs along the way
Creator: @andrewnguyen22
Co-creator: @Olshansk
Reactions are currently unavailable
Metadata
Metadata
Labels
code healthNice to have code improvementNice to have code improvementcoreCore infrastructure - protocol relatedCore infrastructure - protocol relatedcore starter taskGood for newcomers, but aimed at core team members though still open for everyoneGood for newcomers, but aimed at core team members though still open for everyonepersistencePersistence specific changesPersistence specific changes
Type
Projects
Status
Done