-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add acceptance tests for teams #103
Conversation
This is one of the resources that does not yet have acceptance tests associated with it. In order to guard against regressions, I have added the following tests: * creating a team (with only the required attributes) * updating a team (changing its name, description and visibility) * importing a team During this work I discovered an error in importing teams. In order to resolve this, I added the DefaultMemberRole value which was present in the schema to the TeamNode struct, and added a mapping to updateTeam, so this PR doubles as a bugfix for import.
buildkite/resource_team_test.go
Outdated
|
||
if string(query.Node.Team.Name) != resourceState.Primary.Attributes["name"] { | ||
return fmt.Errorf("Team name in state doesn't match remote name") | ||
} |
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.
In our other resource tests I think we only checked computer properties in this function, and I also note that name is checked in testAccCheckTeamRemoteValues
. Do we definitely want to check it here too?
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.
Probably excessive, I'll remove it!
Nice, tests work! Purely out of interest, could you describe this bug in a bit more detail? Did it manifest as an error when updating a team during |
When importing a resource, it was failing on resource "buildkite_team" "test" {
name = "example"
description = "a cool team of example"
privacy = "VISIBLE"
default_team = true
default_member_role = "MEMBER" # this field
} |
Oh, right. So the schema had Cool, nice find ✨ |
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.
ship it 👍
This is one of the resources that does not yet have acceptance tests associated with it. In order to guard against regressions, I have added the following tests:
During this work I discovered an error in importing teams. In order to resolve this, I added the DefaultMemberRole value which was present in the schema to the TeamNode struct, and added a mapping to updateTeam, so this PR doubles as a bugfix for importing teams.