File tree 1 file changed +10
-8
lines changed
pkg/repository/testworkflow
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -353,20 +353,22 @@ func (r *MongoRepository) GetExecutionsSummary(ctx context.Context, filter Filte
353
353
}
354
354
355
355
func (r * MongoRepository ) Insert (ctx context.Context , result testkube.TestWorkflowExecution ) (err error ) {
356
- result .EscapeDots ()
357
- if result .Reports == nil {
358
- result .Reports = []testkube.TestWorkflowReport {}
356
+ execution := result .Clone ()
357
+ execution .EscapeDots ()
358
+ if execution .Reports == nil {
359
+ execution .Reports = []testkube.TestWorkflowReport {}
359
360
}
360
- _ , err = r .Coll .InsertOne (ctx , result )
361
+ _ , err = r .Coll .InsertOne (ctx , execution )
361
362
return
362
363
}
363
364
364
365
func (r * MongoRepository ) Update (ctx context.Context , result testkube.TestWorkflowExecution ) (err error ) {
365
- result .EscapeDots ()
366
- if result .Reports == nil {
367
- result .Reports = []testkube.TestWorkflowReport {}
366
+ execution := result .Clone ()
367
+ execution .EscapeDots ()
368
+ if execution .Reports == nil {
369
+ execution .Reports = []testkube.TestWorkflowReport {}
368
370
}
369
- _ , err = r .Coll .ReplaceOne (ctx , bson.M {"id" : result .Id }, result )
371
+ _ , err = r .Coll .ReplaceOne (ctx , bson.M {"id" : execution .Id }, execution )
370
372
return
371
373
}
372
374
You can’t perform that action at this time.
0 commit comments