argo-cd/test/e2e/pruning_required_test.go
Leonardo Luz Almeida 6240ef00e7
feat: new sync option to use ignore diff configs during sync (#8078)
feat: new sync option to use ignore diff configs during sync (#8078)

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-01-13 13:00:17 -08:00

27 lines
532 B
Go

package e2e
import (
"testing"
. "github.com/argoproj/gitops-engine/pkg/sync/common"
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture/app"
)
// check we fail with message if we delete a non-prunable resource
func TestPruningRequired(t *testing.T) {
Given(t).
Path("two-nice-pods").
Prune(false).
When().
IgnoreErrors().
CreateApp().
Sync().
Then().
Expect(OperationPhaseIs(OperationSucceeded)).
When().
DeleteFile("pod-2.yaml").
Sync().
Then().
Expect(Error("", "1 resources require pruning"))
}