Skip to content

Commit

Permalink
Add succeeded variable in the e2e result log entry (#8199)
Browse files Browse the repository at this point in the history
  • Loading branch information
d8660091 authored May 22, 2024
1 parent f6a2a83 commit 2576e84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/test/e2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func RunTestsInParallel(conf ParallelRunConf) error {
completedInstances := 0
for r := range results {
var result string
// This variable can be used in cloudwatch log insights query for e2e test success rate
succeeded := 0
// TODO: keeping the old logs temporarily for compatibility with the test tool
// Once the tool is updated to support the unified message, remove them
if r.err != nil {
Expand All @@ -158,6 +160,7 @@ func RunTestsInParallel(conf ParallelRunConf) error {
failedInstances++
} else {
result = testResultPass
succeeded = 1
conf.Logger.Info("Instance tests completed successfully", "jobId", r.conf.JobID, "instanceId", r.conf.InstanceID, "commandId", r.testCommandResult.CommandId, "tests", r.conf.Regex, "status", testResultPass)
}
completedInstances++
Expand All @@ -168,6 +171,7 @@ func RunTestsInParallel(conf ParallelRunConf) error {
"instanceId", r.conf.InstanceID,
"completedInstances", completedInstances,
"totalInstances", totalInstances,
"succeeded", succeeded,
)
putInstanceTestResultMetrics(r)
}
Expand Down

0 comments on commit 2576e84

Please sign in to comment.