Better support for GitHub Enterprise integration tests

- Remove EnterpriseUrl in integration test Helper class, but leave ability to override custom URL (to allow specific use case of targetting regular integration tests at a custom URL)
- Move GitHub Enterprise explicit support to a new integration helper class using new OCTOKIT_GHE_ environment variables for GHE
- Change existing GitHub Enterprise integration tests and EnterpriseTestAttribute to use the new EnterpriseHelper methods
- Enhance configure-intergration-tests.ps1 script to cater for environment variable changes
This commit is contained in:
Ryan Gribble
2016-01-27 00:12:22 +10:00
parent 5f2cc4cb4e
commit 535709c368
7 changed files with 198 additions and 22 deletions
+20 -3
View File
@@ -19,6 +19,8 @@ function AskYesNoQuestion([string]$question, [string]$key)
}
Write-Host
return ($answer -eq "Y")
}
function VerifyEnvironmentVariable([string]$friendlyName, [string]$key, [bool]$optional = $false)
@@ -71,11 +73,26 @@ VerifyEnvironmentVariable "account name" "OCTOKIT_GITHUBUSERNAME"
VerifyEnvironmentVariable "account password" "OCTOKIT_GITHUBPASSWORD" $true
VerifyEnvironmentVariable "OAuth token" "OCTOKIT_OAUTHTOKEN"
AskYesNoQuestion "Do you have private repositories associated with your test account?" "OCTOKIT_PRIVATEREPOSITORIES"
AskYesNoQuestion "Do you have private repositories associated with your test account?" "OCTOKIT_PRIVATEREPOSITORIES" | Out-Null
VerifyEnvironmentVariable "organization name" "OCTOKIT_GITHUBORGANIZATION" $true
VerifyEnvironmentVariable "GitHub Enterprise Server URL" "OCTOKIT_GITHUBENTERPRISEURL" $true
VerifyEnvironmentVariable "Override GitHub URL" "OCTOKIT_CUSTOMURL" $true
VerifyEnvironmentVariable "application ClientID" "OCTOKIT_CLIENTID" $true
VerifyEnvironmentVariable "application Secret" "OCTOKIT_CLIENTSECRET" $true
VerifyEnvironmentVariable "application Secret" "OCTOKIT_CLIENTSECRET" $true
if (AskYesNoQuestion "Do you wish to enable GitHub Enterprise (GHE) Integration Tests?" "OCTOKIT_GHE_ENABLED")
{
VerifyEnvironmentVariable "GitHub Enterprise account name" "OCTOKIT_GHE_USERNAME"
VerifyEnvironmentVariable "GitHub Enterprise account password" "OCTOKIT_GHE_PASSWORD" $true
VerifyEnvironmentVariable "GitHub Enterprise OAuth token" "OCTOKIT_GHE_OAUTHTOKEN"
VerifyEnvironmentVariable "GitHub Enterprise organization name" "OCTOKIT_GHE_ORGANIZATION" $true
VerifyEnvironmentVariable "GitHub Enterprise URL" "OCTOKIT_GHE_URL" $true
VerifyEnvironmentVariable "GitHub Enterprise application ClientID" "OCTOKIT_GHE_CLIENTID" $true
VerifyEnvironmentVariable "GitHub Enterprise application Secret" "OCTOKIT_GHE_CLIENTSECRET" $true
}