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

Fix compatibility tests #1637

Merged
merged 3 commits into from
May 24, 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
45 changes: 9 additions & 36 deletions test/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ type objectStepConfig[T any] struct {

func TestCompatibilityObjectStoreDefaultBucket(t *testing.T) {
t.Parallel()
nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -85,10 +82,7 @@ func TestCompatibilityObjectStoreDefaultBucket(t *testing.T) {

func TestCompatibilityObjectStoreCustomBucket(t *testing.T) {
t.Parallel()
nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -131,10 +125,7 @@ func TestCompatibilityObjectStoreGetObject(t *testing.T) {
Object string `json:"object"`
}

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -186,10 +177,7 @@ func TestCompatibilityObjectStoreGetObject(t *testing.T) {
func TestCompatibilityObjectStorePutObject(t *testing.T) {
t.Parallel()

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -239,10 +227,7 @@ func TestCompatibilityObjectStorePutObject(t *testing.T) {
func TestCompatibilityObjectStoreUpdateMetadata(t *testing.T) {
t.Parallel()

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -287,10 +272,7 @@ func TestCompatibilityObjectStoreWatch(t *testing.T) {
Object string `json:"object"`
}

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -365,10 +347,7 @@ func TestCompatibilityObjectStoreWatchUpdates(t *testing.T) {
Object string `json:"object"`
}

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -421,10 +400,7 @@ func TestCompatibilityObjectStoreGetLink(t *testing.T) {
Object string `json:"object"`
}

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down Expand Up @@ -481,10 +457,7 @@ func TestCompatibilityObjectStorePutLink(t *testing.T) {
LinkName string `json:"link_name"`
}

nc, err := nats.Connect(nats.DefaultURL, nats.Timeout(1*time.Hour))
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
}
nc := connect(t)
js, err := jetstream.New(nc)
if err != nil {
t.Fatalf("Error connecting to NATS: %v", err)
Expand Down