Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HDINSIGHT integration tests optional due to resource constraint #271

Merged
merged 2 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions terraform/azure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ resource "azurerm_kubernetes_cluster" "cluster" {


resource "azurerm_storage_account" "hdinsight_storage_account" {
count = var.hd_insight_count
name = "hdinsight${random_string.storage_account.result}"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
Expand All @@ -719,13 +720,15 @@ resource "azurerm_storage_account" "hdinsight_storage_account" {
}

resource "azurerm_storage_container" "hdinsight_storage_container" {
name = "hdinsight${random_string.storage_account.result}"
storage_account_name = azurerm_storage_account.hdinsight_storage_account.name
count = var.hd_insight_count
name = "hdinsight${random_string.storage_account.result}"
storage_account_name = azurerm_storage_account.hdinsight_storage_account[0].name
container_access_type = "private"
}

resource "azurerm_hdinsight_interactive_query_cluster" "hdinsight_cluster" {
name = "hdinsight6fbw66f8ch"
count = var.hd_insight_count
name = "hdinsight6fbw66f8ch"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
cluster_version = "4.0"
Expand All @@ -742,8 +745,8 @@ resource "azurerm_hdinsight_interactive_query_cluster" "hdinsight_cluster" {
}

storage_account {
storage_container_id = azurerm_storage_container.hdinsight_storage_container.id
storage_account_key = azurerm_storage_account.hdinsight_storage_account.primary_access_key
storage_container_id = azurerm_storage_container.hdinsight_storage_container[0].id
storage_account_key = azurerm_storage_account.hdinsight_storage_account[0].primary_access_key
is_default = true
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -313,5 +313,5 @@ output "application_gateway_name" {

output "hdinsight_cluster_name" {
description = "HDINSIGHT cluster name."
value = azurerm_hdinsight_interactive_query_cluster.hdinsight_cluster.name
value = var.hd_insight_count > 0 ? azurerm_hdinsight_interactive_query_cluster.hdinsight_cluster.0.name : ""
}
5 changes: 5 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ variable "lb_port" {
http-test = ["990", "Tcp", "990", "SourceIPProtocol"]
}
}

variable "hd_insight_count" {
# This is added due to resource constraints.
default = 0
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
resource_group = input('resource_group', value: nil)
cluster_name = input('hdinsight_cluster_name', value: nil)
cluster_name = input('hdinsight_cluster_name', value: '')

control 'azurerm_hdinsight_cluster' do
only_if { !cluster_name.empty? }
describe azurerm_hdinsight_cluster(resource_group: resource_group, name: cluster_name) do
it { should exist }
its('name') { should cmp cluster_name }
Expand Down