chore(e2e): Clean up enos variables (#6591)
* chore(e2e): No more required enos variables # Conflicts: # .github/workflows/enos-run.yml * CR
This commit is contained in:
1 parent
d4d40ecbb9
commit
843893c1c7
32 files changed
+546
-339
No files matched your search
@@ -337,7 +337,7 @@ variable "boundary_license" {
|
||||
description = "Boundary license (not needed for OSS, required for enterprise)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = null
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "controller_config_file_path" {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# Copyright IBM Corp. 2020, 2026
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
enos = {
|
||||
source = "registry.terraform.io/hashicorp-forge/enos"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
description = "the binary name"
|
||||
}
|
||||
|
||||
resource "enos_local_exec" "find_binary" {
|
||||
inline = ["type -P ${var.name} || (echo \"\n\nCould not find ${var.name} executable. Have you installed it?\n\n\" && exit 1)"]
|
||||
}
|
||||
|
||||
output "path" {
|
||||
value = enos_local_exec.find_binary.stdout
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright IBM Corp. 2020, 2026
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
variable "image_tag" {
|
||||
description = "the tag of the docker image (e.g. 1.2.3)"
|
||||
type = string
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
variable "edition" {
|
||||
description = "the edition of the docker image, either 'oss' or 'ent'"
|
||||
type = string
|
||||
default = "oss"
|
||||
validation {
|
||||
condition = contains(["oss", "ent"], var.edition)
|
||||
error_message = "edition must be either 'oss' or 'ent'."
|
||||
}
|
||||
}
|
||||
|
||||
variable "repository" {
|
||||
description = "the repository of the docker image."
|
||||
type = string
|
||||
default = "hashicorp/boundary"
|
||||
}
|
||||
|
||||
output "image_name" {
|
||||
value = "${var.repository}${var.edition == "ent" ? "-enterprise" : ""}:${var.image_tag}${var.edition == "ent" ? "-ent" : ""}"
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# Copyright IBM Corp. 2020, 2026
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
external = {
|
||||
source = "hashicorp/external"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
description = "the binary name"
|
||||
}
|
||||
|
||||
data "external" "find_binary" {
|
||||
program = ["bash", "-c", "printf '{\"path\":\"%s\"}' \"$(which ${var.name})\""]
|
||||
}
|
||||
|
||||
output "path" {
|
||||
value = dirname(abspath(data.external.find_binary.result.path))
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Copyright IBM Corp. 2020, 2026
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
external = {
|
||||
source = "hashicorp/external"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "external" "repo_root" {
|
||||
program = ["bash", "-c", "printf '{\"path\":\"%s\"}' \"$(git rev-parse --show-toplevel)\""]
|
||||
}
|
||||
|
||||
data "external" "make_edition" {
|
||||
program = ["bash", "-c", "edition=$(make -s -C '${data.external.repo_root.result.path}' edition | tr -d '\\r\\n') && printf '{\"edition\":\"%s\"}' \"$edition\""]
|
||||
}
|
||||
|
||||
output "edition" {
|
||||
value = data.external.make_edition.result.edition
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright IBM Corp. 2024, 2026
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
external = {
|
||||
source = "hashicorp/external"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data "external" "repo_root" {
|
||||
program = ["bash", "-c", "printf '{\"path\":\"%s\"}' \"$(git rev-parse --show-toplevel)\""]
|
||||
}
|
||||
|
||||
output "path" {
|
||||
value = abspath(data.external.repo_root.result.path)
|
||||
}
|
||||
@@ -2,16 +2,40 @@
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
|
||||
# Loads boundary license from file or environment variable
|
||||
# Loads license from file or environment variable
|
||||
# If license is null or not provided, then the license is returned from the file at license_path
|
||||
variable "license_path" {
|
||||
description = "Path to the boundary license file"
|
||||
description = "Path to a boundary license file"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
variable "license" {
|
||||
description = "Boundary license"
|
||||
description = "License key"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
output "license" {
|
||||
value = var.license != null ? var.license : file(var.license_path)
|
||||
variable "edition" {
|
||||
description = "Edition to determine if license is needed"
|
||||
type = string
|
||||
default = "oss"
|
||||
validation {
|
||||
condition = contains(["oss", "ent"], var.edition)
|
||||
error_message = "edition must be either 'oss' or 'ent'."
|
||||
}
|
||||
}
|
||||
|
||||
check "license_or_license_path_required" {
|
||||
assert {
|
||||
condition = (
|
||||
var.edition == "oss" ||
|
||||
var.license != null ||
|
||||
var.license_path != null
|
||||
)
|
||||
error_message = "license_path must be provided when license is not set for non-oss editions."
|
||||
}
|
||||
}
|
||||
|
||||
output "license" {
|
||||
value = var.edition == "ent" ? (var.license != null ? var.license : file(var.license_path)) : ""
|
||||
}
|
||||
@@ -9,8 +9,8 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
variable "debug_no_run" {
|
||||
description = "If set, this module will not execute the tests so that you can still access environment variables"
|
||||
variable "is_ci" {
|
||||
description = "Run tests automatically if in CI"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
@@ -45,6 +45,7 @@ variable "max_page_size" {
|
||||
variable "local_boundary_dir" {
|
||||
description = "Local Path to boundary executable"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
variable "target_user" {
|
||||
description = "SSH username for target"
|
||||
@@ -323,9 +324,9 @@ resource "enos_local_exec" "run_e2e_test" {
|
||||
E2E_CLIENT_SSH_KEY = var.client_ssh_key
|
||||
}
|
||||
|
||||
inline = var.debug_no_run ? [""] : [
|
||||
inline = var.is_ci ? [
|
||||
"set -o pipefail; PATH=\"${var.local_boundary_dir}:$PATH\" go test -v ${var.test_package} -count=1 -timeout ${var.test_timeout} | tee ${path.module}/../../test-e2e-${local.package_name}.log"
|
||||
]
|
||||
] : [""]
|
||||
}
|
||||
|
||||
output "test_results" {
|
||||
|
||||
@@ -14,6 +14,11 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
variable "is_ci" {
|
||||
description = "Run tests automatically if in CI"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
variable "network_name" {
|
||||
description = "Name of Docker Network"
|
||||
type = string
|
||||
@@ -23,11 +28,6 @@ variable "controller_container_name" {
|
||||
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
|
||||
default = false
|
||||
}
|
||||
variable "test_package" {
|
||||
description = "Name of Go test package to run"
|
||||
type = string
|
||||
@@ -55,10 +55,7 @@ variable "auth_password" {
|
||||
variable "local_boundary_dir" {
|
||||
description = "Local Path to boundary executable"
|
||||
type = string
|
||||
}
|
||||
variable "local_boundary_src_dir" {
|
||||
description = "Local Path to boundary src code directory"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
variable "target_user" {
|
||||
description = "SSH username for target"
|
||||
@@ -352,12 +349,9 @@ resource "enos_local_exec" "run_e2e_test" {
|
||||
E2E_GCP_HOST_SET_IPS = jsonencode(var.gcp_host_set_ips)
|
||||
E2E_MAX_PAGE_SIZE = var.max_page_size
|
||||
E2E_CONTROLLER_CONTAINER_NAME = var.controller_container_name
|
||||
BOUNDARY_DIR = abspath(var.local_boundary_src_dir)
|
||||
BOUNDARY_CLI_DIR = abspath(var.local_boundary_dir)
|
||||
MODULE_DIR = abspath(path.module)
|
||||
}
|
||||
|
||||
inline = var.debug_no_run ? [""] : [
|
||||
inline = var.is_ci ? [
|
||||
"set -o pipefail; PATH=\"${var.local_boundary_dir}:$PATH\" go test -v ${var.test_package} -count=1 -timeout ${var.test_timeout} | tee ${path.module}/../../test-e2e-${local.package_name}.log"
|
||||
]
|
||||
] : [""]
|
||||
}
|
||||
@@ -9,11 +9,6 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
variable "debug_no_run" {
|
||||
description = "If set, this module will not execute the tests so that you can still access environment variables"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
variable "alb_boundary_api_addr" {
|
||||
description = "URL of the Boundary instance"
|
||||
type = string
|
||||
@@ -34,15 +29,6 @@ variable "auth_password" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
variable "local_boundary_dir" {
|
||||
description = "Local Path to boundary executable"
|
||||
type = string
|
||||
}
|
||||
variable "local_boundary_ui_src_dir" {
|
||||
description = "Local Path to boundary-ui directory"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "aws_ssh_private_key_path" {
|
||||
description = "Local Path to key used to SSH onto created hosts"
|
||||
type = string
|
||||
@@ -250,7 +236,7 @@ resource "enos_local_exec" "run_e2e_test" {
|
||||
E2E_ALB_CERT = var.alb_cert
|
||||
}
|
||||
|
||||
inline = var.debug_no_run ? [""] : ["set -o pipefail; PATH=\"${var.local_boundary_dir}:$PATH\" pnpm --cwd ${var.local_boundary_ui_src_dir}/ui/admin run e2e 2>&1 | tee ${path.module}/../../test-e2e-ui.log"]
|
||||
inline = [""]
|
||||
}
|
||||
|
||||
output "test_results" {
|
||||
|
||||
Reference in new issue
Block a user