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: do not store output in test suite execution result #4409

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 12 additions & 0 deletions pkg/api/v1/testkube/model_test_suite_execution_extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,15 @@ func (e *TestSuiteExecution) EscapeDots() *TestSuiteExecution {
func (e *TestSuiteExecution) UnscapeDots() *TestSuiteExecution {
return e.convertDots(utils.UnescapeDots)
}

nicufk marked this conversation as resolved.
Show resolved Hide resolved
func (e *TestSuiteExecution) CleanStepsOutput() *TestSuiteExecution {
for i := range e.StepResults {
if e.StepResults[i].Execution != nil && e.StepResults[i].Execution.ExecutionResult != nil {
e.StepResults[i].Execution.ExecutionResult.Output = ""
nicufk marked this conversation as resolved.
Show resolved Hide resolved
for j := range e.ExecuteStepResults[i].Execute {
e.ExecuteStepResults[i].Execute[j].Execution.ExecutionResult.Output = ""
nicufk marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
return e
}
2 changes: 2 additions & 0 deletions pkg/repository/testresult/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ func (r *MongoRepository) GetExecutions(ctx context.Context, filter Filter) (res

func (r *MongoRepository) Insert(ctx context.Context, result testkube.TestSuiteExecution) (err error) {
result.EscapeDots()
result.CleanStepsOutput()
_, err = r.Coll.InsertOne(ctx, result)
return
}

func (r *MongoRepository) Update(ctx context.Context, result testkube.TestSuiteExecution) (err error) {
result.EscapeDots()
result.CleanStepsOutput()
_, err = r.Coll.ReplaceOne(ctx, bson.M{"id": result.Id}, result)
return
}
Expand Down
Loading