From 0ad2bb65dc656ed64d26054672c74a91ec708d53 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 1 Apr 2026 15:13:43 -0400 Subject: [PATCH] chore(e2e): Remove go version variable (#6524) --- .github/workflows/build.yml | 1 - .github/workflows/enos-run.yml | 22 +++++++++++++----- .../enos-scenario-e2e-docker-base-connect.hcl | 2 -- enos/enos-scenario-e2e-docker-base-plus.hcl | 2 -- ...enos-scenario-e2e-docker-base-with-gcp.hcl | 2 -- ...os-scenario-e2e-docker-base-with-vault.hcl | 2 -- ...io-e2e-docker-base-with-worker-version.hcl | 2 -- ...s-scenario-e2e-docker-base-with-worker.hcl | 2 -- enos/enos-scenario-e2e-docker-base.hcl | 2 -- ...ker-worker-registration-controller-led.hcl | 2 -- ...-docker-worker-registration-worker-led.hcl | 2 -- enos/enos-variables.hcl | 8 +------ enos/modules/test_e2e_docker/main.tf | 23 ------------------- 13 files changed, 17 insertions(+), 55 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81d6ed1fa5..a44e6e027b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -410,7 +410,6 @@ jobs: uses: ./.github/workflows/enos-run.yml with: artifact-name: "boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip" - go-version: ${{ needs.product-metadata.outputs.go-version }} edition: ${{ needs.product-metadata.outputs.product-edition }} docker-image-file: "boundary_default_linux_amd64_${{ needs.set-product-version.outputs.product-version }}_${{ github.sha }}.docker.dev.tar" secrets: inherit diff --git a/.github/workflows/enos-run.yml b/.github/workflows/enos-run.yml index 7f54ae6aa3..c046a631da 100644 --- a/.github/workflows/enos-run.yml +++ b/.github/workflows/enos-run.yml @@ -12,9 +12,6 @@ on: edition: required: true type: string - go-version: - required: true - type: string docker-image-file: required: false type: string @@ -29,10 +26,17 @@ jobs: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: '0' + - name: Determine Go version + id: get-go-version + # We use .go-version as our source of truth for current Go + # version, because "goenv" can react to it automatically. + run: | + echo "Building with Go $(cat .go-version)" + echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version: ${{ inputs.go-version }} + go-version: "${{ steps.get-go-version.outputs.go-version }}" cache: false - name: Determine Go cache paths id: go-cache-paths @@ -89,7 +93,6 @@ jobs: ENOS_VAR_test_email: ${{ secrets.SERVICE_USER_EMAIL }} ENOS_VAR_boundary_edition: ${{ inputs.edition }} ENOS_VAR_boundary_docker_image_file: ./support/boundary_docker_image.tar - ENOS_VAR_go_version: ${{ inputs.go-version }} ENOS_VAR_gcp_project_id: ${{ secrets.GCP_PROJECT_ID_CI }} ENOS_VAR_gcp_client_email: ${{ secrets.GCP_CLIENT_EMAIL_CI }} ENOS_VAR_gcp_private_key_id: ${{ secrets.GCP_PRIVATE_KEY_ID_CI }} @@ -97,10 +100,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Determine Go version + id: get-go-version + # We use .go-version as our source of truth for current Go + # version, because "goenv" can react to it automatically. + run: | + echo "Building with Go $(cat .go-version)" + echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT" - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: - go-version: ${{ inputs.go-version }} + go-version: "${{ steps.get-go-version.outputs.go-version }}" cache: false - name: Set up Go modules cache id: go-mod-cache diff --git a/enos/enos-scenario-e2e-docker-base-connect.hcl b/enos/enos-scenario-e2e-docker-base-connect.hcl index d32681161e..38c97aa730 100644 --- a/enos/enos-scenario-e2e-docker-base-connect.hcl +++ b/enos/enos-scenario-e2e-docker-base-connect.hcl @@ -106,9 +106,7 @@ scenario "e2e_docker_base_connect" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_connect" - docker_mirror = var.docker_mirror network_name = step.create_docker_network.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base-plus.hcl b/enos/enos-scenario-e2e-docker-base-plus.hcl index 5103a49c9b..ec4e870a32 100644 --- a/enos/enos-scenario-e2e-docker-base-plus.hcl +++ b/enos/enos-scenario-e2e-docker-base-plus.hcl @@ -119,10 +119,8 @@ scenario "e2e_docker_base_plus" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_plus" - docker_mirror = var.docker_mirror controller_container_name = step.create_boundary.container_name network_name = step.create_docker_network.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base-with-gcp.hcl b/enos/enos-scenario-e2e-docker-base-with-gcp.hcl index 7bde35d6d3..daec5b1e47 100644 --- a/enos/enos-scenario-e2e-docker-base-with-gcp.hcl +++ b/enos/enos-scenario-e2e-docker-base-with-gcp.hcl @@ -113,9 +113,7 @@ scenario "e2e_docker_base_with_gcp" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/gcp" - docker_mirror = var.docker_mirror network_name = step.create_docker_network.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base-with-vault.hcl b/enos/enos-scenario-e2e-docker-base-with-vault.hcl index fe6d61133e..25a4960537 100644 --- a/enos/enos-scenario-e2e-docker-base-with-vault.hcl +++ b/enos/enos-scenario-e2e-docker-base-with-vault.hcl @@ -129,9 +129,7 @@ scenario "e2e_docker_base_with_vault" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_with_vault" - docker_mirror = var.docker_mirror network_name = step.create_docker_network.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base-with-worker-version.hcl b/enos/enos-scenario-e2e-docker-base-with-worker-version.hcl index 2d02ebb1da..faaaba7cc0 100644 --- a/enos/enos-scenario-e2e-docker-base-with-worker-version.hcl +++ b/enos/enos-scenario-e2e-docker-base-with-worker-version.hcl @@ -165,9 +165,7 @@ scenario "e2e_docker_base_with_worker_version" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_with_worker" - docker_mirror = var.docker_mirror network_name = step.create_docker_network_cluster.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base-with-worker.hcl b/enos/enos-scenario-e2e-docker-base-with-worker.hcl index 00c66e38ec..94f0fc0773 100644 --- a/enos/enos-scenario-e2e-docker-base-with-worker.hcl +++ b/enos/enos-scenario-e2e-docker-base-with-worker.hcl @@ -160,9 +160,7 @@ scenario "e2e_docker_base_with_worker" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_with_worker" - docker_mirror = var.docker_mirror network_name = step.create_docker_network_cluster.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-base.hcl b/enos/enos-scenario-e2e-docker-base.hcl index f4d369da53..fdd1b1ace3 100644 --- a/enos/enos-scenario-e2e-docker-base.hcl +++ b/enos/enos-scenario-e2e-docker-base.hcl @@ -106,9 +106,7 @@ scenario "e2e_docker_base" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base" - docker_mirror = var.docker_mirror network_name = step.create_docker_network.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-worker-registration-controller-led.hcl b/enos/enos-scenario-e2e-docker-worker-registration-controller-led.hcl index ce1050e63b..9943731aff 100644 --- a/enos/enos-scenario-e2e-docker-worker-registration-controller-led.hcl +++ b/enos/enos-scenario-e2e-docker-worker-registration-controller-led.hcl @@ -175,9 +175,7 @@ scenario "e2e_docker_worker_registration_controller_led" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_with_worker" - docker_mirror = var.docker_mirror network_name = step.create_docker_network_cluster.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-scenario-e2e-docker-worker-registration-worker-led.hcl b/enos/enos-scenario-e2e-docker-worker-registration-worker-led.hcl index 86bd4b1a31..454cae5369 100644 --- a/enos/enos-scenario-e2e-docker-worker-registration-worker-led.hcl +++ b/enos/enos-scenario-e2e-docker-worker-registration-worker-led.hcl @@ -190,9 +190,7 @@ scenario "e2e_docker_worker_registration_worker_led" { ] variables { test_package = "github.com/hashicorp/boundary/testing/internal/e2e/tests/base_with_worker" - docker_mirror = var.docker_mirror network_name = step.create_docker_network_cluster.network_name - go_version = var.go_version debug_no_run = var.e2e_debug_no_run alb_boundary_api_addr = step.create_boundary.address auth_method_id = step.create_boundary.auth_method_id diff --git a/enos/enos-variables.hcl b/enos/enos-variables.hcl index 7409be1a33..8e81ac7f61 100644 --- a/enos/enos-variables.hcl +++ b/enos/enos-variables.hcl @@ -199,12 +199,6 @@ variable "aws_region" { default = "us-east-1" } -variable "go_version" { - description = "Version of Golang used by the application under test" - type = string - default = "" -} - variable "hcp_boundary_cluster_id" { description = "ID of the Boundary cluster in HCP" type = string @@ -288,4 +282,4 @@ variable "worker_version" { description = "Manually set worker version to test different worker/controller version combinations" type = string default = null -} \ No newline at end of file +} diff --git a/enos/modules/test_e2e_docker/main.tf b/enos/modules/test_e2e_docker/main.tf index cf21a926b2..06d31bf764 100644 --- a/enos/modules/test_e2e_docker/main.tf +++ b/enos/modules/test_e2e_docker/main.tf @@ -14,10 +14,6 @@ terraform { } } -variable "docker_mirror" { - description = "URL to the docker repository" - type = string -} variable "network_name" { description = "Name of Docker Network" type = string @@ -27,11 +23,6 @@ variable "controller_container_name" { type = string default = "" } -variable "go_version" { - description = "Version of Golang used by the application under test" - type = string - default = "" -} variable "debug_no_run" { description = "If set, this module will not execute the tests so that you can still access environment variables" type = bool @@ -301,29 +292,15 @@ variable "gcp_host_set_ips" { default = [""] } -resource "enos_local_exec" "get_go_version" { - count = var.go_version == "" ? 1 : 0 - inline = ["cat $(echo $(git rev-parse --show-toplevel))/.go-version | xargs"] -} - locals { - go_version = var.go_version == "" ? enos_local_exec.get_go_version[0].stdout : var.go_version - image_name = trimspace("${var.docker_mirror}/library/golang:${local.go_version}") aws_ssh_private_key_path = abspath(var.aws_ssh_private_key_path) package_name = reverse(split("/", var.test_package))[0] } -resource "docker_image" "go" { - name = local.image_name - keep_locally = true -} - resource "enos_local_exec" "run_e2e_test" { - depends_on = [docker_image.go] environment = { TEST_PACKAGE = var.test_package TEST_TIMEOUT = var.test_timeout - TEST_RUNNER_IMAGE = docker_image.go.image_id TEST_NETWORK_NAME = var.network_name E2E_TESTS = "true" BOUNDARY_ADDR = var.alb_boundary_api_addr