Skip to content
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

provider/opsgenie: Descriptions for Teams #11391

Merged
merged 4 commits into from
Jan 29, 2017

Conversation

tombuildsstuff
Copy link
Contributor

  • Updating the OpsGenie SDK to the latest and greatest
  • Adding the Description field to a Team
  • Acceptance & Import Tests
  • Documentation

@tombuildsstuff
Copy link
Contributor Author

Tests pass

TF_ACC=1 go test ./builtin/providers/opsgenie -v -run TestAccOpsGenie -timeout 120m
=== RUN   TestAccOpsGenieTeam_importBasic
--- PASS: TestAccOpsGenieTeam_importBasic (7.11s)
=== RUN   TestAccOpsGenieTeam_importWithUser
--- PASS: TestAccOpsGenieTeam_importWithUser (9.36s)
=== RUN   TestAccOpsGenieTeam_importWithUserComplete
--- PASS: TestAccOpsGenieTeam_importWithUserComplete (8.25s)
=== RUN   TestAccOpsGenieUser_importBasic
--- PASS: TestAccOpsGenieUser_importBasic (4.86s)
=== RUN   TestAccOpsGenieUser_importComplete
--- PASS: TestAccOpsGenieUser_importComplete (4.49s)
=== RUN   TestAccOpsGenieTeamName_validation
--- PASS: TestAccOpsGenieTeamName_validation (0.00s)
=== RUN   TestAccOpsGenieTeamRole_validation
--- PASS: TestAccOpsGenieTeamRole_validation (0.00s)
=== RUN   TestAccOpsGenieTeam_basic
--- PASS: TestAccOpsGenieTeam_basic (3.83s)
=== RUN   TestAccOpsGenieTeam_withUser
--- PASS: TestAccOpsGenieTeam_withUser (7.06s)
=== RUN   TestAccOpsGenieTeam_withUserComplete
--- PASS: TestAccOpsGenieTeam_withUserComplete (6.71s)
=== RUN   TestAccOpsGenieTeam_withMultipleUsers
--- PASS: TestAccOpsGenieTeam_withMultipleUsers (8.05s)
=== RUN   TestAccOpsGenieUserUsername_validation
--- PASS: TestAccOpsGenieUserUsername_validation (0.00s)
=== RUN   TestAccOpsGenieUserFullName_validation
--- PASS: TestAccOpsGenieUserFullName_validation (0.00s)
=== RUN   TestAccOpsGenieUserRole_validation
--- PASS: TestAccOpsGenieUserRole_validation (0.00s)
=== RUN   TestAccOpsGenieUser_basic
--- PASS: TestAccOpsGenieUser_basic (3.86s)
=== RUN   TestAccOpsGenieUser_complete
--- PASS: TestAccOpsGenieUser_complete (3.77s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/opsgenie	67.363s

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a test that doesn't have a description as I am curious as to how this acts.

Apart from that, looks sane :)

Members: expandOpsGenieTeamMembers(d),
Name: name,
Description: description,
Members: expandOpsGenieTeamMembers(d),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we pass an empty string here is this ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - it's caught by the HCL (which picks it up as a null value) - there's also tests for omitting/empty/completed values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - it's caught by the HCL (which picks it up as a null value) - there's also tests for omitting/empty/completed values

Members: expandOpsGenieTeamMembers(d),
Id: d.Id(),
Name: name,
Description: description,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we pass an empty string, is this ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's caught by the HCL (which picks it up as a null value)

@tombuildsstuff
Copy link
Contributor Author

tombuildsstuff commented Jan 29, 2017

@stack72 There's a test TestAccOpsGenieTeam_basic which covers omiting the field - I've added one with an empty Description too just to ensure that's covered, but I believe that's already being done by HCL? (LMK if you want me to remove it)

To clarify - when I go from the following state:

resource "opsgenie_team" "test" {
  name = "example"
}

to the following state:

resource "opsgenie_team" "test" {
  name        = "example"
  description = ""
}

The plan is empty - presumably because the HCL parser ignores empty values. Is that sufficient, or is it worth adding some validation to the description field? In addition the field is marked as omitempty in the Go source

Tests pass:

$ TF_ACC=1 go test ./builtin/providers/opsgenie -v -run TestAccOpsGenie -timeout 120m
=== RUN   TestAccOpsGenieTeam_importBasic
--- PASS: TestAccOpsGenieTeam_importBasic (49.01s)
=== RUN   TestAccOpsGenieTeam_importWithEmptyDescription
--- PASS: TestAccOpsGenieTeam_importWithEmptyDescription (65.86s)
=== RUN   TestAccOpsGenieTeam_importWithUser
--- PASS: TestAccOpsGenieTeam_importWithUser (310.29s)
=== RUN   TestAccOpsGenieTeam_importWithUserComplete
--- PASS: TestAccOpsGenieTeam_importWithUserComplete (80.16s)
=== RUN   TestAccOpsGenieUser_importBasic
--- PASS: TestAccOpsGenieUser_importBasic (32.28s)
=== RUN   TestAccOpsGenieUser_importComplete
--- PASS: TestAccOpsGenieUser_importComplete (103.84s)
=== RUN   TestAccOpsGenieTeamName_validation
--- PASS: TestAccOpsGenieTeamName_validation (0.00s)
=== RUN   TestAccOpsGenieTeamRole_validation
--- PASS: TestAccOpsGenieTeamRole_validation (0.00s)
=== RUN   TestAccOpsGenieTeam_basic
--- PASS: TestAccOpsGenieTeam_basic (93.53s)
=== RUN   TestAccOpsGenieTeam_withEmptyDescription
--- PASS: TestAccOpsGenieTeam_withEmptyDescription (24.78s)
=== RUN   TestAccOpsGenieTeam_withUser
--- PASS: TestAccOpsGenieTeam_withUser (45.91s)
=== RUN   TestAccOpsGenieTeam_withUserComplete
--- PASS: TestAccOpsGenieTeam_withUserComplete (50.18s)
=== RUN   TestAccOpsGenieTeam_withMultipleUsers
--- PASS: TestAccOpsGenieTeam_withMultipleUsers (99.12s)
=== RUN   TestAccOpsGenieUserUsername_validation
--- PASS: TestAccOpsGenieUserUsername_validation (0.00s)
=== RUN   TestAccOpsGenieUserFullName_validation
--- PASS: TestAccOpsGenieUserFullName_validation (0.00s)
=== RUN   TestAccOpsGenieUserRole_validation
--- PASS: TestAccOpsGenieUserRole_validation (0.00s)
=== RUN   TestAccOpsGenieUser_basic
--- PASS: TestAccOpsGenieUser_basic (53.54s)
=== RUN   TestAccOpsGenieUser_complete
--- PASS: TestAccOpsGenieUser_complete (63.40s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/opsgenie	1071.909s

@stack72
Copy link
Contributor

stack72 commented Jan 29, 2017

In that case - all LGTM :) Thanks @tombuildsstuff

P.

@stack72 stack72 merged commit 79024db into hashicorp:master Jan 29, 2017
stack72 pushed a commit that referenced this pull request Jan 29, 2017
* updating the opsgenie dependency

* Adding description to an OpsGenie team

* Description for Teams

* Added tests for an empty description
arcadiatea pushed a commit to ticketmaster/terraform that referenced this pull request Feb 9, 2017
* updating the opsgenie dependency

* Adding description to an OpsGenie team

* Description for Teams

* Added tests for an empty description
@ghost
Copy link

ghost commented Apr 17, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants