Skip to content

Commit

Permalink
tests/resource/aws_ssm_activation: Remove broken ExpectError testing …
Browse files Browse the repository at this point in the history
…from TestAccAWSSSMActivation_expirationDate (#12173)

Previously from the acceptance testing:

```
--- FAIL: TestAccAWSSSMActivation_expirationDate (1.08s)
    testing.go:647: Step 0, expected error:

        config is invalid: expected "expiration_date" to be a valid RFC3339 date, got "2018-03-01": parsing time "2018-03-01" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "T"

        To match:

        invalid RFC3339 timestamp
```

It appears the error messaging changed with the RFC3339 timestamp validation around January 31, 2020. We typically do not use `ExpectError` testing too often with plan-time value validations, since its usually an unnecessary maintenance burden, so here we remove the extra test step rather than manually update the expected error messaging to match disconnected code.

Output from acceptance testing:

```
--- PASS: TestAccAWSSSMActivation_expirationDate (36.94s)
```
  • Loading branch information
bflad committed Mar 10, 2020
1 parent e1a7dc6 commit 3c3aad1
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions aws/resource_aws_ssm_activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package aws

import (
"fmt"
"regexp"
"testing"
"time"

Expand Down Expand Up @@ -82,10 +81,6 @@ func TestAccAWSSSMActivation_expirationDate(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSSSMActivationDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSSSMActivationConfig_expirationDate(rName, "2018-03-01"),
ExpectError: regexp.MustCompile(`invalid RFC3339 timestamp`),
},
{
Config: testAccAWSSSMActivationConfig_expirationDate(rName, expirationDateS),
Check: resource.ComposeTestCheckFunc(
Expand Down

0 comments on commit 3c3aad1

Please sign in to comment.