From 9ce7337e2d3da2100786c7762a17a42103dbdb77 Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Thu, 25 Apr 2024 10:47:45 +0200 Subject: [PATCH] Add test duration and fix job names in destroy workflows --- .github/workflows/aks-destroy.yml | 6 +++--- .github/workflows/aks-tests.yml | 6 ++++++ .github/workflows/aks.yml | 6 ++++++ .github/workflows/eks-destroy.yml | 6 +++--- .github/workflows/eks-tests.yml | 6 ++++++ .github/workflows/eks.yml | 6 ++++++ .github/workflows/gke-destroy.yml | 6 +++--- .github/workflows/gke-tests.yml | 6 ++++++ .github/workflows/gke.yml | 6 ++++++ modules/tests/httpbin/main.tf | 2 +- modules/tests/httpbin/vars.tf | 4 ++++ modules/tests/timestamp/main.tf | 2 +- modules/tests/timestamp/vars.tf | 4 ++++ modules/tests/vars.tests.tf | 1 + tests/main.tf | 1 + tests/main.tfvars.example | 3 ++- tests/vars.tests.tf | 5 +++++ 17 files changed, 64 insertions(+), 12 deletions(-) diff --git a/.github/workflows/aks-destroy.yml b/.github/workflows/aks-destroy.yml index ed5e251..3e5e394 100644 --- a/.github/workflows/aks-destroy.yml +++ b/.github/workflows/aks-destroy.yml @@ -79,7 +79,7 @@ jobs: kubectl config rename-context $(kubectl config current-context) performance-testing-aks - - name: Run Tests + - name: Destroy Tests run: | cd tests terraform init @@ -89,7 +89,7 @@ jobs: --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ --auto-approve - - name: Deploy testing resources + - name: Destroy testing resources run: | cd deployments terraform init @@ -105,7 +105,7 @@ jobs: --var="grafana_service_type=LoadBalancer" \ --auto-approve - - name: Stand up AKS cluster + - name: Destroy AKS cluster run: | cd aks terraform init diff --git a/.github/workflows/aks-tests.yml b/.github/workflows/aks-tests.yml index ab06013..5380710 100644 --- a/.github/workflows/aks-tests.yml +++ b/.github/workflows/aks-tests.yml @@ -20,6 +20,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: performance_test: @@ -57,6 +62,7 @@ jobs: --var="kubernetes_config_context=performance-testing-aks" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/.github/workflows/aks.yml b/.github/workflows/aks.yml index bde5e34..2c3952d 100644 --- a/.github/workflows/aks.yml +++ b/.github/workflows/aks.yml @@ -47,6 +47,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: performance_test: @@ -112,6 +117,7 @@ jobs: --var="kubernetes_config_context=performance-testing-aks" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/.github/workflows/eks-destroy.yml b/.github/workflows/eks-destroy.yml index d098cb0..e5f0edd 100644 --- a/.github/workflows/eks-destroy.yml +++ b/.github/workflows/eks-destroy.yml @@ -79,7 +79,7 @@ jobs: kubectl config rename-context $(kubectl config current-context) performance-testing-eks - - name: Run Tests + - name: Destroy Tests run: | cd tests terraform init @@ -89,7 +89,7 @@ jobs: --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ --auto-approve - - name: Deploy testing resources + - name: Destroy testing resources run: | cd deployments terraform init @@ -105,7 +105,7 @@ jobs: --var="grafana_service_type=LoadBalancer" \ --auto-approve - - name: Stand up EKS cluster + - name: Destroy EKS cluster run: | cd eks terraform init diff --git a/.github/workflows/eks-tests.yml b/.github/workflows/eks-tests.yml index 5e9a155..509e2c4 100644 --- a/.github/workflows/eks-tests.yml +++ b/.github/workflows/eks-tests.yml @@ -20,6 +20,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: performance_test: @@ -57,6 +62,7 @@ jobs: --var="kubernetes_config_context=performance-testing-eks" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/.github/workflows/eks.yml b/.github/workflows/eks.yml index 3b46806..5d42c21 100644 --- a/.github/workflows/eks.yml +++ b/.github/workflows/eks.yml @@ -47,6 +47,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: performance_test: @@ -112,6 +117,7 @@ jobs: --var="kubernetes_config_context=performance-testing-eks" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/.github/workflows/gke-destroy.yml b/.github/workflows/gke-destroy.yml index 3ce9ddb..1f591fe 100644 --- a/.github/workflows/gke-destroy.yml +++ b/.github/workflows/gke-destroy.yml @@ -93,7 +93,7 @@ jobs: kubectl config rename-context $(kubectl config current-context) performance-testing-gke - - name: Run Tests + - name: Destroy Tests run: | cd tests terraform init @@ -103,7 +103,7 @@ jobs: --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ --auto-approve - - name: Deploy testing resources + - name: Destroy testing resources run: | cd deployments terraform init @@ -119,7 +119,7 @@ jobs: --var="grafana_service_type=LoadBalancer" \ --auto-approve - - name: Stand up GKE cluster + - name: Destroy GKE cluster run: | cd gke terraform init diff --git a/.github/workflows/gke-tests.yml b/.github/workflows/gke-tests.yml index e05d8f1..4458c65 100644 --- a/.github/workflows/gke-tests.yml +++ b/.github/workflows/gke-tests.yml @@ -20,6 +20,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: tests: @@ -63,6 +68,7 @@ jobs: --var="kubernetes_config_context=performance-testing-gke" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/.github/workflows/gke.yml b/.github/workflows/gke.yml index 1650abc..b69cf10 100644 --- a/.github/workflows/gke.yml +++ b/.github/workflows/gke.yml @@ -55,6 +55,11 @@ on: required: false default: false type: boolean + tests_duration: + description: 'Duration of Tests in Minutes' + required: false + default: 15 + type: number jobs: performance_test: @@ -127,6 +132,7 @@ jobs: --var="kubernetes_config_context=performance-testing-gke" \ --var="tests_timestamp_enabled=${{ inputs.tests_timestamp_enabled }}" \ --var="tests_httpbin_enabled=${{ inputs.tests_httpbin_enabled }}" \ + --var="tests_duration=${{ inputs.tests_duration }}" \ --auto-approve - name: Access to Grafana Dashboard diff --git a/modules/tests/httpbin/main.tf b/modules/tests/httpbin/main.tf index 1eb3c1d..38258e6 100644 --- a/modules/tests/httpbin/main.tf +++ b/modules/tests/httpbin/main.tf @@ -24,7 +24,7 @@ export const options = { executor: 'constant-vus', exec: 'success', vus: 50, - duration: '15m', + duration: '${var.duration}m', } } }; diff --git a/modules/tests/httpbin/vars.tf b/modules/tests/httpbin/vars.tf index bf778b8..bae623c 100644 --- a/modules/tests/httpbin/vars.tf +++ b/modules/tests/httpbin/vars.tf @@ -9,3 +9,7 @@ variable "url" { variable "parallelism" { type = number } + +variable "duration" { + type = number +} diff --git a/modules/tests/timestamp/main.tf b/modules/tests/timestamp/main.tf index cff0321..e2ec205 100644 --- a/modules/tests/timestamp/main.tf +++ b/modules/tests/timestamp/main.tf @@ -24,7 +24,7 @@ export const options = { executor: 'constant-vus', exec: 'get', vus: 50, - duration: '15m', + duration: '${var.duration}m', } } }; diff --git a/modules/tests/timestamp/vars.tf b/modules/tests/timestamp/vars.tf index bf778b8..bae623c 100644 --- a/modules/tests/timestamp/vars.tf +++ b/modules/tests/timestamp/vars.tf @@ -9,3 +9,7 @@ variable "url" { variable "parallelism" { type = number } + +variable "duration" { + type = number +} diff --git a/modules/tests/vars.tests.tf b/modules/tests/vars.tests.tf index 5cf050d..e933dc8 100644 --- a/modules/tests/vars.tests.tf +++ b/modules/tests/vars.tests.tf @@ -3,5 +3,6 @@ variable "tests" { parallelism = number timestamp = bool httpbin = bool + duration = number }) } diff --git a/tests/main.tf b/tests/main.tf index 3d1136e..0a104dc 100644 --- a/tests/main.tf +++ b/tests/main.tf @@ -17,5 +17,6 @@ module "tests" { parallelism = var.tests_parallelism timestamp = var.tests_timestamp_enabled httpbin = var.tests_httpbin_enabled + duration = var.tests_duration } } diff --git a/tests/main.tfvars.example b/tests/main.tfvars.example index e0ffef0..65e31f6 100644 --- a/tests/main.tfvars.example +++ b/tests/main.tfvars.example @@ -6,4 +6,5 @@ gravitee_enabled = false tests_parallelism = 4 tests_timestamp_enabled = true -tests_httpbin_enabled = false \ No newline at end of file +tests_httpbin_enabled = false +tests_duration = 15 \ No newline at end of file diff --git a/tests/vars.tests.tf b/tests/vars.tests.tf index 8a6a6a4..3e42869 100644 --- a/tests/vars.tests.tf +++ b/tests/vars.tests.tf @@ -12,3 +12,8 @@ variable "tests_httpbin_enabled" { type = bool default = false } + +variable "tests_duration" { + type = number + default = 15 +} \ No newline at end of file