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

Skip to content

Commit 82803da

Browse files
committed
fix failing test
1 parent 8b6c4de commit 82803da

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

codersdk/toolsdk/toolsdk_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ func TestTools(t *testing.T) {
288288
ctx = toolsdk.WithClient(ctx, client)
289289

290290
// Create a new template version for use here.
291-
tv := dbfake.TemplateVersion(t, store).SkipCreateTemplate().Do()
291+
tv := dbfake.TemplateVersion(t, store).
292+
// nolint:gocritic // This is in a test package and does not end up in the build
293+
Seed(database.TemplateVersion{OrganizationID: owner.OrganizationID, CreatedBy: owner.UserID}).
294+
SkipCreateTemplate().Do()
292295

293296
// We're going to re-use the pre-existing template version
294297
_, err := testTool(ctx, t, toolsdk.CreateTemplate, map[string]any{
@@ -342,7 +345,7 @@ func TestMain(m *testing.M) {
342345
}
343346
}
344347

345-
if len(untested) > 0 {
348+
if len(untested) > 0 && code == 0 {
346349
println("The following tools were not tested:")
347350
for _, tool := range untested {
348351
println(" - " + tool)

0 commit comments

Comments
 (0)