test: Update tests to run against boundary-enterprise (#834)

* chore: Update make testacc to use boundary dev

Use boundary dev instead of test controller in order to get an enterprise cluster

* test: Update tests to use boundary dev cluster

- Set up environment variables via loadTestConfig
- Update testConfigWithRecovery to use recovery key from config
- Update testCOnfigWithoutAMPWCredentials to use boundary dev's auth method

* test: Update tests to use their own orgs

This is to address some test failures due to conflicts when creating resources within the same org.

* test: Enable tests that require boundary-enterprise

* chore: Update workflow to use boundary enterprise
This commit is contained in:
Michael Li authored and GitHub committed 2026-09-10 15:00:05 -04:00
1 parent 7c5ba90375
commit 2d920805d4
50 files changed
+932 -592

No files matched your search

@@ -7,9 +7,10 @@ import (
"fmt"
"testing"
"github.com/hashicorp/boundary/testing/controller"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/require"
)
const (
@@ -62,7 +63,7 @@ resource "boundary_account_password" "foo" {
scope_id = boundary_scope.org1.id
depends_on = [boundary_role.org1_admin]
}
resource "boundary_account_password" "foo" {
name = "test"
description = "%s"
@@ -73,9 +74,10 @@ resource "boundary_account_password" "foo" {
)
func TestAccAccount(t *testing.T) {
tc := controller.NewTestController(t, tcConfig...)
defer tc.Shutdown()
url := tc.ApiAddrs()[0]
cfg, err := loadTestConfig()
require.NoError(t, err)
suffix := id.UniqueId()
url := cfg.BoundaryAddr
var provider *schema.Provider
@@ -85,7 +87,7 @@ func TestAccAccount(t *testing.T) {
Steps: []resource.TestStep{
{
// create
Config: testConfig(url, fooOrg, fooAccountPassword),
Config: testConfig(url, fooOrg(suffix), fooAccountPassword),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("boundary_account_password.foo", "description", fooAccountPasswordDesc),
resource.TestCheckResourceAttr("boundary_account_password.foo", "name", "test"),
@@ -98,7 +100,7 @@ func TestAccAccount(t *testing.T) {
importStep("boundary_account_password.foo", "password"),
{
// update
Config: testConfig(url, fooOrg, fooAccountPasswordUpdate),
Config: testConfig(url, fooOrg(suffix), fooAccountPasswordUpdate),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("boundary_account_password.foo", "description", fooAccountPasswordDescUpdate),
resource.TestCheckResourceAttr("boundary_account_password.foo", "name", "test"),
@@ -111,7 +113,7 @@ func TestAccAccount(t *testing.T) {
importStep("boundary_account_password.foo", "password"),
{
// update without passing type field
Config: testConfig(url, fooOrg, fooAccountPasswordWithoutTypeField),
Config: testConfig(url, fooOrg(suffix), fooAccountPasswordWithoutTypeField),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("boundary_account_password.foo", "description", fooAccountPasswordDescUpdate),
resource.TestCheckResourceAttr("boundary_account_password.foo", "name", "test"),