Skip to content

Commit

Permalink
revert where needed to master
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Apr 17, 2020
1 parent fd40520 commit f1cb72d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
with:
RUN_FILTER: ${{ env.RUN_FILTER }}
GITHUB_ORGANIZATION: terraformtesting
GITHUB_BASE_URL: "https://api.github.com/"
GITHUB_TEST_USER: github-terraform-test-user
GITHUB_TEST_USER_NAME: "Test User"
GITHUB_TEST_USER_EMAIL: [email protected]
Expand Down
20 changes: 5 additions & 15 deletions github/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
var testUser string = os.Getenv("GITHUB_TEST_USER")
var testCollaborator string = os.Getenv("GITHUB_TEST_COLLABORATOR")
var testOrganization string = os.Getenv("GITHUB_ORGANIZATION")
var isEnterprise string = os.Getenv("ENTERPRISE_ACCOUNT")
var apiVersion string = os.Getenv("GITHUB_REST_API_VERSION")

var testAccProviders map[string]terraform.ResourceProvider
var testAccProviderFactories func(providers *[]*schema.Provider) map[string]terraform.ResourceProviderFactory
Expand Down Expand Up @@ -52,9 +50,6 @@ func TestProvider_impl(t *testing.T) {
}

func testAccPreCheck(t *testing.T) {
if v := os.Getenv("GITHUB_BASE_URL"); v == "" {
t.Fatal("GITHUB_BASE_URL must be set for acceptance tests")
}
if v := os.Getenv("GITHUB_TOKEN"); v == "" {
t.Fatal("GITHUB_TOKEN must be set for acceptance tests")
}
Expand Down Expand Up @@ -201,15 +196,10 @@ func TestAccProvider_insecure(t *testing.T) {

func githubTLSApiMock(port, certFile, keyFile string, t *testing.T) (string, func() error) {
mux := http.NewServeMux()
if apiVersion == "" {
apiVersion = "v3"
}
userPath := fmt.Sprintf("/%s/users/hashibot", apiVersion)
orgPath := fmt.Sprintf("/%s/orgs/%s", apiVersion, testOrganization)
mux.HandleFunc(userPath, testRespondJson(userResponseBody))
mux.HandleFunc(userPath+"/gpg_keys", testRespondJson(gpgKeysResponseBody))
mux.HandleFunc(userPath+"/keys", testRespondJson(keysResponseBody))
mux.HandleFunc(orgPath, testRespondJson(orgResponseBody(port)))
mux.HandleFunc("/users/hashibot", testRespondJson(userResponseBody))
mux.HandleFunc("/users/hashibot/gpg_keys", testRespondJson(gpgKeysResponseBody))
mux.HandleFunc("/users/hashibot/keys", testRespondJson(keysResponseBody))
mux.HandleFunc("/orgs/"+testOrganization, testRespondJson(orgResponseBody(port)))

server := &http.Server{
Addr: ":" + port,
Expand Down Expand Up @@ -330,7 +320,7 @@ const keysResponseBody = `[
]`

func orgResponseBody(port string) string {
url := fmt.Sprintf(`https://localhost:%s/v3/orgs/%s`, port, testOrganization)
url := fmt.Sprintf(`https://localhost:%s/orgs/%s`, port, testOrganization)
return fmt.Sprintf(`
{
"login": "%s",
Expand Down

0 comments on commit f1cb72d

Please sign in to comment.