From bdf629a39b19a3137c5d708643ac639ef0dfd0ff Mon Sep 17 00:00:00 2001 From: Sandra Maria Peter <83961684+sandrampeter@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:27:57 -0400 Subject: [PATCH 1/2] more changes required for standalone test --- .github/workflows/handler-pr-close.yml | 8 +- .github/workflows/handler-test.yml | 461 +++++++++++++++++- tests/private-tcp-active-active/run-tests.sh | 11 +- .../standalone-external-rhel8-worker/main.tf | 2 +- .../variables.tf | 1 + tests/standalone-mounted-disk/main.tf | 2 +- 6 files changed, 477 insertions(+), 8 deletions(-) diff --git a/.github/workflows/handler-pr-close.yml b/.github/workflows/handler-pr-close.yml index bad415f9..ad176a82 100644 --- a/.github/workflows/handler-pr-close.yml +++ b/.github/workflows/handler-pr-close.yml @@ -131,14 +131,14 @@ jobs: # this step will delete workspace-resources if exists for this PR - name: Terraform Destroy id: destroy-paa - if: steps.get-workspaces-google-private-active-active.outputs.WORSPACE_PRI_AA_EXISTS != null + if: ${{ steps.get-workspaces-google-private-active-active.outputs.WORSPACE_PRI_AA_EXISTS }} working-directory: ${{ env.WORK_DIR_PATH }} run: terraform destroy -auto-approve -input=false -no-color # this step will delete workspace for this PR - name: Terraform Delete Workspace id: destroy-workspace-paa - if: steps.get-workspaces-google-private-active-active.outputs.WORSPACE_PRI_AA_EXISTS != null && steps.destroy.outcome == 'success' + if: ${{ steps.get-workspaces-google-private-active-active.outputs.WORSPACE_PRI_AA_EXISTS && steps.destroy.outcome == 'success' }} working-directory: ${{ env.WORK_DIR_PATH }} env: TFE_ORGANIZATION: ${{ secrets.TFE_ORGANIZATION }} @@ -159,14 +159,14 @@ jobs: # this step will delete workspace-resources if exists for this PR - name: Terraform Destroy id: destroy-pub-aa - if: ${{ steps.get-workspaces-google-public-active-active.outputs.WORSPACE_PUB_AA_EXISTS != null }} + if: ${{ steps.get-workspaces-google-public-active-active.outputs.WORSPACE_PUB_AA_EXISTS }} working-directory: ${{ env.WORK_DIR_PATH }} run: terraform destroy -auto-approve -input=false -no-color # this step will delete workspace for this PR - name: Terraform Delete Workspace id: destroy-workspace-pub-aa - if: ${{ steps.get-workspaces-google-public-active-active.outputs.WORSPACE_PUB_AA_EXISTS != null && steps.destroy.outcome == 'success' }} + if: ${{ steps.get-workspaces-google-public-active-active.outputs.WORSPACE_PUB_AA_EXISTS && steps.destroy.outcome == 'success' }} working-directory: ${{ env.WORK_DIR_PATH }} env: TFE_ORGANIZATION: ${{ secrets.TFE_ORGANIZATION }} diff --git a/.github/workflows/handler-test.yml b/.github/workflows/handler-test.yml index 38cb9439..a41f25f5 100644 --- a/.github/workflows/handler-test.yml +++ b/.github/workflows/handler-test.yml @@ -760,4 +760,463 @@ jobs: ${{ format('- {0} Run k6 Smoke Test', steps.run-smoke-test.outcome == 'success' && ':white_check_mark:' || ':x:') }} - ${{ github.event.client_payload.slash_command.args.named.destroy != 'false' && format('- {0} Terraform Destroy', steps.destroy.outcome == 'success' && ':white_check_mark:' || ':x:') || '' }} \ No newline at end of file + ${{ github.event.client_payload.slash_command.args.named.destroy != 'false' && format('- {0} Terraform Destroy', steps.destroy.outcome == 'success' && ':white_check_mark:' || ':x:') || '' } + + standalone_external_rhel8_worker: + name: Run tf-test on Standalone External Rhel8 Worker + if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-external-rhel8-worker') }} + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + env: + WORK_DIR_PATH: ./tests/standalone-external-rhel8-worker + K6_WORK_DIR_PATH: ./tests/tfe-load-test + steps: + - name: Create URL to the run output + id: vars + run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID + + - name: Checkout Pull Request Branch + uses: actions/checkout@v2 + with: + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + persist-credentials: false + + - name: Set Terraform Module Source + working-directory: ${{ env.WORK_DIR_PATH }} + env: + LOGIN: ${{ github.event.client_payload.pull_request.head.repo.owner.login }} + NAME: ${{ github.event.client_payload.pull_request.head.repo.name }} + SHA: ${{ github.event.client_payload.pull_request.head.sha }} + run: | + sed --in-place "s/source = \"..\/..\"/source = \"github.com\/$LOGIN\/$NAME?ref=$SHA\"/" main.tf + sed --in-place "s/source = \"..\/..\/fixtures\/test_proxy\"/source = \"github.com\/$LOGIN\/$NAME\/\/fixtures\/test_proxy?ref=$SHA\"/" main.tf + + - name: Checkout TFE Load Test + uses: actions/checkout@v2 + with: + path: ${{ env.K6_WORK_DIR_PATH }} + repository: hashicorp/tfe-load-test + token: ${{ secrets.GH_TFE_LOAD_TEST_TOKEN }} + persist-credentials: false + + - name: Install required tools + working-directory: ${{ env.K6_WORK_DIR_PATH }} + env: + K6_URL: https://github.com/loadimpact/k6/releases/download/v0.31.1/k6-v0.31.1-linux64.tar.gz + run: | + sudo apt-get install jq + curl -L $K6_URL | tar -xz --strip-components=1 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v1 + with: + cli_config_credentials_hostname: 'app.terraform.io' + cli_config_credentials_token: ${{ secrets.TFC_TOKEN }} + terraform_version: 1.0.11 + terraform_wrapper: true + + - name: Configure Terraform Backend + id: backend-config + working-directory: ${{ env.WORK_DIR_PATH }} + env: + TFC_ORGANIZATION: ${{ secrets.TFC_ORGANIZATION }} + run: | + cat < backend-config.hcl + organization = "$TFC_ORGANIZATION" + workspaces { + name = "google-standalone-external-rhel8-worker-${{ github.event.client_payload.github.payload.issue.number }}" + } + EOF + + - name: Terraform Init + id: init + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform init -backend-config=backend-config.hcl -input=false -no-color + + - name: Write Terraform Variables + working-directory: ${{ env.WORK_DIR_PATH }} + env: + GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} + GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} + GOOGLE_REGION: ${{ secrets.GOOGLE_REGION }} + GOOGLE_ZONE: ${{ secrets.GOOGLE_ZONE }} + GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} + TFE_HOSTNAME: ${{ secrets.TFE_HOSTNAME }} + TFE_ORGANIZATION: ${{ secrets.TFE_ORGANIZATION }} + TFE_TOKEN: ${{ secrets.TFE_TOKEN }} + TFE_WORKSPACE: ${{ secrets.TFE_WORKSPACE }} + run: | + ip_address=$( dig +short @resolver1.opendns.com myip.opendns.com ) + cat < github.auto.tfvars + iact_subnet_list = ["$ip_address/32"] + google = { + credentials = <<-EOC + $GOOGLE_CREDENTIALS + EOC + project = "$GOOGLE_PROJECT" + region = "$GOOGLE_REGION" + zone = "$GOOGLE_ZONE" + service_account = "$GOOGLE_SERVICE_ACCOUNT" + } + tfe = { + hostname = "$TFE_HOSTNAME" + organization = "$TFE_ORGANIZATION" + token = "$TFE_TOKEN" + workspace = "$TFE_WORKSPACE" + } + EOF + + - name: Terraform Validate + id: validate + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform validate -no-color + + - name: Terraform Apply + id: apply + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform apply -auto-approve -input=false -no-color + + - name: Retrieve Health Check URL + id: retrieve-health-check-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw health_check_url + + - name: Wait For TFE + id: wait-for-tfe + timeout-minutes: 25 + env: + HEALTH_CHECK_URL: ${{ steps.retrieve-health-check-url.outputs.stdout }} + run: | + echo "Curling \`health_check_url\` for a return status of 200..." + while ! curl -sfS --max-time 5 "$HEALTH_CHECK_URL"; do sleep 5; done + + - name: Retrieve TFE URL + id: retrieve-tfe-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw tfe_url + + - name: Retrieve IACT URL + id: retrieve-iact-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw iact_url + + - name: Retrieve IACT + id: retrieve-iact + env: + IACT_URL: ${{ steps.retrieve-iact-url.outputs.stdout }} + run: | + token=$(curl --fail --retry 5 --verbose "$IACT_URL") + echo "::set-output name=token::$token" + + - name: Retrieve Initial Admin User URL + id: retrieve-initial-admin-user-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw initial_admin_user_url + + - name: Create Admin in TFE + id: create-admin + env: + TFE_PASSWORD: ${{ secrets.TFE_PASSWORD }} + IAU_URL: ${{ steps.retrieve-initial-admin-user-url.outputs.stdout }} + IACT: ${{ steps.retrieve-iact.outputs.token }} + run: | + echo \ + '{"username": "test", "email": "tf-onprem-team@hashicorp.com", "password": "$TFE_PASSWORD"}' \ + > ./payload.json + response=$( \ + curl \ + --fail \ + --retry 5 \ + --verbose \ + --header 'Content-Type: application/json' \ + --data @./payload.json \ + "$IAU_URL"?token="$IACT") + echo "::set-output name=response::$response" + + - name: Retrieve Admin Token + id: retrieve-admin-token + env: + RESPONSE: ${{ steps.create-admin.outputs.response }} + run: | + token=$(echo "$RESPONSE" | jq --raw-output '.token') + echo "::set-output name=token::$token" + + - name: Run k6 Smoke Test + id: run-smoke-test + working-directory: ${{ env.K6_WORK_DIR_PATH }} + env: + K6_PATHNAME: "./k6" + TFE_URL: "${{ steps.retrieve-tfe-url.outputs.stdout }}" + TFE_API_TOKEN: "${{ steps.retrieve-admin-token.outputs.token }}" + TFE_EMAIL: tf-onprem-team@hashicorp.com + run: | + make smoke-test + + - name: Terraform Destroy + id: destroy + if: ${{ always() && github.event.client_payload.slash_command.args.named.destroy != 'false' }} + working-directory: ${{ env.WORK_DIR_PATH }} + env: + TFE_HOSTNAME: ${{ secrets.TFE_HOSTNAME }} + TFE_TOKEN: ${{ secrets.TFE_TOKEN }} + run: terraform destroy -auto-approve -input=false -no-color + + - name: Update comment + if: ${{ always() }} + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + body: | + ${{ format('### {0} Terraform Standalone External Rhel8 Worker Test Report', job.status == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format(':link: [Action Summary Page]({0})', steps.vars.outputs.run-url) }} + + ${{ format('- {0} Terraform Init', steps.init.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Terraform Validate', steps.validate.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Terraform Apply', steps.apply.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Run k6 Smoke Test', steps.run-smoke-test.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ github.event.client_payload.slash_command.args.named.destroy != 'false' && format('- {0} Terraform Destroy', steps.destroy.outcome == 'success' && ':white_check_mark:' || ':x:') || '' }} + + standalone_mounted_disk: + name: Run tf-test on Standalone Mounted Disk + if: ${{ contains(github.event.client_payload.slash_command.args.unnamed.all, 'all') || contains(github.event.client_payload.slash_command.args.unnamed.all, 'standalone-mounted-disk') }} + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + env: + WORK_DIR_PATH: ./tests/standalone-mounted-disk + K6_WORK_DIR_PATH: ./tests/tfe-load-test + steps: + - name: Create URL to the run output + id: vars + run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID + + - name: Checkout Pull Request Branch + uses: actions/checkout@v2 + with: + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.sha }} + token: ${{ secrets.GITHUB_TOKEN }} + persist-credentials: false + + - name: Set Terraform Module Source + working-directory: ${{ env.WORK_DIR_PATH }} + env: + LOGIN: ${{ github.event.client_payload.pull_request.head.repo.owner.login }} + NAME: ${{ github.event.client_payload.pull_request.head.repo.name }} + SHA: ${{ github.event.client_payload.pull_request.head.sha }} + run: | + sed --in-place "s/source = \"..\/..\"/source = \"github.com\/$LOGIN\/$NAME?ref=$SHA\"/" main.tf + sed --in-place "s/source = \"..\/..\/fixtures\/test_proxy\"/source = \"github.com\/$LOGIN\/$NAME\/\/fixtures\/test_proxy?ref=$SHA\"/" main.tf + + - name: Checkout TFE Load Test + uses: actions/checkout@v2 + with: + path: ${{ env.K6_WORK_DIR_PATH }} + repository: hashicorp/tfe-load-test + token: ${{ secrets.GH_TFE_LOAD_TEST_TOKEN }} + persist-credentials: false + + - name: Install required tools + working-directory: ${{ env.K6_WORK_DIR_PATH }} + env: + K6_URL: https://github.com/loadimpact/k6/releases/download/v0.31.1/k6-v0.31.1-linux64.tar.gz + run: | + sudo apt-get install jq + curl -L $K6_URL | tar -xz --strip-components=1 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v1 + with: + cli_config_credentials_hostname: 'app.terraform.io' + cli_config_credentials_token: ${{ secrets.TFC_TOKEN }} + terraform_version: 1.0.11 + terraform_wrapper: true + + - name: Configure Terraform Backend + id: backend-config + working-directory: ${{ env.WORK_DIR_PATH }} + env: + TFC_ORGANIZATION: ${{ secrets.TFC_ORGANIZATION }} + run: | + cat < backend-config.hcl + organization = "$TFC_ORGANIZATION" + workspaces { + name = "google-standalone-mounted-disk-${{ github.event.client_payload.github.payload.issue.number }}" + } + EOF + + - name: Terraform Init + id: init + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform init -backend-config=backend-config.hcl -input=false -no-color + + - name: Write Terraform Variables + working-directory: ${{ env.WORK_DIR_PATH }} + env: + GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} + GOOGLE_PROJECT: ${{ secrets.GOOGLE_PROJECT }} + GOOGLE_REGION: ${{ secrets.GOOGLE_REGION }} + GOOGLE_ZONE: ${{ secrets.GOOGLE_ZONE }} + GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} + TFE_HOSTNAME: ${{ secrets.TFE_HOSTNAME }} + TFE_ORGANIZATION: ${{ secrets.TFE_ORGANIZATION }} + TFE_TOKEN: ${{ secrets.TFE_TOKEN }} + TFE_WORKSPACE: ${{ secrets.TFE_WORKSPACE }} + run: | + ip_address=$( dig +short @resolver1.opendns.com myip.opendns.com ) + cat < github.auto.tfvars + iact_subnet_list = ["$ip_address/32"] + google = { + credentials = <<-EOC + $GOOGLE_CREDENTIALS + EOC + project = "$GOOGLE_PROJECT" + region = "$GOOGLE_REGION" + zone = "$GOOGLE_ZONE" + service_account = "$GOOGLE_SERVICE_ACCOUNT" + } + tfe = { + hostname = "$TFE_HOSTNAME" + organization = "$TFE_ORGANIZATION" + token = "$TFE_TOKEN" + workspace = "$TFE_WORKSPACE" + } + EOF + + - name: Terraform Validate + id: validate + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform validate -no-color + + - name: Terraform Apply + id: apply + working-directory: ${{ env.WORK_DIR_PATH }} + run: terraform apply -auto-approve -input=false -no-color + + - name: Retrieve Health Check URL + id: retrieve-health-check-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw health_check_url + + - name: Wait For TFE + id: wait-for-tfe + timeout-minutes: 25 + env: + HEALTH_CHECK_URL: ${{ steps.retrieve-health-check-url.outputs.stdout }} + run: | + echo "Curling \`health_check_url\` for a return status of 200..." + while ! curl -sfS --max-time 5 "$HEALTH_CHECK_URL"; do sleep 5; done + + - name: Retrieve TFE URL + id: retrieve-tfe-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw tfe_url + + - name: Retrieve IACT URL + id: retrieve-iact-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw iact_url + + - name: Retrieve IACT + id: retrieve-iact + env: + IACT_URL: ${{ steps.retrieve-iact-url.outputs.stdout }} + run: | + token=$(curl --fail --retry 5 --verbose "$IACT_URL") + echo "::set-output name=token::$token" + + - name: Retrieve Initial Admin User URL + id: retrieve-initial-admin-user-url + working-directory: ${{ env.WORK_DIR_PATH }} + run: | + terraform output -no-color -raw initial_admin_user_url + + - name: Create Admin in TFE + id: create-admin + env: + TFE_PASSWORD: ${{ secrets.TFE_PASSWORD }} + IAU_URL: ${{ steps.retrieve-initial-admin-user-url.outputs.stdout }} + IACT: ${{ steps.retrieve-iact.outputs.token }} + run: | + echo \ + '{"username": "test", "email": "tf-onprem-team@hashicorp.com", "password": "$TFE_PASSWORD"}' \ + > ./payload.json + response=$( \ + curl \ + --fail \ + --retry 5 \ + --verbose \ + --header 'Content-Type: application/json' \ + --data @./payload.json \ + "$IAU_URL"?token="$IACT") + echo "::set-output name=response::$response" + + - name: Retrieve Admin Token + id: retrieve-admin-token + env: + RESPONSE: ${{ steps.create-admin.outputs.response }} + run: | + token=$(echo "$RESPONSE" | jq --raw-output '.token') + echo "::set-output name=token::$token" + + - name: Run k6 Smoke Test + id: run-smoke-test + working-directory: ${{ env.K6_WORK_DIR_PATH }} + env: + K6_PATHNAME: "./k6" + TFE_URL: "${{ steps.retrieve-tfe-url.outputs.stdout }}" + TFE_API_TOKEN: "${{ steps.retrieve-admin-token.outputs.token }}" + TFE_EMAIL: tf-onprem-team@hashicorp.com + run: | + make smoke-test + + - name: Terraform Destroy + id: destroy + if: ${{ always() && github.event.client_payload.slash_command.args.named.destroy != 'false' }} + working-directory: ${{ env.WORK_DIR_PATH }} + env: + TFE_HOSTNAME: ${{ secrets.TFE_HOSTNAME }} + TFE_TOKEN: ${{ secrets.TFE_TOKEN }} + run: terraform destroy -auto-approve -input=false -no-color + + - name: Update comment + if: ${{ always() }} + uses: peter-evans/create-or-update-comment@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + body: | + ${{ format('### {0} Terraform Standalone Mounted Disk Test Report', job.status == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format(':link: [Action Summary Page]({0})', steps.vars.outputs.run-url) }} + + ${{ format('- {0} Terraform Init', steps.init.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Terraform Validate', steps.validate.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Terraform Apply', steps.apply.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ format('- {0} Run k6 Smoke Test', steps.run-smoke-test.outcome == 'success' && ':white_check_mark:' || ':x:') }} + + ${{ github.event.client_payload.slash_command.args.named.destroy != 'false' && format('- {0} Terraform Destroy', steps.destroy.outcome == 'success' && ':white_check_mark:' || ':x:') || '' }} + diff --git a/tests/private-tcp-active-active/run-tests.sh b/tests/private-tcp-active-active/run-tests.sh index 303b659e..c4f46315 100644 --- a/tests/private-tcp-active-active/run-tests.sh +++ b/tests/private-tcp-active-active/run-tests.sh @@ -73,7 +73,16 @@ INSTANCE_NAME=`terraform output -no-color -raw proxy_instance_name` #Retrieve Instance Zone INSTANCE_ZONE=`terraform output -no-color -raw proxy_instance_zone` #Initiate SSH tunnel to proxy server -gcloud compute ssh --quiet --ssh-key-expire-after="1440m" --tunnel-through-iap --zone="$INSTANCE_ZONE" "$INSTANCE_NAME" -- -f -N -p 22 -D localhost:5000 +gcloud compute ssh \ + --quiet \ + --ssh-key-expire-after="1440m" \ + --tunnel-through-iap \ + --zone="$INSTANCE_ZONE" \ + "$INSTANCE_NAME" \ + -- \ + -o 'ServerAliveInterval 5' \ + -o 'ServerAliveCountMax 3' \ + -f -N -p 22 -D localhost:5000 if [[ -z "$skip_init" ]]; then while ! curl \ diff --git a/tests/standalone-external-rhel8-worker/main.tf b/tests/standalone-external-rhel8-worker/main.tf index f297b68f..151e0462 100644 --- a/tests/standalone-external-rhel8-worker/main.tf +++ b/tests/standalone-external-rhel8-worker/main.tf @@ -7,7 +7,7 @@ resource "random_pet" "main" { # Store TFE License as secret # --------------------------- module "secrets" { - count = length(var.license_file) > 0 ? 1 : 0 + count = var.license_file == null ? 0 : 1 source = "../../fixtures/secrets" license = { diff --git a/tests/standalone-external-rhel8-worker/variables.tf b/tests/standalone-external-rhel8-worker/variables.tf index 274fcaf6..8e53c893 100644 --- a/tests/standalone-external-rhel8-worker/variables.tf +++ b/tests/standalone-external-rhel8-worker/variables.tf @@ -1,4 +1,5 @@ variable "existing_service_account_id" { + default = null type = string description = "The id of the logging service account to use for compute resources deployed." } diff --git a/tests/standalone-mounted-disk/main.tf b/tests/standalone-mounted-disk/main.tf index 6e4d147a..5035b36f 100644 --- a/tests/standalone-mounted-disk/main.tf +++ b/tests/standalone-mounted-disk/main.tf @@ -7,7 +7,7 @@ resource "random_pet" "main" { # Store TFE License as secret # --------------------------- module "secrets" { - count = length(var.license_file) > 0 ? 1 : 0 + count = var.license_file == null ? 0 : 1 source = "../../fixtures/secrets" license = { From e1189364e9414fb61f0a9162cc3b6952dab50ec6 Mon Sep 17 00:00:00 2001 From: Sandra Maria Peter <83961684+sandrampeter@users.noreply.github.com> Date: Wed, 6 Jul 2022 12:28:27 -0400 Subject: [PATCH 2/2] fmt fix --- tests/standalone-external-rhel8-worker/main.tf | 2 +- tests/standalone-mounted-disk/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/standalone-external-rhel8-worker/main.tf b/tests/standalone-external-rhel8-worker/main.tf index 151e0462..2a50bc51 100644 --- a/tests/standalone-external-rhel8-worker/main.tf +++ b/tests/standalone-external-rhel8-worker/main.tf @@ -7,7 +7,7 @@ resource "random_pet" "main" { # Store TFE License as secret # --------------------------- module "secrets" { - count = var.license_file == null ? 0 : 1 + count = var.license_file == null ? 0 : 1 source = "../../fixtures/secrets" license = { diff --git a/tests/standalone-mounted-disk/main.tf b/tests/standalone-mounted-disk/main.tf index 5035b36f..53da5fe5 100644 --- a/tests/standalone-mounted-disk/main.tf +++ b/tests/standalone-mounted-disk/main.tf @@ -7,7 +7,7 @@ resource "random_pet" "main" { # Store TFE License as secret # --------------------------- module "secrets" { - count = var.license_file == null ? 0 : 1 + count = var.license_file == null ? 0 : 1 source = "../../fixtures/secrets" license = {