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

Avoid reporting empty version_info for components that just started #5333

Merged
Changes from all 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
19 changes: 13 additions & 6 deletions testing/integration/package_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,26 @@ func TestComponentBuildHashInDiagnostics(t *testing.T) {
}

for _, c := range status.Components {
bs, err := json.MarshalIndent(status, "", " ")
if err != nil {
stateBuff.WriteString(fmt.Sprintf("%s not health, could not marshal status outptu: %v",
c.Name, err))
return false
}

state := client.State(c.State)
if state != client.Healthy {
bs, err := json.MarshalIndent(status, "", " ")
if err != nil {
stateBuff.WriteString(fmt.Sprintf("%s not health, could not marshal status outptu: %v",
c.Name, err))
return false
}

stateBuff.WriteString(fmt.Sprintf("%s not health, agent status output: %s",
c.Name, bs))
return false
}

if c.VersionInfo.Meta.Commit == "" {
stateBuff.WriteString(fmt.Sprintf("%s health, but no versionInfo. agent status output: %s",
c.Name, bs))
return false
}
}

return true
Expand Down