Skip to content

Commit

Permalink
Improve integration test query.
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscovalentecastro committed Jun 29, 2023
1 parent 26f18a2 commit df75c05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion integration_test/ops_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3001,8 +3001,14 @@ func TestLoggingSelfLogs(t *testing.T) {
if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "ops-agent-fluent-bit", time.Hour, `severity="INFO"`); err != nil {
t.Error(err)
}

pkgVersion, err := agents.FetchPackageVersions(ctx, logger.ToMainLog(), vm, []agents.AgentPackage{agents.OpsPackage});
if err != nil {
t.Error(err)
}

if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "ops-agent-health", time.Hour, `severity="INFO" AND labels"agent.googleapis.com/health/agentKind"="ops-agent" AND labels"agent.googleapis.com/health/schemaVersion"="v1"`); err != nil {
query := fmt.Sprintf(`severity="INFO" AND labels."agent.googleapis.com/health/agentKind"="ops-agent" AND labels."agent.googleapis.com/health/agentVersion"="%s" AND labels."agent.googleapis.com/health/schemaVersion"="v1"`, pkgVersion[agents.OpsPackage])
if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "ops-agent-health", time.Hour, query); err != nil {
t.Error(err)
}
})
Expand Down

0 comments on commit df75c05

Please sign in to comment.