Skip to content

Commit 3cf7229

Browse files
committed
improved testing and validation
1 parent d8844b8 commit 3cf7229

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

provider/agent_test.go

+24
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,30 @@ func TestAgent_ResourcesMonitoring(t *testing.T) {
380380
}},
381381
})
382382
})
383+
384+
t.Run("NoPath", func(t *testing.T) {
385+
resource.Test(t, resource.TestCase{
386+
ProviderFactories: coderFactory(),
387+
IsUnitTest: true,
388+
Steps: []resource.TestStep{{
389+
Config: `
390+
provider "coder" {
391+
url = "https://example.com"
392+
}
393+
resource "coder_agent" "dev" {
394+
os = "linux"
395+
arch = "amd64"
396+
resources_monitoring {
397+
volume {
398+
enabled = true
399+
threshold = 80
400+
}
401+
}
402+
}`,
403+
ExpectError: regexp.MustCompile(`The argument "path" is required, but no definition was found.`),
404+
}},
405+
})
406+
})
383407
}
384408

385409
func TestAgent_MetadataDuplicateKeys(t *testing.T) {

0 commit comments

Comments
 (0)