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/github: Randomize acceptance tests #14460

Merged
merged 4 commits into from
May 15, 2017
Merged

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented May 13, 2017

This is to get rid of dependency on a static repository name test-repo and make acceptance tests work in any organisation without extra manual setup.

Test plan

make testacc TEST=./builtin/providers/github TESTARGS='-run=TestAccGithub'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/13 11:13:51 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/github -v -run=TestAccGithub -timeout 120m
=== RUN   TestAccGithubBranchProtection_basic
--- FAIL: TestAccGithubBranchProtection_basic (6.76s)
	testing.go:280: Step 0 error: Error applying: 1 error(s) occurred:

		* github_branch_protection.master: 1 error(s) occurred:

		* github_branch_protection.master: PUT https://api.github.com/repos/terraformtesting/tf-acc-test-branch-prot-hwut9/branches/master/protection: 422 Invalid request.

		"enforce_admins" wasn't supplied. []
=== RUN   TestAccGithubBranchProtection_importBasic
--- FAIL: TestAccGithubBranchProtection_importBasic (1.95s)
	testing.go:280: Step 0 error: Error applying: 1 error(s) occurred:

		* github_branch_protection.master: 1 error(s) occurred:

		* github_branch_protection.master: PUT https://api.github.com/repos/terraformtesting/cp9by/branches/master/protection: 422 Invalid request.

		"enforce_admins" wasn't supplied. []
=== RUN   TestAccGithubIssueLabel_basic
--- PASS: TestAccGithubIssueLabel_basic (4.88s)
=== RUN   TestAccGithubIssueLabel_existingLabel
--- PASS: TestAccGithubIssueLabel_existingLabel (3.38s)
=== RUN   TestAccGithubIssueLabel_importBasic
--- PASS: TestAccGithubIssueLabel_importBasic (3.38s)
=== RUN   TestAccGithubMembership_basic
--- PASS: TestAccGithubMembership_basic (1.74s)
=== RUN   TestAccGithubMembership_importBasic
--- PASS: TestAccGithubMembership_importBasic (1.64s)
=== RUN   TestAccGithubOrganizationWebhook_basic
--- PASS: TestAccGithubOrganizationWebhook_basic (3.07s)
=== RUN   TestAccGithubRepositoryCollaborator_basic
--- PASS: TestAccGithubRepositoryCollaborator_basic (3.58s)
=== RUN   TestAccGithubRepositoryCollaborator_importBasic
--- PASS: TestAccGithubRepositoryCollaborator_importBasic (3.38s)
=== RUN   TestAccGithubRepository_basic
--- PASS: TestAccGithubRepository_basic (3.07s)
=== RUN   TestAccGithubRepository_importBasic
--- PASS: TestAccGithubRepository_importBasic (2.15s)
=== RUN   TestAccGithubRepositoryWebhook_basic
--- PASS: TestAccGithubRepositoryWebhook_basic (4.45s)
=== RUN   TestAccGithubTeamMembership_basic
--- PASS: TestAccGithubTeamMembership_basic (5.48s)
=== RUN   TestAccGithubTeamMembership_importBasic
--- PASS: TestAccGithubTeamMembership_importBasic (2.50s)
=== RUN   TestAccGithubTeamRepository_basic
--- PASS: TestAccGithubTeamRepository_basic (4.50s)
=== RUN   TestAccGithubTeamRepository_importBasic
--- PASS: TestAccGithubTeamRepository_importBasic (2.83s)
=== RUN   TestAccGithubTeam_basic
--- PASS: TestAccGithubTeam_basic (4.10s)
=== RUN   TestAccGithubTeam_importBasic
--- PASS: TestAccGithubTeam_importBasic (1.42s)
=== RUN   TestAccGithubUtilRole_validation
--- PASS: TestAccGithubUtilRole_validation (0.00s)
=== RUN   TestAccGithubUtilTwoPartID
--- PASS: TestAccGithubUtilTwoPartID (0.00s)
FAIL
exit status 1
FAIL	github.com/hashicorp/terraform/builtin/providers/github	64.311s
make: *** [testacc] Error 1

The two failures are caused by a breaking change in the upstream API, related PR: #14195

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.

LGTM!

@radeksimko radeksimko merged commit 65af35f into master May 15, 2017
@radeksimko radeksimko deleted the b-github-test-repo branch May 15, 2017 12:54
@ghost
Copy link

ghost commented Apr 12, 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 12, 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