From 5db5371075d7146bc36c5b0360ee23f371bd9792 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 18 Oct 2024 15:02:31 +0200 Subject: [PATCH] fix: set empty `reports` on Execution update (#5947) --- pkg/repository/testworkflow/mongo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/repository/testworkflow/mongo.go b/pkg/repository/testworkflow/mongo.go index 94ef6dffe9..ab509596b0 100644 --- a/pkg/repository/testworkflow/mongo.go +++ b/pkg/repository/testworkflow/mongo.go @@ -280,6 +280,9 @@ func (r *MongoRepository) Insert(ctx context.Context, result testkube.TestWorkfl func (r *MongoRepository) Update(ctx context.Context, result testkube.TestWorkflowExecution) (err error) { result.EscapeDots() + if result.Reports == nil { + result.Reports = []testkube.TestWorkflowReport{} + } _, err = r.Coll.ReplaceOne(ctx, bson.M{"id": result.Id}, result) return }