Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
Rename all e2e test scripts to make people not want to run them local…
Browse files Browse the repository at this point in the history
…ly (#884)
  • Loading branch information
chaodaiG authored Oct 22, 2020
1 parent 2bcebfe commit 883baa5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*.terraform/
*.tfvars
terraform/state.tf
terraform-e2e/state.tf
terraform-e2e-ci/state.tf
*/crash.log

# Local things
Expand Down
10 changes: 5 additions & 5 deletions scripts/e2e-test.sh → scripts/ci-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function smoke() {
export PROJECT_ID
fi

${ROOT}/scripts/terraform.sh smoke
${ROOT}/scripts/ci-terraform.sh smoke
}

function incremental() {
Expand All @@ -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
Expand Down Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions scripts/terraform.sh → scripts/ci-terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > "${ROOT}/terraform-e2e/state.tf"
cat <<EOF > "${ROOT}/terraform-e2e-ci/state.tf"
terraform {
backend "gcs" {
bucket = "${PROJECT_ID}-tf-state"
Expand All @@ -91,7 +91,7 @@ EOF
}

function deploy() {
pushd "${ROOT}/terraform-e2e" > /dev/null
pushd "${ROOT}/terraform-e2e-ci" > /dev/null

init

Expand Down Expand Up @@ -124,7 +124,7 @@ function deploy() {
}

function destroy() {
pushd "${ROOT}/terraform-e2e" > /dev/null
pushd "${ROOT}/terraform-e2e-ci" > /dev/null

init

Expand Down
6 changes: 3 additions & 3 deletions terraform-e2e/README.md → terraform-e2e-ci/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 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.

## Prerequisite

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
```

Expand Down
File renamed without changes.

0 comments on commit 883baa5

Please sign in to comment.