Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(codersdk/healthsdk): update docs url path for health errors#16180

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 1 commit into2025-01-16-linkfixfromcj/healthsdk/docs-url
Jan 17, 2025
Merged
Changes fromall 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
35 changes: 30 additions & 5 deletionscodersdk/healthsdk/healthsdk_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,6 +66,7 @@ func TestSummarize(t *testing.T) {
name string
br healthsdk.BaseReport
pfx string
docsURL string
expected []string
}{
{
Expand DownExpand Up@@ -93,9 +94,9 @@ func TestSummarize(t *testing.T) {
expected: []string{
"Error: testing",
"Warn: TEST01: testing one",
"See: https://coder.com/docs/admin/healthcheck#test01",
"See: https://coder.com/docs/admin/monitoring/health-check#test01",
"Warn: TEST02: testing two",
"See: https://coder.com/docs/admin/healthcheck#test02",
"See: https://coder.com/docs/admin/monitoring/health-check#test02",
},
},
{
Expand All@@ -117,16 +118,40 @@ func TestSummarize(t *testing.T) {
expected: []string{
"TEST: Error: testing",
"TEST: Warn: TEST01: testing one",
"See: https://coder.com/docs/admin/healthcheck#test01",
"See: https://coder.com/docs/admin/monitoring/health-check#test01",
"TEST: Warn: TEST02: testing two",
"See: https://coder.com/docs/admin/healthcheck#test02",
"See: https://coder.com/docs/admin/monitoring/health-check#test02",
},
},
{
name: "custom docs url",
br: healthsdk.BaseReport{
Error: ptr.Ref("testing"),
Warnings: []health.Message{
{
Code: "TEST01",
Message: "testing one",
},
{
Code: "TEST02",
Message: "testing two",
},
},
},
docsURL: "https://my.coder.internal/docs",
expected: []string{
"Error: testing",
"Warn: TEST01: testing one",
"See: https://my.coder.internal/docs/admin/monitoring/health-check#test01",
"Warn: TEST02: testing two",
"See: https://my.coder.internal/docs/admin/monitoring/health-check#test02",
},
},
} {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
actual := tt.br.Summarize(tt.pfx,"")
actual := tt.br.Summarize(tt.pfx,tt.docsURL)
if len(tt.expected) == 0 {
assert.Empty(t, actual)
return
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp