Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions github/acc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
type testAccConfig struct {
// Target configuration
baseURL *url.URL
isGHES bool

// Auth configuration
authMode testMode
Expand Down Expand Up @@ -100,19 +101,15 @@ func TestMain(m *testing.M) {
authMode = anonymous
}

u, ok := os.LookupEnv("GITHUB_BASE_URL")
if !ok {
u = DotComAPIURL
}

baseURL, err := url.Parse(u)
baseURL, isGHES, err := getBaseURL(os.Getenv("GITHUB_BASE_URL"))
if err != nil {
fmt.Printf("Error parsing base URL: %s\n", err)
os.Exit(1)
}

config := testAccConfig{
baseURL: baseURL,
isGHES: isGHES,
authMode: authMode,
testPublicRepository: "terraform-provider-github",
testPublicRepositoryOwner: "integrations",
Expand Down Expand Up @@ -194,6 +191,7 @@ func getTestMeta() (*Owner, error) {
Token: testAccConf.token,
Owner: testAccConf.owner,
BaseURL: testAccConf.baseURL,
IsGHES: testAccConf.isGHES,
}

meta, err := config.Meta()
Expand Down