updated mongo driver dependencies to v2
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m27s

This commit is contained in:
2026-04-21 12:11:38 +02:00
parent 84b87d61f2
commit 0c37dd5576
36 changed files with 187 additions and 582 deletions
+14 -15
View File
@@ -3,10 +3,9 @@ package exerr
import (
"context"
"encoding/json"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
"go.mongodb.org/mongo-driver/v2/bson"
"go.mongodb.org/mongo-driver/v2/mongo"
"testing"
"time"
)
@@ -57,7 +56,7 @@ func TestBSONMarshalErrorCategory(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 350*time.Millisecond)
defer cancel()
client, err := mongo.Connect(ctx)
client, err := mongo.Connect()
if err != nil {
t.Skip("Skip test - no local mongo found")
return
@@ -68,7 +67,7 @@ func TestBSONMarshalErrorCategory(t *testing.T) {
return
}
primimd := primitive.NewObjectID()
primimd := bson.NewObjectID()
_, err = client.Database("_test").Collection("goext-cicd").InsertOne(ctx, bson.M{"_id": primimd, "val": CatSystem})
tst.AssertNoErr(t, err)
@@ -76,8 +75,8 @@ func TestBSONMarshalErrorCategory(t *testing.T) {
cursor := client.Database("_test").Collection("goext-cicd").FindOne(ctx, bson.M{"_id": primimd, "val": bson.M{"$type": "string"}})
var c1 struct {
ID primitive.ObjectID `bson:"_id"`
Val ErrorCategory `bson:"val"`
ID bson.ObjectID `bson:"_id"`
Val ErrorCategory `bson:"val"`
}
err = cursor.Decode(&c1)
@@ -90,7 +89,7 @@ func TestBSONMarshalErrorSeverity(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 350*time.Millisecond)
defer cancel()
client, err := mongo.Connect(ctx)
client, err := mongo.Connect()
if err != nil {
t.Skip("Skip test - no local mongo found")
return
@@ -101,7 +100,7 @@ func TestBSONMarshalErrorSeverity(t *testing.T) {
return
}
primimd := primitive.NewObjectID()
primimd := bson.NewObjectID()
_, err = client.Database("_test").Collection("goext-cicd").InsertOne(ctx, bson.M{"_id": primimd, "val": SevErr})
tst.AssertNoErr(t, err)
@@ -109,8 +108,8 @@ func TestBSONMarshalErrorSeverity(t *testing.T) {
cursor := client.Database("_test").Collection("goext-cicd").FindOne(ctx, bson.M{"_id": primimd, "val": bson.M{"$type": "string"}})
var c1 struct {
ID primitive.ObjectID `bson:"_id"`
Val ErrorSeverity `bson:"val"`
ID bson.ObjectID `bson:"_id"`
Val ErrorSeverity `bson:"val"`
}
err = cursor.Decode(&c1)
@@ -123,7 +122,7 @@ func TestBSONMarshalErrorType(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 350*time.Millisecond)
defer cancel()
client, err := mongo.Connect(ctx)
client, err := mongo.Connect()
if err != nil {
t.Skip("Skip test - no local mongo found")
return
@@ -134,7 +133,7 @@ func TestBSONMarshalErrorType(t *testing.T) {
return
}
primimd := primitive.NewObjectID()
primimd := bson.NewObjectID()
_, err = client.Database("_test").Collection("goext-cicd").InsertOne(ctx, bson.M{"_id": primimd, "val": TypeNotImplemented})
tst.AssertNoErr(t, err)
@@ -142,8 +141,8 @@ func TestBSONMarshalErrorType(t *testing.T) {
cursor := client.Database("_test").Collection("goext-cicd").FindOne(ctx, bson.M{"_id": primimd, "val": bson.M{"$type": "string"}})
var c1 struct {
ID primitive.ObjectID `bson:"_id"`
Val ErrorType `bson:"val"`
ID bson.ObjectID `bson:"_id"`
Val ErrorType `bson:"val"`
}
err = cursor.Decode(&c1)