Skip to content

feat(coderd/healthcheck): improve detection of STUN issues #12951

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

Merged
merged 13 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup! remove auto-summarization for now
  • Loading branch information
johnstcn committed Apr 15, 2024
commit 0c3a1e6818e9ee05dfacbefc3a68caf3b16502fd
74 changes: 0 additions & 74 deletions support/support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,77 +248,3 @@ func assertNotNilNotEmpty[T any](t *testing.T, v T, msg string) {
assert.NotEmpty(t, v, msg+" but was empty")
}
}

func Test_Summarize(t *testing.T) {
t.Parallel()
for _, tt := range []struct {
name string
in support.Bundle
expected []string
}{
{
name: "empty",
in: support.Bundle{},
expected: []string{"Netcheck missing from bundle!"},
},
{
name: "warnings",
in: support.Bundle{
Network: support.Network{
Netcheck: &derphealth.Report{
Warnings: []health.Message{
{Code: "TEST", Message: "test"},
},
},
},
Deployment: support.Deployment{
HealthReport: &healthsdk.HealthcheckReport{
AccessURL: healthsdk.AccessURLReport{
Warnings: []health.Message{
{Code: "TEST", Message: "test"},
},
},
},
},
},
expected: []string{
"Client netcheck: TEST: test",
"Deployment health: TEST: test",
},
},
{
name: "errors",
in: support.Bundle{
Network: support.Network{
Netcheck: &derphealth.Report{
Error: ptr.Ref("yikes"),
},
},
Deployment: support.Deployment{
HealthReport: &healthsdk.HealthcheckReport{
AccessURL: healthsdk.AccessURLReport{
Error: ptr.Ref("zoinks"),
},
},
},
},
expected: []string{
"Client netcheck: yikes",
"Deployment health: zoinks",
},
},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
actual := support.Summarize(&tt.in)
if len(tt.expected) == 0 {
assert.Empty(t, actual)
} else {
for _, exp := range tt.expected {
assert.Contains(t, actual, exp)
}
}
})
}
}