Skip to content

Commit 12a6837

Browse files
committed
fixing tests
1 parent 40c363d commit 12a6837

File tree

11 files changed

+3
-326
lines changed

11 files changed

+3
-326
lines changed

examples/examples_yaml_test.go

Lines changed: 1 addition & 297 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,12 +1115,9 @@ func TestAccDefaultTags(t *testing.T) {
11151115
name: "pf", token: "aws:appconfig:Environment",
11161116
other: `
11171117
app:
1118-
type: aws:appconfig:Application
1119-
properties:
1120-
name: pf-tags-test-app`,
1118+
type: aws:appconfig:Application`,
11211119
properties: map[string]interface{}{
11221120
"applicationId": "${app.id}",
1123-
"name": "pf-tags-test",
11241121
},
11251122
},
11261123
}
@@ -1373,299 +1370,6 @@ outputs:
13731370
}
13741371
}
13751372

1376-
// This replicates the diff when running `pulumi preview` on a aws.rds.Instance with
1377-
// pulumi-aws v6.0.0 and state from pulumi-aws 5.42.0.
1378-
//
1379-
// The first test ensures we don't regress on https://github.com/pulumi/pulumi-aws/issues/2682
1380-
//
1381-
// The second test is when upgrading from pulumi-aws version <5.0.0 to v6.x.x, and
1382-
// prevents regressions on https://github.com/pulumi/pulumi-aws/issues/2823
1383-
//
1384-
// Updated in https://github.com/pulumi/pulumi-aws/pull/3881
1385-
// replacements.
1386-
func TestMigrateRdsInstance(t *testing.T) {
1387-
case1 := `[{
1388-
"method": "/pulumirpc.ResourceProvider/Diff",
1389-
"request": {
1390-
"id": "postgresdb8a8a6f1",
1391-
"urn": "urn:pulumi:dev::ts::aws:rds/instance:Instance::postgresdb",
1392-
"olds": {
1393-
"__meta": "{\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":2400000000000,\"delete\":3600000000000,\"update\":4800000000000},\"schema_version\":\"1\"}",
1394-
"address": "postgresdb8a8a6f1.chuqccm8uxqx.us-west-2.rds.amazonaws.com",
1395-
"allocatedStorage": 30,
1396-
"applyImmediately": false,
1397-
"arn": "arn:aws:rds:us-west-2:616138583583:db:postgresdb8a8a6f1",
1398-
"autoMinorVersionUpgrade": true,
1399-
"availabilityZone": "us-west-2d",
1400-
"backupRetentionPeriod": 0,
1401-
"backupWindow": "06:15-06:45",
1402-
"caCertIdentifier": "rds-ca-2019",
1403-
"characterSetName": "",
1404-
"copyTagsToSnapshot": false,
1405-
"customIamInstanceProfile": "",
1406-
"customerOwnedIpEnabled": false,
1407-
"dbName": "airflow",
1408-
"dbSubnetGroupName": "default",
1409-
"deleteAutomatedBackups": true,
1410-
"deletionProtection": false,
1411-
"domain": "",
1412-
"domainIamRoleName": "",
1413-
"enabledCloudwatchLogsExports": [],
1414-
"endpoint": "postgresdb8a8a6f1.chuqccm8uxqx.us-west-2.rds.amazonaws.com:5432",
1415-
"engine": "postgres",
1416-
"engineVersion": "15.3",
1417-
"engineVersionActual": "15.3",
1418-
"hostedZoneId": "Z1PVIF0B656C1W",
1419-
"iamDatabaseAuthenticationEnabled": false,
1420-
"id": "postgresdb8a8a6f1",
1421-
"identifier": "postgresdb8a8a6f1",
1422-
"identifierPrefix": "",
1423-
"instanceClass": "db.t4g.micro",
1424-
"iops": 0,
1425-
"kmsKeyId": "",
1426-
"latestRestorableTime": "",
1427-
"licenseModel": "postgresql-license",
1428-
"listenerEndpoints": [],
1429-
"maintenanceWindow": "sun:07:16-sun:07:46",
1430-
"masterUserSecrets": [],
1431-
"maxAllocatedStorage": 0,
1432-
"monitoringInterval": 0,
1433-
"monitoringRoleArn": "",
1434-
"multiAz": false,
1435-
"name": "airflow",
1436-
"ncharCharacterSetName": "",
1437-
"networkType": "IPV4",
1438-
"optionGroupName": "default:postgres-15",
1439-
"parameterGroupName": "default.postgres15",
1440-
"password": "tuFp574p9Arw58gu",
1441-
"performanceInsightsEnabled": false,
1442-
"performanceInsightsKmsKeyId": "",
1443-
"performanceInsightsRetentionPeriod": 0,
1444-
"port": 5432,
1445-
"publiclyAccessible": false,
1446-
"replicaMode": "",
1447-
"replicas": [],
1448-
"replicateSourceDb": "",
1449-
"resourceId": "db-DUPUZANEFBXYECMTI2B5RZPTOE",
1450-
"securityGroupNames": [],
1451-
"skipFinalSnapshot": true,
1452-
"status": "available",
1453-
"storageEncrypted": false,
1454-
"storageThroughput": 0,
1455-
"storageType": "gp2",
1456-
"tags": {},
1457-
"tagsAll": {},
1458-
"timezone": "",
1459-
"username": "airflow",
1460-
"vpcSecurityGroupIds": [
1461-
"sg-4d436f12"
1462-
]
1463-
},
1464-
"news": {
1465-
"__defaults": [
1466-
"applyImmediately",
1467-
"autoMinorVersionUpgrade",
1468-
"copyTagsToSnapshot",
1469-
"deleteAutomatedBackups",
1470-
"identifier",
1471-
"monitoringInterval",
1472-
"performanceInsightsEnabled",
1473-
"publiclyAccessible"
1474-
],
1475-
"allocatedStorage": 30,
1476-
"applyImmediately": false,
1477-
"autoMinorVersionUpgrade": true,
1478-
"copyTagsToSnapshot": false,
1479-
"deleteAutomatedBackups": true,
1480-
"engine": "postgres",
1481-
"identifier": "postgresdb8a8a6f1",
1482-
"instanceClass": "db.t4g.micro",
1483-
"monitoringInterval": 0,
1484-
"dbName": "airflow",
1485-
"password": "tuFp574p9Arw58gu",
1486-
"performanceInsightsEnabled": false,
1487-
"publiclyAccessible": false,
1488-
"skipFinalSnapshot": true,
1489-
"username": "airflow"
1490-
},
1491-
"oldInputs": {
1492-
"__defaults": [
1493-
"applyImmediately",
1494-
"autoMinorVersionUpgrade",
1495-
"copyTagsToSnapshot",
1496-
"deleteAutomatedBackups",
1497-
"identifier",
1498-
"monitoringInterval",
1499-
"performanceInsightsEnabled",
1500-
"publiclyAccessible"
1501-
],
1502-
"allocatedStorage": 30,
1503-
"applyImmediately": false,
1504-
"autoMinorVersionUpgrade": true,
1505-
"copyTagsToSnapshot": false,
1506-
"deleteAutomatedBackups": true,
1507-
"engine": "postgres",
1508-
"identifier": "postgresdb8a8a6f1",
1509-
"instanceClass": "db.t4g.micro",
1510-
"monitoringInterval": 0,
1511-
"name": "airflow",
1512-
"password": "tuFp574p9Arw58gu",
1513-
"performanceInsightsEnabled": false,
1514-
"publiclyAccessible": false,
1515-
"skipFinalSnapshot": true,
1516-
"username": "airflow"
1517-
}
1518-
},
1519-
"response": {
1520-
"stables": "*",
1521-
"changes": "*",
1522-
"hasDetailedDiff": true
1523-
}
1524-
}]`
1525-
1526-
case2 := `[{
1527-
"method": "/pulumirpc.ResourceProvider/Diff",
1528-
"request": {
1529-
"id": "rds2f5ed54",
1530-
"urn": "urn:pulumi:exp2::secret-random-yaml::aws:rds/instance:Instance::rds",
1531-
"olds": {
1532-
"__meta": "{\"e2bfb730-ecaa-11e6-8f88-34363bc7c4c0\":{\"create\":2400000000000,\"delete\":3600000000000,\"update\":4800000000000},\"schema_version\":\"1\"}",
1533-
"address": "rds2f5ed54.c1xxca33i6kr.us-east-2.rds.amazonaws.com",
1534-
"allocatedStorage": 16,
1535-
"applyImmediately": false,
1536-
"arn": "arn:aws:rds:us-east-2:616138583583:db:rds2f5ed54",
1537-
"autoMinorVersionUpgrade": true,
1538-
"availabilityZone": "us-east-2c",
1539-
"backupRetentionPeriod": 0,
1540-
"backupWindow": "07:34-08:04",
1541-
"caCertIdentifier": "rds-ca-2019",
1542-
"copyTagsToSnapshot": false,
1543-
"dbSubnetGroupName": "default",
1544-
"deleteAutomatedBackups": true,
1545-
"deletionProtection": false,
1546-
"domain": "",
1547-
"domainIamRoleName": "",
1548-
"enabledCloudwatchLogsExports": [],
1549-
"endpoint": "rds2f5ed54.c1xxca33i6kr.us-east-2.rds.amazonaws.com:3306",
1550-
"engine": "mysql",
1551-
"engineVersion": "8.0.33",
1552-
"hostedZoneId": "Z2XHWR1WZ565X2",
1553-
"iamDatabaseAuthenticationEnabled": false,
1554-
"id": "rds2f5ed54",
1555-
"identifier": "rds2f5ed54",
1556-
"instanceClass": "db.t3.micro",
1557-
"iops": 0,
1558-
"kmsKeyId": "",
1559-
"latestRestorableTime": "0001-01-01T00:00:00Z",
1560-
"licenseModel": "general-public-license",
1561-
"maintenanceWindow": "sun:03:59-sun:04:29",
1562-
"maxAllocatedStorage": 0,
1563-
"monitoringInterval": 0,
1564-
"monitoringRoleArn": "",
1565-
"multiAz": false,
1566-
"name": "name",
1567-
"optionGroupName": "default:mysql-8-0",
1568-
"parameterGroupName": "default.mysql8.0",
1569-
"password": "FOO-BAR-FIZZ1!2",
1570-
"performanceInsightsEnabled": false,
1571-
"performanceInsightsKmsKeyId": "",
1572-
"performanceInsightsRetentionPeriod": 0,
1573-
"port": 3306,
1574-
"publiclyAccessible": false,
1575-
"replicas": [],
1576-
"replicateSourceDb": "",
1577-
"resourceId": "db-N57SF65OZ5KO3TPK73R7DQMLZA",
1578-
"securityGroupNames": [],
1579-
"skipFinalSnapshot": true,
1580-
"status": "available",
1581-
"storageEncrypted": false,
1582-
"storageType": "gp2",
1583-
"tags": {
1584-
"some": "change"
1585-
},
1586-
"timezone": "",
1587-
"username": "root",
1588-
"vpcSecurityGroupIds": [
1589-
"sg-1928d262"
1590-
]
1591-
},
1592-
"news": {
1593-
"__defaults": [
1594-
"applyImmediately",
1595-
"autoMinorVersionUpgrade",
1596-
"copyTagsToSnapshot",
1597-
"deleteAutomatedBackups",
1598-
"identifier",
1599-
"monitoringInterval",
1600-
"performanceInsightsEnabled",
1601-
"publiclyAccessible"
1602-
],
1603-
"allocatedStorage": 16,
1604-
"applyImmediately": false,
1605-
"autoMinorVersionUpgrade": true,
1606-
"copyTagsToSnapshot": false,
1607-
"dbName": "name",
1608-
"deleteAutomatedBackups": true,
1609-
"engine": "mysql",
1610-
"identifier": "rds2f5ed54",
1611-
"instanceClass": "db.t3.micro",
1612-
"monitoringInterval": 0,
1613-
"password": "FOO-BAR-FIZZ1!2",
1614-
"performanceInsightsEnabled": false,
1615-
"publiclyAccessible": false,
1616-
"skipFinalSnapshot": true,
1617-
"tags": {
1618-
"__defaults": [],
1619-
"some": "change"
1620-
},
1621-
"username": "root"
1622-
},
1623-
"oldInputs": {
1624-
"__defaults": [
1625-
"applyImmediately",
1626-
"autoMinorVersionUpgrade",
1627-
"copyTagsToSnapshot",
1628-
"deleteAutomatedBackups",
1629-
"identifier",
1630-
"monitoringInterval",
1631-
"performanceInsightsEnabled",
1632-
"publiclyAccessible"
1633-
],
1634-
"allocatedStorage": 16,
1635-
"applyImmediately": false,
1636-
"autoMinorVersionUpgrade": true,
1637-
"copyTagsToSnapshot": false,
1638-
"deleteAutomatedBackups": true,
1639-
"engine": "mysql",
1640-
"identifier": "rds2f5ed54",
1641-
"instanceClass": "db.t3.micro",
1642-
"monitoringInterval": 0,
1643-
"name": "name",
1644-
"password": "FOO-BAR-FIZZ1!2",
1645-
"performanceInsightsEnabled": false,
1646-
"publiclyAccessible": false,
1647-
"skipFinalSnapshot": true,
1648-
"tags": {
1649-
"__defaults": [],
1650-
"some": "change"
1651-
},
1652-
"username": "root"
1653-
}
1654-
},
1655-
"response": {
1656-
"stables": "*",
1657-
"changes": "*",
1658-
"hasDetailedDiff": true,
1659-
"detailedDiff": "*",
1660-
"diffs": "*"
1661-
}
1662-
}
1663-
]`
1664-
1665-
t.Run("case1", func(t *testing.T) { replay(t, case1) })
1666-
t.Run("case2", func(t *testing.T) { replay(t, case2) })
1667-
}
1668-
16691373
func TestRegressUnknownTags(t *testing.T) {
16701374
repro := `
16711375
[

examples/pf-default-tags-yaml/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ resources:
77
type: pulumi:providers:aws
88
app:
99
type: aws:appconfig:Application
10-
properties:
11-
name: pf-tags-test-app
1210
res:
1311
type: aws:appconfig:Environment
1412
properties:
1513
applicationId: ${app.id}
16-
name: pf-tags-test
1714
options:
1815
provider: ${aws-provider}
1916
outputs:

examples/pf-default-tags-yaml/step1/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ resources:
1111
foo: bar
1212
app:
1313
type: aws:appconfig:Application
14-
properties:
15-
name: pf-tags-test-app
1614
res:
1715
type: aws:appconfig:Environment
1816
properties:
1917
applicationId: ${app.id}
20-
name: pf-tags-test
2118
options:
2219
provider: ${aws-provider}
2320
outputs:

examples/pf-default-tags-yaml/step2/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ resources:
1111
foo: quux
1212
app:
1313
type: aws:appconfig:Application
14-
properties:
15-
name: pf-tags-test-app
1614
res:
1715
type: aws:appconfig:Environment
1816
properties:
1917
applicationId: ${app.id}
20-
name: pf-tags-test
2118
options:
2219
provider: ${aws-provider}
2320
outputs:

examples/pf-default-tags-yaml/step3/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ resources:
1111
foo: quux
1212
app:
1313
type: aws:appconfig:Application
14-
properties:
15-
name: pf-tags-test-app
1614
res:
1715
type: aws:appconfig:Environment
1816
properties:
1917
applicationId: ${app.id}
20-
name: pf-tags-test
2118
tags:
2219
fizz: buzz
2320
options:

examples/pf-default-tags-yaml/step4/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ resources:
1111
foo: quux
1212
app:
1313
type: aws:appconfig:Application
14-
properties:
15-
name: pf-tags-test-app
1614
res:
1715
type: aws:appconfig:Environment
1816
properties:
1917
applicationId: ${app.id}
20-
name: pf-tags-test
2118
tags:
2219
fizz: buzz
2320
foo: bar

examples/pf-default-tags-yaml/step5/Pulumi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ resources:
1111
foo: quux
1212
app:
1313
type: aws:appconfig:Application
14-
properties:
15-
name: pf-tags-test-app
1614
res:
1715
type: aws:appconfig:Environment
1816
properties:
1917
applicationId: ${app.id}
20-
name: pf-tags-test
2118
options:
2219
provider: ${aws-provider}
2320
outputs:

0 commit comments

Comments
 (0)