Skip to content

Commit

Permalink
[FIXED] Object Store compatibility tests (#1637)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
  • Loading branch information
Jarema authored May 24, 2024
1 parent 1ffb3ac commit 41975ba
Showing 1 changed file with 9 additions and 36 deletions.
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

0 comments on commit 41975ba

Please sign in to comment.