Internal state persistence (#27)
Badges / coveralls (push) Successful in 1m4s

Allow us to generate year over year reports without having to rerun everything from the beginning.

Co-authored-by: Natercio Moniz <[email protected]>
This commit was merged in pull request #27.
This commit is contained in:
2026-08-03 00:33:06 +01:00
committed by natercio
parent 1ce8561782
commit 9bd4230ff1
25 changed files with 1726 additions and 178 deletions
+4 -5
View File
@@ -1,7 +1,6 @@
package internal_test
import (
"context"
"sync"
"testing"
"time"
@@ -91,7 +90,7 @@ func TestAggregatorWriter_Write(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
aw := &internal.AggregatorWriter{}
ctx := context.Background()
ctx := t.Context()
for _, item := range tt.items {
if err := aw.Write(ctx, item); err != nil {
@@ -191,7 +190,7 @@ func TestAggregatorWriter_Rounding(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
aw := &internal.AggregatorWriter{}
ctx := context.Background()
ctx := t.Context()
for _, item := range tt.items {
if err := aw.Write(ctx, item); err != nil {
@@ -209,7 +208,7 @@ func TestAggregatorWriter_Rounding(t *testing.T) {
func TestAggregatorWriter_Items(t *testing.T) {
aw := &internal.AggregatorWriter{}
ctx := context.Background()
ctx := t.Context()
for range 5 {
item := internal.ReportItem{Symbol: "TEST"}
@@ -241,7 +240,7 @@ func TestAggregatorWriter_Items(t *testing.T) {
func TestAggregatorWriter_ThreadSafety(t *testing.T) {
aw := &internal.AggregatorWriter{}
ctx := context.Background()
ctx := t.Context()
numGoroutines := 100
writesPerGoroutine := 100