Skip to content

Commit 1045b17

Browse files
committed
improve test verbose
1 parent 0a78f08 commit 1045b17

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

provider/agent.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ func agentResource() *schema.Resource {
306306
ForceNew: true,
307307
Required: true,
308308
ValidateDiagFunc: func(i interface{}, s cty.Path) diag.Diagnostics {
309-
if i.(string) == "" {
309+
path, ok := i.(string)
310+
if !ok {
311+
return diag.Errorf("volume path must be a string")
312+
}
313+
if path == "" {
310314
return diag.Errorf("volume path must not be empty")
311315
}
312316

provider/agent_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ func TestAgent_ResourcesMonitoring(t *testing.T) {
347347
}
348348
}`,
349349
Check: nil,
350-
ExpectError: regexp.MustCompile("Error running pre-apply refresh"),
350+
ExpectError: regexp.MustCompile(`expected resources_monitoring\.0\.memory\.0\.threshold to be in the range \(0 - 100\), got 101`),
351351
}},
352352
})
353353
})

0 commit comments

Comments
 (0)