test(e2e): Reorganize tests to improve CI runtime (#6377)
This commit is contained in:
1 parent
06af2baf31
commit
3e3ecd59c9
35 files changed
+184
-31
No files matched your search
@@ -73,6 +73,7 @@ jobs:
|
|||||||
- filter: 'e2e_aws builder:crt ip_version:4'
|
- filter: 'e2e_aws builder:crt ip_version:4'
|
||||||
- filter: 'e2e_database'
|
- filter: 'e2e_database'
|
||||||
- filter: 'e2e_docker_base builder:crt'
|
- filter: 'e2e_docker_base builder:crt'
|
||||||
|
- filter: 'e2e_docker_base_connect builder:crt'
|
||||||
- filter: 'e2e_docker_base_plus builder:crt'
|
- filter: 'e2e_docker_base_plus builder:crt'
|
||||||
- filter: 'e2e_docker_base_with_gcp builder:crt'
|
- filter: 'e2e_docker_base_with_gcp builder:crt'
|
||||||
- filter: 'e2e_docker_base_with_vault builder:crt'
|
- filter: 'e2e_docker_base_with_vault builder:crt'
|
||||||
|
|||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Copyright (c) HashiCorp, Inc.
|
||||||
|
# SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
|
# For this scenario to work, add the following line to /etc/hosts
|
||||||
|
# 127.0.0.1 localhost boundary
|
||||||
|
|
||||||
|
scenario "e2e_docker_base_connect" {
|
||||||
|
terraform_cli = terraform_cli.default
|
||||||
|
terraform = terraform.default
|
||||||
|
providers = [
|
||||||
|
provider.enos.default
|
||||||
|
]
|
||||||
|
|
||||||
|
matrix {
|
||||||
|
builder = ["local", "crt"]
|
||||||
|
}
|
||||||
|
|
||||||
|
locals {
|
||||||
|
aws_ssh_private_key_path = abspath(var.aws_ssh_private_key_path)
|
||||||
|
local_boundary_src_dir = var.local_boundary_src_dir != null ? abspath(var.local_boundary_src_dir) : null
|
||||||
|
boundary_docker_image_file = abspath(var.boundary_docker_image_file)
|
||||||
|
license_path = abspath(var.boundary_license_path != null ? var.boundary_license_path : joinpath(path.root, "./support/boundary.hclic"))
|
||||||
|
|
||||||
|
network_cluster = "e2e_cluster"
|
||||||
|
|
||||||
|
build_path = {
|
||||||
|
"local" = "/tmp",
|
||||||
|
"crt" = var.crt_bundle_path == null ? null : abspath(var.crt_bundle_path)
|
||||||
|
}
|
||||||
|
tags = merge({
|
||||||
|
"Project Name" : var.project_name
|
||||||
|
"Project" : "Enos",
|
||||||
|
"Environment" : "ci"
|
||||||
|
}, var.tags)
|
||||||
|
}
|
||||||
|
|
||||||
|
step "build_boundary_docker_image" {
|
||||||
|
module = matrix.builder == "crt" ? module.build_boundary_docker_crt : module.build_boundary_docker_local
|
||||||
|
|
||||||
|
variables {
|
||||||
|
path = matrix.builder == "crt" ? local.boundary_docker_image_file : ""
|
||||||
|
cli_build_path = local.build_path[matrix.builder]
|
||||||
|
edition = var.boundary_edition
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
step "create_docker_network" {
|
||||||
|
module = module.docker_network
|
||||||
|
variables {
|
||||||
|
network_name = local.network_cluster
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
step "create_boundary_database" {
|
||||||
|
depends_on = [
|
||||||
|
step.create_docker_network
|
||||||
|
]
|
||||||
|
variables {
|
||||||
|
image_name = "${var.docker_mirror}/library/postgres:latest"
|
||||||
|
network_name = [local.network_cluster]
|
||||||
|
}
|
||||||
|
module = module.docker_postgres
|
||||||
|
}
|
||||||
|
|
||||||
|
step "read_license" {
|
||||||
|
skip_step = var.boundary_edition == "oss"
|
||||||
|
module = module.read_license
|
||||||
|
|
||||||
|
variables {
|
||||||
|
license_path = local.license_path
|
||||||
|
license = var.boundary_license
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
step "create_boundary" {
|
||||||
|
module = module.docker_boundary
|
||||||
|
depends_on = [
|
||||||
|
step.create_docker_network,
|
||||||
|
step.create_boundary_database,
|
||||||
|
step.build_boundary_docker_image
|
||||||
|
]
|
||||||
|
variables {
|
||||||
|
image_name = step.build_boundary_docker_image.image_name
|
||||||
|
network_name = [local.network_cluster]
|
||||||
|
database_network = local.network_cluster
|
||||||
|
postgres_address = step.create_boundary_database.address
|
||||||
|
boundary_license = var.boundary_edition != "oss" ? step.read_license.license : ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 = [
|
||||||
|
step.create_boundary,
|
||||||
|
step.create_host,
|
||||||
|
]
|
||||||
|
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
|
||||||
|
auth_login_name = step.create_boundary.login_name
|
||||||
|
auth_password = step.create_boundary.password
|
||||||
|
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_host.address
|
||||||
|
target_port = step.create_host.port
|
||||||
|
target_user = "ubuntu"
|
||||||
|
max_page_size = step.create_boundary.max_page_size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_plus_test
|
package base_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_plus_test
|
package base_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (c) HashiCorp, Inc.
|
||||||
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
|
package base_connect_test
|
||||||
|
|
||||||
|
import "github.com/kelseyhightower/envconfig"
|
||||||
|
|
||||||
|
type config struct {
|
||||||
|
TargetAddress string `envconfig:"E2E_TARGET_ADDRESS" required:"true"` // e.g. 192.168.0.1
|
||||||
|
TargetSshKeyPath string `envconfig:"E2E_SSH_KEY_PATH" required:"true"` // e.g. /Users/username/key.pem
|
||||||
|
TargetSshUser string `envconfig:"E2E_SSH_USER" required:"true"` // e.g. ubuntu
|
||||||
|
TargetPort string `envconfig:"E2E_TARGET_PORT" required:"true"`
|
||||||
|
MaxPageSize int `envconfig:"E2E_MAX_PAGE_SIZE" default:"1000"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func loadTestConfig() (*config, error) {
|
||||||
|
var c config
|
||||||
|
err := envconfig.Process("", &c)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &c, nil
|
||||||
|
}
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_connect_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) HashiCorp, Inc.
|
// Copyright (c) HashiCorp, Inc.
|
||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
package base_test
|
package base_plus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
Reference in new issue
Block a user