Skip to content

Commit

Permalink
Merge pull request #6729 from terraform-providers/f/build-config-tweaks
Browse files Browse the repository at this point in the history
acctests: boosting the default concurrency to 20
  • Loading branch information
tombuildsstuff committed May 1, 2020
2 parents b092666 + 49758c0 commit 57c73af
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
9 changes: 8 additions & 1 deletion .teamcity/components/build_azure.kt
@@ -1,14 +1,21 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.ParametrizedWithType

class ClientConfiguration(var clientId: String, var clientSecret: String, val subscriptionId : String, val tenantId : String) {
class ClientConfiguration(var clientId: String,
var clientSecret: String,
val subscriptionId : String,
val tenantId : String,
val altClientId: String,
val altClientSecret: String) {
}

class LocationConfiguration(var primary : String, var secondary : String, var ternary : String, var rotate : Boolean) {
}

fun ParametrizedWithType.ConfigureAzureSpecificTestParameters(environment: String, config: ClientConfiguration, locationsForEnv: LocationConfiguration) {
hiddenPasswordVariable("env.ARM_CLIENT_ID", config.clientId, "The ID of the Service Principal used for Testing")
hiddenPasswordVariable("env.ARM_CLIENT_ID_ALT", config.altClientId, "The ID of the Alternate Service Principal used for Testing")
hiddenPasswordVariable("env.ARM_CLIENT_SECRET", config.clientSecret, "The Client Secret of the Service Principal used for Testing")
hiddenPasswordVariable("env.ARM_CLIENT_SECRET_ALT", config.altClientSecret, "The Client Secret of the Alternate Service Principal used for Testing")
hiddenVariable("env.ARM_ENVIRONMENT", environment, "The Azure Environment in which the tests are running")
hiddenVariable("env.ARM_PROVIDER_DYNAMIC_TEST", "%b".format(locationsForEnv.rotate), "Should tests rotate between the supported regions?")
hiddenPasswordVariable("env.ARM_SUBSCRIPTION_ID", config.subscriptionId, "The ID of the Azure Subscription used for Testing")
Expand Down
2 changes: 1 addition & 1 deletion .teamcity/components/build_components.kt
Expand Up @@ -34,7 +34,7 @@ fun BuildSteps.RunAcceptanceTests(providerName : String, packageName: String) {
} else {
step(ScriptBuildStep {
name = "Install tombuildsstuff/teamcity-go-test-json"
scriptContent = "wget https://github.com/tombuildsstuff/teamcity-go-test-json/releases/download/v0.1.0/teamcity-go-test-json_linux_amd64 && chmod +x teamcity-go-test-json_linux_amd64"
scriptContent = "wget https://github.com/tombuildsstuff/teamcity-go-test-json/releases/download/v0.2.0/teamcity-go-test-json_linux_amd64 && chmod +x teamcity-go-test-json_linux_amd64"
})

var servicePath = "./%s/internal/services/%s/...".format(providerName, packageName)
Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/project.kt
Expand Up @@ -22,6 +22,7 @@ fun buildConfigurationsForServices(services: Map<String, String>, providerName :
var locationsForEnv = locations.get(environment)!!

services.forEach { (serviceName, displayName) ->
// TODO: overriding locations
var defaultTestConfig = testConfiguration(defaultParallelism, defaultStartHour)
var testConfig = serviceTestConfigurationOverrides.getOrDefault(serviceName, defaultTestConfig)
var runNightly = runNightly.getOrDefault(environment, false)
Expand Down
11 changes: 1 addition & 10 deletions .teamcity/components/settings.kt
Expand Up @@ -2,7 +2,7 @@
var defaultStartHour = 0

// specifies the default level of parallelism per-service-package
var defaultParallelism = 10
var defaultParallelism = 20

var locations = mapOf(
"public" to LocationConfiguration("westeurope", "eastus2", "francecentral", false),
Expand All @@ -16,21 +16,12 @@ var runNightly = mapOf(

// specifies a list of services which should be run with a custom test configuration
var serviceTestConfigurationOverrides = mapOf(
// The API Management tests take ~45m each
"apimanagement" to testConfiguration(10, defaultStartHour),

// Compute is a large package
"compute" to testConfiguration(10, defaultStartHour),

// The AKS API has a low rate limit
"containers" to testConfiguration(5, defaultStartHour),

// Data Lake has a low quota
"datalake" to testConfiguration(2, defaultStartHour),

// Network is a large package
"network" to testConfiguration(10, defaultStartHour),

// SignalR only allows provisioning one "Free" instance at a time,
// which is used in multiple tests
"signalr" to testConfiguration(1, defaultStartHour)
Expand Down
4 changes: 3 additions & 1 deletion .teamcity/settings.kts
Expand Up @@ -9,7 +9,9 @@ var clientSecret = DslContext.getParameter("clientSecret", "")
var subscriptionId = DslContext.getParameter("subscriptionId", "")
var tenantId = DslContext.getParameter("tenantId", "")
var environment = DslContext.getParameter("environment", "public")
var clientIdAlt = DslContext.getParameter("clientIdAlt", "")
var clientSecretAlt = DslContext.getParameter("clientSecretAlt", "")

var clientConfig = ClientConfiguration(clientId, clientSecret, subscriptionId, tenantId)
var clientConfig = ClientConfiguration(clientId, clientSecret, subscriptionId, tenantId, clientIdAlt, clientSecretAlt)

project(AzureRM(environment, clientConfig))
2 changes: 1 addition & 1 deletion .teamcity/tests/helpers.kt
Expand Up @@ -3,5 +3,5 @@ package tests
import ClientConfiguration

fun TestConfiguration() : ClientConfiguration {
return ClientConfiguration("clientId", "clientSecret", "subscriptionId", "tenantId")
return ClientConfiguration("clientId", "clientSecret", "subscriptionId", "tenantId", "altClientId", "altClientSecret")
}

0 comments on commit 57c73af

Please sign in to comment.