* 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
37 lines
896 B
Go
37 lines
896 B
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package provider
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/kelseyhightower/envconfig"
|
|
)
|
|
|
|
type config struct {
|
|
BoundaryAddr string `envconfig:"BOUNDARY_ADDR" required:"true"`
|
|
BoundaryAuthToken string `envconfig:"BOUNDARY_AUTH_TOKEN" required:"true"`
|
|
BoundaryRecoveryKey string `envconfig:"BOUNDARY_DEV_RECOVERY_KEY"`
|
|
}
|
|
|
|
func loadTestConfig() (*config, error) {
|
|
var c config
|
|
err := envconfig.Process("", &c)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &c, nil
|
|
}
|
|
|
|
// requireRecoveryKey returns cfg.BoundaryRecoveryKey or calls t.Skip when the
|
|
// env var is not set. Call this only in tests that actually use the recovery KMS.
|
|
func requireRecoveryKey(t *testing.T, cfg *config) string {
|
|
t.Helper()
|
|
if cfg.BoundaryRecoveryKey == "" {
|
|
t.Fatal("BOUNDARY_DEV_RECOVERY_KEY not set")
|
|
}
|
|
return cfg.BoundaryRecoveryKey
|
|
}
|