test(e2e): Add docker-based infra scenario for Admin UI tests (#4166)

* chore(e2e): Add docker-based scenario for Admin UI tests

* test(e2e): Trim space in worker_led_token output
This commit is contained in:
Michael Li authored and GitHub committed 2023-12-22 10:10:29 -05:00
1 parent 0adfe2d5a3
commit ec8902ec68
6 files changed
+259 -78

No files matched your search

+56 -24
View File
@@ -42,13 +42,14 @@ variable "local_boundary_ui_src_dir" {
description = "Local Path to boundary-ui directory"
type = string
}
variable "target_user" {
description = "SSH username for target"
variable "aws_ssh_private_key_path" {
description = "Local Path to key used to SSH onto created hosts"
type = string
default = ""
}
variable "aws_ssh_private_key_path" {
description = "Local Path to key used to SSH onto created hosts"
variable "target_user" {
description = "SSH username for target"
type = string
default = ""
}
@@ -92,41 +93,65 @@ variable "aws_secret_access_key" {
type = string
default = ""
}
variable "aws_host_set_filter1" {
variable "aws_host_set_filter" {
description = "Filter tag for host set used in dynamic host catalogs"
type = string
default = ""
}
variable "aws_host_set_count1" {
description = "Number of hosts in aws_host_set_filter1"
type = number
default = 0
}
variable "aws_host_set_ips1" {
variable "aws_host_set_ips" {
description = "List of IP addresses in aws_host_set_filter1"
type = list(string)
default = [""]
}
variable "aws_host_set_filter2" {
description = "Filter tag for host set used in dynamic host catalogs"
variable "ldap_address" {
description = "URL to LDAP server"
type = string
default = ""
}
variable "aws_host_set_ips2" {
description = "List of IP addresses in aws_host_set_filter2"
type = list(string)
default = [""]
variable "ldap_domain_dn" {
description = "Distinguished Name to the LDAP domain"
type = string
default = ""
}
variable "ldap_admin_dn" {
description = "Distinguished Name to the LDAP admin user"
type = string
default = ""
}
variable "ldap_admin_password" {
description = "Password for the LDAP admin user"
type = string
default = ""
}
variable "ldap_user_name" {
description = "Username of an LDAP user"
type = string
default = ""
}
variable "ldap_user_password" {
description = "Password for an LDAP user"
type = string
default = ""
}
variable "ldap_group_name" {
description = "Name of LDAP group"
type = string
default = ""
}
variable "worker_token" {
description = "Worker Registration Token"
type = string
default = ""
}
locals {
aws_ssh_private_key_path = abspath(var.aws_ssh_private_key_path)
vault_addr = var.vault_addr != "" ? "http://${var.vault_addr}:${var.vault_port}" : ""
vault_addr_internal = var.vault_addr_internal != "" ? "http://${var.vault_addr_internal}:8200" : local.vault_addr
aws_host_set_ips1 = jsonencode(var.aws_host_set_ips1)
aws_host_set_ips2 = jsonencode(var.aws_host_set_ips2)
aws_host_set_ips = jsonencode(var.aws_host_set_ips)
}
resource "enos_local_exec" "run_e2e_ui_test" {
resource "enos_local_exec" "run_e2e_test" {
environment = {
BOUNDARY_ADDR = var.alb_boundary_api_addr
E2E_PASSWORD_AUTH_METHOD_ID = var.auth_method_id
@@ -141,14 +166,21 @@ resource "enos_local_exec" "run_e2e_ui_test" {
E2E_VAULT_ADDR = local.vault_addr_internal
E2E_AWS_ACCESS_KEY_ID = var.aws_access_key_id
E2E_AWS_SECRET_ACCESS_KEY = var.aws_secret_access_key
E2E_AWS_HOST_SET_FILTER = var.aws_host_set_filter1
E2E_AWS_HOST_SET_IPS = local.aws_host_set_ips1
E2E_AWS_HOST_SET_FILTER2 = var.aws_host_set_filter2
E2E_AWS_HOST_SET_FILTER = var.aws_host_set_filter
E2E_AWS_HOST_SET_IPS = local.aws_host_set_ips
E2E_LDAP_ADDR = var.ldap_address
E2E_LDAP_DOMAIN_DN = var.ldap_domain_dn
E2E_LDAP_ADMIN_DN = var.ldap_admin_dn
E2E_LDAP_ADMIN_PASSWORD = var.ldap_admin_password
E2E_LDAP_USER_NAME = var.ldap_user_name
E2E_LDAP_USER_PASSWORD = var.ldap_user_password
E2E_LDAP_GROUP_NAME = var.ldap_group_name
E2E_WORKER_TOKEN = var.worker_token
}
inline = var.debug_no_run ? [""] : ["set -o pipefail; PATH=\"${var.local_boundary_dir}:$PATH\" yarn --cwd ${var.local_boundary_ui_src_dir}/ui/admin run e2e 2>&1 | tee ${path.module}/../../test-e2e-ui.log"]
}
output "test_results" {
value = enos_local_exec.run_e2e_ui_test.stdout
value = enos_local_exec.run_e2e_test.stdout
}