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