From 850ce8075f926b0f4bff2a86c49f4db6a29a179a Mon Sep 17 00:00:00 2001 From: Rodrigue Koffi Date: Wed, 31 May 2023 15:19:05 +0000 Subject: [PATCH] Plan tests (#166) * Updated plan-examples.yml to support e2e tests for multi cluster example (#165) * Updated plan-examples.yml to support e2e tests for multi cluster example * Put the variables in right place with right values * (to drop): Allow running tests in branch --------- Co-authored-by: Rodrigue Koffi * Force running tests * Update plan-examples.yml --------- Co-authored-by: Vijay Chintalapati --- .github/workflows/plan-examples.yml | 10 +++++++++- .github/workflows/pre-commit.yaml | 6 ++++++ examples/eks-multicluster/main.tf | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/plan-examples.yml b/.github/workflows/plan-examples.yml index 7116d0c..e876fbf 100644 --- a/.github/workflows/plan-examples.yml +++ b/.github/workflows/plan-examples.yml @@ -5,6 +5,10 @@ on: pull_request_target: branches: - main + # this will allow to run test on main and not modify the status badge when opening a PR + push: + branches: ["main"] + workflow_dispatch: concurrency: @@ -90,6 +94,8 @@ jobs: TF_VAR_aws_region: us-west-2 TF_VAR_managed_grafana_workspace_id: ${{ secrets.GRAFANA_WORKSPACE_ID }} TF_VAR_eks_cluster_id: e2e-tests + TF_VAR_eks_cluster_1_id: e2e-tests + TF_VAR_eks_cluster_2_id: e2e-tests TF_VAR_managed_prometheus_workspace_ids: ${{ secrets.PROMETHEUS_WORKSPACE_ID }} with: project-name: terraform-plan @@ -98,7 +104,9 @@ jobs: TF_VAR_aws_region, TF_VAR_managed_grafana_workspace_id, TF_VAR_eks_cluster_id, - TF_VAR_managed_prometheus_workspace_ids + TF_VAR_managed_prometheus_workspace_ids, + TF_VAR_eks_cluster_1_id, + TF_VAR_eks_cluster_2_id buildspec-override: | version: 0.2 phases: diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 156f835..7ae848c 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -8,6 +8,12 @@ on: - '**.tf' - '**.yml' - '**.yaml' + push: + branches: ["main"] + paths: + - '**.tf' + - '**.yml' + - '**.yaml' env: TERRAFORM_DOCS_VERSION: v0.16.0 diff --git a/examples/eks-multicluster/main.tf b/examples/eks-multicluster/main.tf index e0d08a3..cc84d97 100644 --- a/examples/eks-multicluster/main.tf +++ b/examples/eks-multicluster/main.tf @@ -65,8 +65,8 @@ module "eks_cluster_2_monitoring" { enable_cert_manager = true enable_java = true - # Since the following were enabled in conjunction with the set up of the eks_cluster_1 EKS cluster, we will skip - # them with the eks_cluster_2 EKS cluster + # Since the following were enabled in conjunction with the set up of the + # eks_cluster_1 EKS cluster, we will skip them with the eks_cluster_2 EKS cluster enable_dashboards = false enable_alerting_rules = false enable_recording_rules = false