Skip to content

Commit 8afba58

Browse files
committed
Make the test checking tags run every time.
Signed-off-by: Krzysztof Wilczynski <[email protected]>
1 parent fdf4e3f commit 8afba58

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

builtin/providers/aws/resource_aws_vpc_peering_connection_test.go

+14-7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ func TestAccAWSVPCPeeringConnection_plan(t *testing.T) {
6666
t.Fatal("AWS_ACCOUNT_ID must be set.")
6767
}
6868
},
69+
70+
IDRefreshIgnore: []string{"auto_accept"},
71+
6972
Providers: testAccProviders,
7073
CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy,
7174
Steps: []resource.TestStep{
@@ -85,13 +88,14 @@ func TestAccAWSVPCPeeringConnection_plan(t *testing.T) {
8588

8689
func TestAccAWSVPCPeeringConnection_tags(t *testing.T) {
8790
var connection ec2.VpcPeeringConnection
88-
peerId := os.Getenv("TF_PEER_ID")
89-
if peerId == "" {
90-
t.Skip("Error: TestAccAWSVPCPeeringConnection_tags requires a peer ID to be set.")
91-
}
9291

9392
resource.Test(t, resource.TestCase{
94-
PreCheck: func() { testAccPreCheck(t) },
93+
PreCheck: func() {
94+
testAccPreCheck(t)
95+
if os.Getenv("AWS_ACCOUNT_ID") == "" {
96+
t.Fatal("AWS_ACCOUNT_ID must be set.")
97+
}
98+
},
9599

96100
IDRefreshName: "aws_vpc_peering_connection.foo",
97101
IDRefreshIgnore: []string{"auto_accept"},
@@ -100,7 +104,7 @@ func TestAccAWSVPCPeeringConnection_tags(t *testing.T) {
100104
CheckDestroy: testAccCheckVpcDestroy,
101105
Steps: []resource.TestStep{
102106
resource.TestStep{
103-
Config: fmt.Sprintf(testAccVpcPeeringConfigTags, peerId),
107+
Config: testAccVpcPeeringConfigTags,
104108
Check: resource.ComposeTestCheckFunc(
105109
testAccCheckAWSVpcPeeringConnectionExists(
106110
"aws_vpc_peering_connection.foo",
@@ -355,7 +359,7 @@ resource "aws_vpc" "bar" {
355359
resource "aws_vpc_peering_connection" "foo" {
356360
vpc_id = "${aws_vpc.foo.id}"
357361
peer_vpc_id = "${aws_vpc.bar.id}"
358-
peer_owner_id = "%s"
362+
auto_accept = true
359363
tags {
360364
foo = "bar"
361365
}
@@ -365,6 +369,9 @@ resource "aws_vpc_peering_connection" "foo" {
365369
const testAccVpcPeeringConfigOptions = `
366370
resource "aws_vpc" "foo" {
367371
cidr_block = "10.0.0.0/16"
372+
tags {
373+
Name = "TestAccAWSVPCPeeringConnection_options"
374+
}
368375
}
369376
370377
resource "aws_vpc" "bar" {

0 commit comments

Comments
 (0)