diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-24 00:34:57 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-25 15:18:12 +0200 |
commit | 57b41ad766b3c4505672c12f058f10c7a132dd5b (patch) | |
tree | 80aea95babc8f740e86dadc7469236bdffc78c26 /pkg/worker/list_processor_test.go | |
parent | d5261d7f121985f13f9d19e9efd5c2ae3d4b5609 (diff) | |
download | lens-57b41ad766b3c4505672c12f058f10c7a132dd5b.tar.gz lens-57b41ad766b3c4505672c12f058f10c7a132dd5b.tar.bz2 lens-57b41ad766b3c4505672c12f058f10c7a132dd5b.zip |
feat: Remove unnecessary function
Diffstat (limited to 'pkg/worker/list_processor_test.go')
-rw-r--r-- | pkg/worker/list_processor_test.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pkg/worker/list_processor_test.go b/pkg/worker/list_processor_test.go index 1e4ed2d..35672f3 100644 --- a/pkg/worker/list_processor_test.go +++ b/pkg/worker/list_processor_test.go @@ -10,6 +10,7 @@ import ( "testing" "git.sr.ht/~gabrielgio/img/pkg/testkit" + "github.com/sirupsen/logrus" ) type ( @@ -24,10 +25,13 @@ type ( ) func TestListProcessorLimit(t *testing.T) { - mock := &mockCounterListProcessor{ - countTo: 10000, - } - worker := NewWorkerFromListProcessor[int](mock, nil) + var ( + log = logrus.New() + scheduler = NewScheduler(1) + mock = &mockCounterListProcessor{countTo: 10000} + ) + + worker := NewWorkerFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) err := worker.Start(context.Background()) testkit.TestFatalError(t, "Start", err) @@ -36,8 +40,13 @@ func TestListProcessorLimit(t *testing.T) { } func TestListProcessorContextCancelQuery(t *testing.T) { - mock := &mockContextListProcessor{} - worker := NewWorkerFromListProcessor[int](mock, nil) + var ( + log = logrus.New() + scheduler = NewScheduler(1) + mock = &mockContextListProcessor{} + ) + + worker := NewWorkerFromBatchProcessor[int](mock, scheduler, log.WithField("context", "testing")) ctx, cancel := context.WithCancel(context.Background()) var wg sync.WaitGroup |