From dc0cb70e9587313655c39674b26846494a024dc2 Mon Sep 17 00:00:00 2001 From: Paul Stack Date: Fri, 18 Nov 2016 13:38:46 +0200 Subject: [PATCH] provider/github: Creating a github repository before adding a label (#10213) --- .../resource_github_issue_label_test.go | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/builtin/providers/github/resource_github_issue_label_test.go b/builtin/providers/github/resource_github_issue_label_test.go index 1cefa6debe..f3882767c0 100644 --- a/builtin/providers/github/resource_github_issue_label_test.go +++ b/builtin/providers/github/resource_github_issue_label_test.go @@ -101,17 +101,43 @@ func testAccGithubIssueLabelDestroy(s *terraform.State) error { } var testAccGithubIssueLabelConfig string = fmt.Sprintf(` - resource "github_issue_label" "test" { - repository = "%s" - name = "foo" - color = "000000" - } +resource "github_repository" "foo" { + name = "%s" + description = "Terraform acceptance tests!" + homepage_url = "http://example.com/" + + # So that acceptance tests can be run in a github organization + # with no billing + private = false + + has_issues = false + has_wiki = false + has_downloads = false +} +resource "github_issue_label" "test" { + repository = "${github_repository.foo.name}" + name = "foo" + color = "000000" +} `, testRepo) var testAccGithubIssueLabelUpdateConfig string = fmt.Sprintf(` - resource "github_issue_label" "test" { - repository = "%s" - name = "bar" - color = "FFFFFF" - } +resource "github_repository" "foo" { + name = "%s" + description = "Terraform acceptance tests!" + homepage_url = "http://example.com/" + + # So that acceptance tests can be run in a github organization + # with no billing + private = false + + has_issues = false + has_wiki = false + has_downloads = false +} +resource "github_issue_label" "test" { + repository = "${github_repository.foo.name}" + name = "bar" + color = "FFFFFF" +} `, testRepo)