Skip to content

Commit

Permalink
test(mc): Update tests as per changes in helm-release module
Browse files Browse the repository at this point in the history
  • Loading branch information
SRodi committed Feb 7, 2025
1 parent 8ee70c3 commit 9d100e9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 52 deletions.
12 changes: 1 addition & 11 deletions test/multicloud/examples/integration/retina-kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,5 @@ module "retina" {
repository_url = var.retina_repository_url
chart_version = var.retina_chart_version
chart_name = var.retina_chart_name
values = [jsonencode(
{
image = {
tag = "v0.0.24"
}
logLevel = "info"
operator = {
tag = "v0.0.24"
}
}
)]
values = var.retina_values
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ variable "retina_chart_name" {

variable "retina_values" {
description = "This corresponds to Helm values.yaml"
type = list(string)
default = []
type = any
}
20 changes: 9 additions & 11 deletions test/multicloud/live/retina-aks/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ locals {
retina_repository_url = "oci://ghcr.io/microsoft/retina/charts"
retina_chart_version = "v0.0.24"
retina_chart_name = "retina"
retina_values = [jsonencode(
{
image = {
tag = "v0.0.24"
}
logLevel = "info"
operator = {
tag = "v0.0.24"
}
retina_values = {
image = {
tag = "v0.0.24"
}
logLevel = "info"
operator = {
tag = "v0.0.24"
}
)]
}

prometheus_release_name = "prometheus"
prometheus_repository_url = "https://prometheus-community.github.io/helm-charts"
prometheus_chart_version = "68.4.3"
prometheus_chart_name = "kube-prometheus-stack"
prometheus_values = [
"${file("../../../../deploy/standard/prometheus/values.yaml")}"
file("../../../../deploy/standard/prometheus/values.yaml")
]

aks_security_rules = [
Expand Down
20 changes: 9 additions & 11 deletions test/multicloud/live/retina-gke/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@ locals {
retina_repository_url = "oci://ghcr.io/microsoft/retina/charts"
retina_chart_version = "v0.0.24"
retina_chart_name = "retina"
retina_values = [jsonencode(
{
image = {
tag = "v0.0.24"
}
logLevel = "info"
operator = {
tag = "v0.0.24"
}
retina_values = {
image = {
tag = "v0.0.24"
}
)]
logLevel = "info"
operator = {
tag = "v0.0.24"
}
}

prometheus_release_name = "prometheus"
prometheus_repository_url = "https://prometheus-community.github.io/helm-charts"
prometheus_chart_version = "68.4.3"
prometheus_chart_name = "kube-prometheus-stack"
prometheus_values = [
"${file("../../../../deploy/standard/prometheus/values.yaml")}"
file("../../../../deploy/standard/prometheus/values.yaml")
]
gke_firwall_rules = {
inbound = {
Expand Down
2 changes: 1 addition & 1 deletion test/multicloud/modules/helm-release/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ resource "helm_release" "release" {
repository = var.repository_url
chart = var.chart_name
version = var.chart_version
values = var.values
values = [jsonencode(var.values)]
}
2 changes: 1 addition & 1 deletion test/multicloud/modules/helm-release/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ variable "chart_name" {

variable "values" {
description = "This corresponds to Helm values.yaml"
type = list(string)
type = any
}
22 changes: 7 additions & 15 deletions test/multicloud/test/integration/retina_gke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,16 @@ func TestRetinaGKEIntegration(t *testing.T) {
"project": "mc-retina", // TODO: replace with actual project once we get gcloud access
"machine_type": "e2-standard-4",
"retina_chart_version": utils.RetinaVersion,
"retina_values": []map[string]interface{}{
{
"name": "logLevel",
"value": "info",
},
{
"name": "operator.tag",
"value": utils.RetinaVersion,
},
"retina_values": map[string]interface{}{
// Example using a public image built during testing
{
"name": "image.repository",
"value": "acnpublic.azurecr.io/xiaozhiche320/retina/retina-agent",
"image": map[string]interface{}{
"tag": "c17d5ea-linux-amd64",
"repository": "acnpublic.azurecr.io/xiaozhiche320/retina/retina-agent",
},
{
"name": "image.tag",
"value": "c17d5ea-linux-amd64",
"operator": map[string]interface{}{
"tag": utils.RetinaVersion,
},
"logLevel": "info",
},
},
}
Expand Down
9 changes: 9 additions & 0 deletions test/multicloud/test/integration/retina_kind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ func TestRetinaKindIntegration(t *testing.T) {
Vars: map[string]interface{}{
"prefix": "test-integration",
"retina_chart_version": utils.RetinaVersion,
"retina_values": map[string]interface{}{
"image": map[string]interface{}{
"tag": "v0.0.24",
},
"operator": map[string]interface{}{
"tag": "v0.0.24",
},
"logLevel": "debug",
},
},
}

Expand Down

0 comments on commit 9d100e9

Please sign in to comment.