Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run integration tests in parallel #72

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

func Test_Should_Consume_Exception_Message_Successfully(t *testing.T) {
// Given
t.Parallel()
topic := "exception"
_, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand Down Expand Up @@ -59,6 +60,7 @@ func Test_Should_Consume_Exception_Message_Successfully(t *testing.T) {

func Test_Should_Retry_Message_When_Error_Occurred_During_Consuming(t *testing.T) {
// Given
t.Parallel()
topic := "exception-oneRetry"
conn, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand Down Expand Up @@ -104,6 +106,7 @@ func Test_Should_Retry_Message_When_Error_Occurred_During_Consuming(t *testing.T

func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value(t *testing.T) {
// Given
t.Parallel()
topic := "exception-max-retry"
conn, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand All @@ -115,7 +118,7 @@ func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value(t
GroupID: "sample-consumer",
Topic: topic,
Cron: "*/1 * * * *",
Duration: 20 * time.Second,
Duration: 10 * time.Second,
MaxRetry: maxRetry,
},
LogLevel: "info",
Expand Down Expand Up @@ -156,6 +159,7 @@ func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value(t

func Test_Should_Send_DeadLetter_Topic_When_Retry_Count_Is_Equal_To_MaxRetrys_Value(t *testing.T) {
// Given
t.Parallel()
topic := "exception-max-retry-for-deadletter"
_, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand All @@ -171,7 +175,7 @@ func Test_Should_Send_DeadLetter_Topic_When_Retry_Count_Is_Equal_To_MaxRetrys_Va
GroupID: "sample-consumer",
Topic: topic,
Cron: "*/1 * * * *",
Duration: 20 * time.Second,
Duration: 10 * time.Second,
MaxRetry: maxRetry,
DeadLetterTopic: deadLetterTopic,
},
Expand Down Expand Up @@ -213,6 +217,7 @@ func Test_Should_Send_DeadLetter_Topic_When_Retry_Count_Is_Equal_To_MaxRetrys_Va

func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value_With_Linear_BackOff_Strategy(t *testing.T) {
// Given
t.Parallel()
topic := "exception-max-retry-with-linear-backoff"
conn, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand Down Expand Up @@ -291,6 +296,7 @@ func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value_Wi

func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value_With_Exponential_BackOff_Strategy(t *testing.T) {
// Given
t.Parallel()
topic := "exception-max-retry-with-exponential-backoff"
conn, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand Down Expand Up @@ -381,13 +387,14 @@ func Test_Should_Discard_Message_When_Retry_Count_Is_Equal_To_MaxRetrys_Value_Wi
}

if retryAttemptCount != 8 {
t.Fatalf("Retry attemp count must be 8")
t.Fatalf("Retry attempt count must be 8")
}
assertEventually(t, conditionFunc, 30*time.Second, time.Second)
}

func Test_Should_Discard_Message_When_Header_Filter_Defined(t *testing.T) {
// Given
t.Parallel()
topic := "exception-header-filter"
_, cleanUp := createTopic(t, topic)
defer cleanUp()
Expand Down
Loading