|
|
|
|
@ -1248,3 +1248,33 @@ func TestRemote_planOtherError(t *testing.T) {
|
|
|
|
|
t.Fatalf("expected error message, got: %s", err.Error())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestRemote_planWithGenConfigOut(t *testing.T) {
|
|
|
|
|
b, bCleanup := testBackendDefault(t)
|
|
|
|
|
defer bCleanup()
|
|
|
|
|
|
|
|
|
|
op, configCleanup, done := testOperationPlan(t, "./testdata/plan")
|
|
|
|
|
defer configCleanup()
|
|
|
|
|
|
|
|
|
|
op.GenerateConfigOut = "generated.tf"
|
|
|
|
|
op.Workspace = backend.DefaultStateName
|
|
|
|
|
|
|
|
|
|
run, err := b.Operation(context.Background(), op)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatalf("error starting operation: %v", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<-run.Done()
|
|
|
|
|
output := done(t)
|
|
|
|
|
if run.Result == backend.OperationSuccess {
|
|
|
|
|
t.Fatal("expected plan operation to fail")
|
|
|
|
|
}
|
|
|
|
|
if !run.PlanEmpty {
|
|
|
|
|
t.Fatalf("expected plan to be empty")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errOutput := output.Stderr()
|
|
|
|
|
if !strings.Contains(errOutput, "Generating configuration is not currently supported") {
|
|
|
|
|
t.Fatalf("expected error about config generation, got: %v", errOutput)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|