* testing/e2e: Use a separate config file for database init The other config file contains templated parameters, which was causing errors when loading the config file, even though the values were never used. * testing/e2e: add target pagination test Exercises target pagination both over the CLI and the API. These tests run in <10s on my machine, though they each involve creating 1000 targets (with current defaults). --------- Co-authored-by: Michael Li <michael.li@hashicorp.com>
25 lines
739 B
Go
25 lines
739 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package base_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
|
|
}
|