-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: fix #6071 #6085
WIP: fix #6071 #6085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @euclideansphere 👋 Glad to see you were able to submit this (even without the testing)! I was able to write up the acceptance test code below and everything looks great. 🚀
func TestAccAWSBatchJobQueue_disappears(t *testing.T) {
var jobQueue1 batch.JobQueueDetail
resourceName := "aws_batch_job_queue.test_queue"
rInt := acctest.RandInt()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSLaunchTemplateDestroy,
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(testAccBatchJobQueueBasic, rInt),
Check: resource.ComposeTestCheckFunc(
testAccCheckBatchJobQueueExists(resourceName, &jobQueue1),
testAccCheckBatchJobQueueDisappears(&jobQueue1),
),
ExpectNonEmptyPlan: true,
},
},
})
}
func testAccCheckBatchJobQueueDisappears(jobQueue *batch.JobQueueDetail) resource.TestCheckFunc {
return func(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).batchconn
name := aws.StringValue(jobQueue.JobQueueName)
err := disableBatchJobQueue(name, 10*time.Minute, conn)
if err != nil {
return fmt.Errorf("error disabling Batch Job Queue (%s): %s", name, err)
}
return deleteBatchJobQueue(name, 10*time.Minute, conn)
}
}
Previously:
--- FAIL: TestAccAWSBatchJobQueue_disappears (60.01s)
testing.go:527: Step 0 error: Error on follow-up refresh: 1 error occurred:
* aws_batch_job_queue.test_queue: 1 error occurred:
* aws_batch_job_queue.test_queue: aws_batch_job_queue.test_queue: Error reading JobQueue: "%!s(<nil>)"
Output from acceptance testing:
$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSBatchJobQueue_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSBatchJobQueue_ -timeout 120m
=== RUN TestAccAWSBatchJobQueue_basic
--- PASS: TestAccAWSBatchJobQueue_basic (80.89s)
=== RUN TestAccAWSBatchJobQueue_disappears
--- PASS: TestAccAWSBatchJobQueue_disappears (79.91s)
=== RUN TestAccAWSBatchJobQueue_update
--- PASS: TestAccAWSBatchJobQueue_update (116.97s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 278.513s
This has been released in version 1.40.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Fixes #6071
Changes proposed in this pull request:
Output from acceptance testing:
(WIP - currently don't have access to an AWS account with billing enabled to run/fix/create acceptance tests.).