test(e2e): Move postgres info to other variables (#6367)

This commit is contained in:
Michael Li authored and GitHub committed 2026-01-23 15:19:03 -05:00
1 parent 4582761059
commit 06af2baf31
5 files changed
+34 -4

No files matched your search

+16 -2
View File
@@ -101,6 +101,18 @@ scenario "e2e_docker_base_plus" {
}
}
step "create_host" {
module = module.docker_openssh_server
depends_on = [
step.create_docker_network
]
variables {
image_name = "${var.docker_mirror}/linuxserver/openssh-server:latest"
network_name = [local.network_cluster]
private_key_file_path = local.aws_ssh_private_key_path
}
}
step "run_e2e_test" {
module = module.test_e2e_docker
depends_on = [
@@ -120,12 +132,14 @@ scenario "e2e_docker_base_plus" {
local_boundary_dir = step.build_boundary_docker_image.cli_zip_path
local_boundary_src_dir = local.local_boundary_src_dir
aws_ssh_private_key_path = local.aws_ssh_private_key_path
target_address = step.create_boundary_database.container_name
target_port = step.create_boundary_database.port
target_address = step.create_host.address
target_port = step.create_host.port
target_user = "ubuntu"
postgres_user = step.create_boundary_database.user
postgres_password = step.create_boundary_database.password
postgres_database_name = step.create_boundary_database.database_name
postgres_address = step.create_boundary_database.container_name
postgres_port = step.create_boundary_database.port
ldap_address = step.create_ldap_server.address
ldap_domain_dn = step.create_ldap_server.domain_dn
ldap_admin_dn = step.create_ldap_server.admin_dn
+12
View File
@@ -189,6 +189,16 @@ variable "postgres_database_name" {
type = string
default = ""
}
variable "postgres_address" {
description = "Address of the postgres database"
type = string
default = ""
}
variable "postgres_port" {
description = "Port of the postgres database"
type = string
default = ""
}
variable "ldap_address" {
description = "URL to LDAP server"
type = string
@@ -336,6 +346,8 @@ resource "enos_local_exec" "run_e2e_test" {
E2E_POSTGRES_USER = var.postgres_user
E2E_POSTGRES_PASSWORD = var.postgres_password
E2E_POSTGRES_DB_NAME = var.postgres_database_name
E2E_POSTGRES_ADDRESS = var.postgres_address
E2E_POSTGRES_PORT = var.postgres_port
E2E_WORKER_TAG_INGRESS = var.worker_tag_ingress
E2E_WORKER_TAG_EGRESS = var.worker_tag_egress
E2E_WORKER_TAG_COLLOCATED = var.worker_tag_collocated
@@ -37,6 +37,8 @@ docker run \
-e "E2E_POSTGRES_USER=$E2E_POSTGRES_USER" \
-e "E2E_POSTGRES_PASSWORD=$E2E_POSTGRES_PASSWORD" \
-e "E2E_POSTGRES_DB_NAME=$E2E_POSTGRES_DB_NAME" \
-e "E2E_POSTGRES_ADDRESS=$E2E_POSTGRES_ADDRESS" \
-e "E2E_POSTGRES_PORT=$E2E_POSTGRES_PORT" \
-e "E2E_WORKER_TAG_INGRESS=$E2E_WORKER_TAG_INGRESS" \
-e "E2E_WORKER_TAG_EGRESS=$E2E_WORKER_TAG_EGRESS" \
-e "E2E_WORKER_TAG_COLLOCATED=$E2E_WORKER_TAG_COLLOCATED" \
@@ -13,6 +13,8 @@ type config struct {
PostgresDbName string `envconfig:"E2E_POSTGRES_DB_NAME" required:"true"`
PostgresUser string `envconfig:"E2E_POSTGRES_USER" required:"true"`
PostgresPassword string `envconfig:"E2E_POSTGRES_PASSWORD" required:"true"`
PostgresAddress string `envconfig:"E2E_POSTGRES_ADDRESS" required:"true"`
PostgresPort string `envconfig:"E2E_POSTGRES_PORT" required:"true"`
LdapAddress string `envconfig:"E2E_LDAP_ADDR" required:"true"` // e.g. ldap://ldap
LdapDomainDn string `envconfig:"E2E_LDAP_DOMAIN_DN" required:"true"` // e.g. dc=example,dc=org
LdapAdminDn string `envconfig:"E2E_LDAP_ADMIN_DN" required:"true"` // e.g. cn=admin,dc=example,dc=org
@@ -41,8 +41,8 @@ func TestCliTcpTargetConnectPostgres(t *testing.T) {
t,
ctx,
projectId,
c.TargetPort,
[]target.Option{target.WithAddress(c.TargetAddress)},
c.PostgresPort,
[]target.Option{target.WithAddress(c.PostgresAddress)},
)
require.NoError(t, err)
storeId, err := boundary.CreateCredentialStoreStaticCli(t, ctx, projectId)