@@ -66,6 +66,7 @@ func TestSummarize(t *testing.T) {
66
66
name string
67
67
br healthsdk.BaseReport
68
68
pfx string
69
+ docsURL string
69
70
expected []string
70
71
}{
71
72
{
@@ -93,9 +94,9 @@ func TestSummarize(t *testing.T) {
93
94
expected : []string {
94
95
"Error: testing" ,
95
96
"Warn: TEST01: testing one" ,
96
- "See: https://coder.com/docs/admin/healthcheck #test01" ,
97
+ "See: https://coder.com/docs/admin/monitoring/health-check #test01" ,
97
98
"Warn: TEST02: testing two" ,
98
- "See: https://coder.com/docs/admin/healthcheck #test02" ,
99
+ "See: https://coder.com/docs/admin/monitoring/health-check #test02" ,
99
100
},
100
101
},
101
102
{
@@ -117,16 +118,40 @@ func TestSummarize(t *testing.T) {
117
118
expected : []string {
118
119
"TEST: Error: testing" ,
119
120
"TEST: Warn: TEST01: testing one" ,
120
- "See: https://coder.com/docs/admin/healthcheck #test01" ,
121
+ "See: https://coder.com/docs/admin/monitoring/health-check #test01" ,
121
122
"TEST: Warn: TEST02: testing two" ,
122
- "See: https://coder.com/docs/admin/healthcheck#test02" ,
123
+ "See: https://coder.com/docs/admin/monitoring/health-check#test02" ,
124
+ },
125
+ },
126
+ {
127
+ name : "custom docs url" ,
128
+ br : healthsdk.BaseReport {
129
+ Error : ptr .Ref ("testing" ),
130
+ Warnings : []health.Message {
131
+ {
132
+ Code : "TEST01" ,
133
+ Message : "testing one" ,
134
+ },
135
+ {
136
+ Code : "TEST02" ,
137
+ Message : "testing two" ,
138
+ },
139
+ },
140
+ },
141
+ docsURL : "https://my.coder.internal/docs" ,
142
+ expected : []string {
143
+ "Error: testing" ,
144
+ "Warn: TEST01: testing one" ,
145
+ "See: https://my.coder.internal/docs/admin/monitoring/health-check#test01" ,
146
+ "Warn: TEST02: testing two" ,
147
+ "See: https://my.coder.internal/docs/admin/monitoring/health-check#test02" ,
123
148
},
124
149
},
125
150
} {
126
151
tt := tt
127
152
t .Run (tt .name , func (t * testing.T ) {
128
153
t .Parallel ()
129
- actual := tt .br .Summarize (tt .pfx , "" )
154
+ actual := tt .br .Summarize (tt .pfx , tt . docsURL )
130
155
if len (tt .expected ) == 0 {
131
156
assert .Empty (t , actual )
132
157
return
0 commit comments