Skip to content

Commit db215a7

Browse files
committed
Added tests
1 parent 2d3dac7 commit db215a7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/component_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ func (s *ComponentSuite) TestBasic() {
2121
const stack = "default-test"
2222
const awsRegion = "us-east-2"
2323

24+
const clusterName := strings.ToLower(random.UniqueId())
25+
2426
defer s.DestroyAtmosComponent(s.T(), component, stack, nil)
2527
inputs := map[string]interface{}{
2628
"name": "db",
@@ -29,6 +31,7 @@ func (s *ComponentSuite) TestBasic() {
2931
"database_port": 5432,
3032
"publicly_accessible": true,
3133
"allowed_cidr_blocks": []string{"0.0.0.0/0"},
34+
"cluster_name": clusterName,
3235
}
3336
componentInstance, _ := s.DeployAtmosComponent(s.T(), component, stack, &inputs)
3437
assert.NotNil(s.T(), componentInstance)
@@ -99,6 +102,7 @@ func (s *ComponentSuite) TestServerless() {
99102
const component = "aurora-postgres/serverless"
100103
const stack = "default-test"
101104
const awsRegion = "us-east-2"
105+
const clusterName := strings.ToLower(random.UniqueId())
102106

103107
defer s.DestroyAtmosComponent(s.T(), component, stack, nil)
104108
inputs := map[string]interface{}{
@@ -108,6 +112,7 @@ func (s *ComponentSuite) TestServerless() {
108112
"database_port": 5432,
109113
"publicly_accessible": true,
110114
"allowed_cidr_blocks": []string{"0.0.0.0/0"},
115+
"cluster_name": clusterName,
111116
}
112117
componentInstance, _ := s.DeployAtmosComponent(s.T(), component, stack, &inputs)
113118
assert.NotNil(s.T(), componentInstance)
@@ -172,9 +177,7 @@ func (s *ComponentSuite) TestDisabled() {
172177
const stack = "default-test"
173178
const awsRegion = "us-east-2"
174179

175-
defer s.DestroyAtmosComponent(s.T(), component, stack, nil)
176-
componentInstance, _ := s.DeployAtmosComponent(s.T(), component, stack, nil)
177-
assert.Nil(s.T(), componentInstance)
180+
s.VerifyEnabledFlag(component, stack, nil)
178181
}
179182

180183
func TestRunSuite(t *testing.T) {

0 commit comments

Comments
 (0)