Thanks to visit codestin.com
Credit goes to github.com

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
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 @@ -23,11 +23,11 @@
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbfake"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/coderd/healthcheck/derphealth"

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used

Check failure on line 26 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/coderd/healthcheck/derphealth" imported and not used
"github.com/coder/coder/v2/coderd/healthcheck/health"

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used

Check failure on line 27 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/coderd/healthcheck/health" imported and not used
"github.com/coder/coder/v2/coderd/util/ptr"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/healthsdk"

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used (typecheck)

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used

Check failure on line 30 in support/support_test.go

View workflow job for this annotation

GitHub Actions / test-go-pg

"github.com/coder/coder/v2/codersdk/healthsdk" imported and not used
"github.com/coder/coder/v2/support"
"github.com/coder/coder/v2/testutil"
)
Expand Down Expand Up @@ -248,77 +248,3 @@
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)
}
}
})
}
}
Loading