Skip to content

Commit

Permalink
Merge branch 'master' into adjust-cqrs-example
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak authored Jan 8, 2025
2 parents 7ae8f02 + 7ff9f49 commit 451c107
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
required: false
type: boolean
default: false
runs-on:
required: false
type: string
default: 'ubuntu-latest'
secrets:
codecov_token:
required: false
Expand All @@ -34,7 +38,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
tests:
needs: [build]
runs-on: ubuntu-latest
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand All @@ -50,7 +54,7 @@ jobs:
- run: make test_stress
if: ${{ inputs.stress-tests }}
codecov:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runs-on }}
if: ${{ inputs.codecov }}
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 4 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ignore:
comment: no # do not comment PR with the result

coverage:
project:
precision: 0
status:
patch: false # do not run coverage on patch nor changes
project:
default:
target: auto
threshold: 5%
status:
patch: false # do not run coverage on patch nor changes
10 changes: 8 additions & 2 deletions components/cqrs/command_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ func TestCommandProcessor_multiple_same_command_handlers(t *testing.T) {
}

type mockSubscriber struct {
MessagesToSend []*message.Message
out chan *message.Message
MessagesToSend []*message.Message
WaitForAckBeforeSendingNext bool

out chan *message.Message
}

func (m *mockSubscriber) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error) {
Expand All @@ -188,6 +190,10 @@ func (m *mockSubscriber) Subscribe(ctx context.Context, topic string) (<-chan *m
go func() {
for _, msg := range m.MessagesToSend {
m.out <- msg

if m.WaitForAckBeforeSendingNext {
<-msg.Acked()
}
}
}()

Expand Down
1 change: 1 addition & 0 deletions components/cqrs/event_processor_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func TestEventProcessor_handler_group(t *testing.T) {
msg1,
msg2,
},
WaitForAckBeforeSendingNext: true,
}

var handlersCalls []int
Expand Down

0 comments on commit 451c107

Please sign in to comment.