core: Fix TestContext2Apply_cancelProvisioner

This test now requires a provisioner schema for correct operation.
This commit is contained in:
Martin Atkins 2018-09-25 15:25:11 -07:00
parent 032f908f4a
commit e6f8b51111
1 changed files with 13 additions and 3 deletions

View File

@ -2001,7 +2001,19 @@ func TestContext2Apply_cancelProvisioner(t *testing.T) {
p := testProvider("aws")
p.ApplyFn = testApplyFn
p.DiffFn = testDiffFn
pr := testProvisioner()
pr.GetSchemaResponse = provisioners.GetSchemaResponse{
Provisioner: &configschema.Block{
Attributes: map[string]*configschema.Attribute{
"foo": {
Type: cty.String,
Optional: true,
},
},
},
}
ctx := testContext2(t, &ContextOpts{
Config: m,
ProviderResolver: providers.ResolverFixed(
@ -2043,9 +2055,7 @@ func TestContext2Apply_cancelProvisioner(t *testing.T) {
// Wait for completion
state := <-stateCh
if applyDiags.HasErrors() {
t.Fatalf("unexpected errors: %s", applyDiags.Err())
}
assertNoErrors(t, applyDiags)
checkStateString(t, state, `
aws_instance.foo: (tainted)