Skip to content

Commit d0617be

Browse files
committed
add moved e2e test
1 parent ea3491e commit d0617be

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

test/e2e/clu2adv_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ func TestClu2AdvParams(t *testing.T) {
1414
cwd, err := os.Getwd()
1515
require.NoError(t, err)
1616
var (
17-
prefix = cwd + "/testdata/"
18-
fileIn = prefix + "clu2adv.in.tf"
19-
fileOut = prefix + "clu2adv.out.tf"
20-
fileExpected = prefix + "clu2adv.expected.tf"
21-
fileUnexisting = prefix + "clu2adv.unexisting.tf"
22-
fs = afero.NewOsFs()
17+
prefix = cwd + "/testdata/"
18+
fileIn = prefix + "clu2adv.in.tf"
19+
fileOut = prefix + "clu2adv.out.tf"
20+
fileExpected = prefix + "clu2adv.expected.tf"
21+
fileExpectedMoved = prefix + "clu2adv.expected_moved.tf"
22+
fileUnexisting = prefix + "clu2adv.unexisting.tf"
23+
fs = afero.NewOsFs()
2324
)
2425
tests := map[string]struct {
2526
expectedErrContains string
@@ -49,6 +50,10 @@ func TestClu2AdvParams(t *testing.T) {
4950
args: []string{"--file", fileIn, "--output", fileOut},
5051
assertFunc: func(t *testing.T) { t.Helper(); e2e.CompareFiles(t, fs, fileOut, fileExpected) },
5152
},
53+
"include moved": {
54+
args: []string{"--file", fileIn, "--output", fileOut, "--includeMoved"},
55+
assertFunc: func(t *testing.T) { t.Helper(); e2e.CompareFiles(t, fs, fileOut, fileExpectedMoved) },
56+
},
5257
}
5358
for name, tc := range tests {
5459
t.Run(name, func(t *testing.T) {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "mongodbatlas_advanced_cluster" "cluster" {
2+
project_id = var.project_id
3+
name = "cluster"
4+
cluster_type = "REPLICASET"
5+
replication_specs = [
6+
{
7+
region_configs = [
8+
{
9+
provider_name = "AWS"
10+
region_name = "US_EAST_1"
11+
priority = 7
12+
electable_specs = {
13+
node_count = 3
14+
instance_size = "M10"
15+
}
16+
}
17+
]
18+
}
19+
]
20+
tags = {
21+
environment = "dev"
22+
}
23+
24+
# Generated by atlas-cli-plugin-terraform.
25+
# Please confirm that all references to this resource are updated.
26+
}
27+
28+
# Moved blocks
29+
30+
moved {
31+
from = mongodbatlas_cluster.cluster
32+
to = mongodbatlas_advanced_cluster.cluster
33+
}

0 commit comments

Comments
 (0)