make sure force works

This commit is contained in:
Andrew Nester 2024-09-30 13:16:33 +02:00
parent 398c4c8df5
commit 5f9d1e8d00
No known key found for this signature in database
GPG Key ID: 12BC628A44B7DA57
1 changed files with 6 additions and 0 deletions

View File

@ -79,4 +79,10 @@ func TestStatePushLargeState(t *testing.T) {
writeLocalState(t, ctx, b, largeState) writeLocalState(t, ctx, b, largeState)
diags := bundle.Apply(ctx, b, m) diags := bundle.Apply(ctx, b, m)
assert.ErrorContains(t, diags.Error(), "Terraform state file size exceeds the maximum allowed size of 10485760 bytes. Please reduce the number of resources in your bundle, split your bundle into multiple or re-run the command with --force flag") assert.ErrorContains(t, diags.Error(), "Terraform state file size exceeds the maximum allowed size of 10485760 bytes. Please reduce the number of resources in your bundle, split your bundle into multiple or re-run the command with --force flag")
// Force the write.
b = statePushTestBundle(t)
b.Config.Bundle.Force = true
diags = bundle.Apply(ctx, b, m)
assert.NoError(t, diags.Error())
} }