From 883baa54e002202d7d6ade22cf7801f525b506a1 Mon Sep 17 00:00:00 2001 From: Chao Dai <45011425+chaodaiG@users.noreply.github.com> Date: Thu, 22 Oct 2020 09:54:57 -0700 Subject: [PATCH] Rename all e2e test scripts to make people not want to run them locally (#884) --- .gitignore | 2 +- scripts/{e2e-test.sh => ci-e2e-test.sh} | 10 +++++----- scripts/{terraform.sh => ci-terraform.sh} | 8 ++++---- {terraform-e2e => terraform-e2e-ci}/README.md | 6 +++--- {terraform-e2e => terraform-e2e-ci}/main.tf | 0 5 files changed, 13 insertions(+), 13 deletions(-) rename scripts/{e2e-test.sh => ci-e2e-test.sh} (95%) rename scripts/{terraform.sh => ci-terraform.sh} (96%) rename {terraform-e2e => terraform-e2e-ci}/README.md (95%) rename {terraform-e2e => terraform-e2e-ci}/main.tf (100%) diff --git a/.gitignore b/.gitignore index cb5631b4a..56dd5299e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ *.terraform/ *.tfvars terraform/state.tf -terraform-e2e/state.tf +terraform-e2e-ci/state.tf */crash.log # Local things diff --git a/scripts/e2e-test.sh b/scripts/ci-e2e-test.sh similarity index 95% rename from scripts/e2e-test.sh rename to scripts/ci-e2e-test.sh index d80f81491..e51a972be 100755 --- a/scripts/e2e-test.sh +++ b/scripts/ci-e2e-test.sh @@ -27,7 +27,7 @@ function smoke() { export PROJECT_ID fi - ${ROOT}/scripts/terraform.sh smoke + ${ROOT}/scripts/ci-terraform.sh smoke } function incremental() { @@ -38,13 +38,13 @@ function incremental() { export PROJECT_ID fi - ${ROOT}/scripts/terraform.sh init + ${ROOT}/scripts/ci-terraform.sh init - pushd "${ROOT}/terraform-e2e" >/dev/null 2>&1 + pushd "${ROOT}/terraform-e2e-ci" >/dev/null 2>&1 terraform taint module.en.null_resource.build terraform taint module.en.null_resource.migrate popd >/dev/null 2>&1 - ${ROOT}/scripts/terraform.sh deploy + ${ROOT}/scripts/ci-terraform.sh deploy export_terraform_output project_id E2E_PROJECT_ID export_terraform_output db_apikey_database_key_secret E2E_DB_APIKEY_DATABASE_KEY @@ -80,7 +80,7 @@ function run_e2e_test() { # $2 ... exported variable name function export_terraform_output() { local output - pushd "${ROOT}/terraform-e2e" >/dev/null 2>&1 + pushd "${ROOT}/terraform-e2e-ci" >/dev/null 2>&1 output="$(terraform output -json "en" | jq ". | .${1}" | tr -d \")" popd >/dev/null 2>&1 eval "export ${2}=${output}" diff --git a/scripts/terraform.sh b/scripts/ci-terraform.sh similarity index 96% rename from scripts/terraform.sh rename to scripts/ci-terraform.sh index dc32c8c80..ae8a5b9f4 100755 --- a/scripts/terraform.sh +++ b/scripts/ci-terraform.sh @@ -70,13 +70,13 @@ else fi function init() { - pushd "${ROOT}/terraform-e2e" > /dev/null + pushd "${ROOT}/terraform-e2e-ci" > /dev/null # Preparing for deployment echo "project = \"${PROJECT_ID}\"" > ./terraform.tfvars # Don't fail if it already exists gsutil mb -p ${PROJECT_ID} gs://${PROJECT_ID}-tf-state 2>/dev/null || true - cat < "${ROOT}/terraform-e2e/state.tf" + cat < "${ROOT}/terraform-e2e-ci/state.tf" terraform { backend "gcs" { bucket = "${PROJECT_ID}-tf-state" @@ -91,7 +91,7 @@ EOF } function deploy() { - pushd "${ROOT}/terraform-e2e" > /dev/null + pushd "${ROOT}/terraform-e2e-ci" > /dev/null init @@ -124,7 +124,7 @@ function deploy() { } function destroy() { - pushd "${ROOT}/terraform-e2e" > /dev/null + pushd "${ROOT}/terraform-e2e-ci" > /dev/null init diff --git a/terraform-e2e/README.md b/terraform-e2e-ci/README.md similarity index 95% rename from terraform-e2e/README.md rename to terraform-e2e-ci/README.md index 0e682c6fb..d9279a018 100644 --- a/terraform-e2e/README.md +++ b/terraform-e2e-ci/README.md @@ -1,4 +1,4 @@ -# terraform-e2e +# terraform-e2e-ci This directory contains terraform configuration to be used for deploying verification servers with terraform, while being able to reuse a project to deploy repeatedly. @@ -6,10 +6,10 @@ This directory contains terraform configuration to be used for deploying verific Terraform version > 1.13.1 -Follow steps from [Terrafrom instructions](https://github.com/google/exposure-notifications-verification-server/tree/main/terraform), going through from top until finishing `Instructions` section, then change into `terraform-e2e` directory: +Follow steps from [Terrafrom instructions](https://github.com/google/exposure-notifications-verification-server/tree/main/terraform), going through from top until finishing `Instructions` section, then change into `terraform-e2e-ci` directory: ```shell -cd terraform-e2e/ +cd terraform-e2e-ci/ echo "project = \"${PROJECT_ID}\"" >> ./terraform.tfvars ``` diff --git a/terraform-e2e/main.tf b/terraform-e2e-ci/main.tf similarity index 100% rename from terraform-e2e/main.tf rename to terraform-e2e-ci/main.tf