Skip to content

Commit 03b3038

Browse files
(fix): update go.mod for semaphore (#172)
* update for semaphore * cleanup processor tests
1 parent b091387 commit 03b3038

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/spf13/cobra v0.0.5
1010
github.com/stretchr/testify v1.4.0
1111
github.com/twmb/murmur3 v1.0.0
12+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
1213
)
1314

1415
// Work around issue wtih git.apache.org/thrift.git

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ github.com/twmb/murmur3 v1.0.0/go.mod h1:5Y5m8Y8WIyucaICVP+Aep5C8ydggjEuRQHDq1ic
4848
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
4949
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
5050
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
51+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
52+
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5153
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
5254
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
5355
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

pkg/event/processor_test.go

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ func TestDefaultEventProcessor_ProcessImpression(t *testing.T) {
6767

6868
func TestCustomEventProcessor_Create(t *testing.T) {
6969
exeCtx := utils.NewCancelableExecutionCtx()
70-
processor := NewBatchEventProcessor(WithEventDispatcher(NewMockDispatcher(100, false)), WithQueueSize(10), WithFlushInterval(100))
70+
processor := NewBatchEventProcessor(
71+
WithEventDispatcher(NewMockDispatcher(100, false)),
72+
WithQueueSize(10),
73+
WithFlushInterval(100))
7174
processor.Start(exeCtx)
7275

7376
impression := BuildTestImpressionEvent()
@@ -85,8 +88,10 @@ func TestCustomEventProcessor_Create(t *testing.T) {
8588

8689
func TestDefaultEventProcessor_LogEventNotification(t *testing.T) {
8790
exeCtx := utils.NewCancelableExecutionCtx()
88-
processor := NewBatchEventProcessor(WithFlushInterval(100), WithQueueSize(100),
89-
WithQueue(NewInMemoryQueue(100)), WithEventDispatcher(NewMockDispatcher(100, false)),
91+
processor := NewBatchEventProcessor(
92+
WithQueueSize(100),
93+
WithQueue(NewInMemoryQueue(100)),
94+
WithEventDispatcher(NewMockDispatcher(100, false)),
9095
WithSDKKey("fakeSDKKey"))
9196

9297
var logEvent LogEvent
@@ -118,7 +123,8 @@ func TestDefaultEventProcessor_LogEventNotification(t *testing.T) {
118123

119124
func TestDefaultEventProcessor_DefaultConfig(t *testing.T) {
120125
exeCtx := utils.NewCancelableExecutionCtx()
121-
processor := NewBatchEventProcessor(WithEventDispatcher(NewMockDispatcher(100, false)))
126+
processor := NewBatchEventProcessor(
127+
WithEventDispatcher(NewMockDispatcher(100, false)))
122128
processor.Start(exeCtx)
123129

124130
impression := BuildTestImpressionEvent()
@@ -321,8 +327,10 @@ func TestBatchEventProcessor_FlushesOnClose(t *testing.T) {
321327

322328
func TestDefaultEventProcessor_ProcessBatchRevisionMismatch(t *testing.T) {
323329
exeCtx := utils.NewCancelableExecutionCtx()
324-
processor := NewBatchEventProcessor(WithQueueSize(100), WithFlushInterval(100),
325-
WithQueue(NewInMemoryQueue(100)), WithEventDispatcher(NewMockDispatcher(100, false)))
330+
processor := NewBatchEventProcessor(
331+
WithQueueSize(100),
332+
WithQueue(NewInMemoryQueue(100)),
333+
WithEventDispatcher(NewMockDispatcher(100, false)))
326334

327335
processor.Start(exeCtx)
328336

@@ -355,8 +363,10 @@ func TestDefaultEventProcessor_ProcessBatchRevisionMismatch(t *testing.T) {
355363

356364
func TestDefaultEventProcessor_ProcessBatchProjectMismatch(t *testing.T) {
357365
exeCtx := utils.NewCancelableExecutionCtx()
358-
processor := NewBatchEventProcessor(WithQueueSize(100), WithFlushInterval(100),
359-
WithQueue(NewInMemoryQueue(100)), WithEventDispatcher(NewMockDispatcher(100, false)))
366+
processor := NewBatchEventProcessor(
367+
WithQueueSize(100),
368+
WithQueue(NewInMemoryQueue(100)),
369+
WithEventDispatcher(NewMockDispatcher(100, false)))
360370

361371
processor.Start(exeCtx)
362372

@@ -389,8 +399,10 @@ func TestDefaultEventProcessor_ProcessBatchProjectMismatch(t *testing.T) {
389399

390400
func TestChanQueueEventProcessor_ProcessImpression(t *testing.T) {
391401
exeCtx := utils.NewCancelableExecutionCtx()
392-
processor := NewBatchEventProcessor(WithQueueSize(100), WithFlushInterval(100),
393-
WithQueue(NewInMemoryQueue(100)), WithEventDispatcher(&HTTPEventDispatcher{}))
402+
processor := NewBatchEventProcessor(
403+
WithQueueSize(100),
404+
WithQueue(NewInMemoryQueue(100)),
405+
WithEventDispatcher(&HTTPEventDispatcher{}))
394406

395407
processor.Start(exeCtx)
396408

0 commit comments

Comments
 (0)