Documentation ¶
Index ¶
- func FormatRegistrationResponse(resp *api.JobRegisterResponse) string
- func FormatStopResponse(resp string) string
- func HTTPTest(t *testing.T, cb func(c *agent.Config), f func(srv *agent.TestAgent))
- func HTTPTestMultiRegionCluster(t *testing.T, cb1, cb2 func(c *agent.Config), ...)
- func HTTPTestMultiRegionClusterParallel(t *testing.T, cb1, cb2 func(c *agent.Config), ...)
- func HTTPTestParallel(t *testing.T, cb func(c *agent.Config), f func(srv *agent.TestAgent))
- func HTTPTestWithACL(t *testing.T, cb func(c *agent.Config), f func(srv *agent.TestAgent))
- func HTTPTestWithACLParallel(t *testing.T, cb func(c *agent.Config), f func(srv *agent.TestAgent))
- func MakeTestNamespaces(t *testing.T, c *api.Client)
- func NewTestClient(testAgent *agent.TestAgent) (*api.Client, error)
- func NomadCleanup(s *agent.TestAgent) (error, error)
- func NomadJobStatus(s *agent.TestAgent, jobID string) (*api.Job, error)
- func NomadPurge(s *agent.TestAgent, jobID string) error
- func NomadRun(s *agent.TestAgent, path string) error
- func NomadStop(s *agent.TestAgent, jobID string) error
- func WithAgentConfig(opts ...AgentOption) func(*agent.Config)
- func WithDefaultConfig() func(c *agent.Config)
- type AgentOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatRegistrationResponse ¶
func FormatRegistrationResponse(resp *api.JobRegisterResponse) string
func FormatStopResponse ¶
func HTTPTest ¶
HTTPTest generates a non-ACL enabled single node cluster, without automatically enabling test parallelism. This is necessary for any test that uses the environment.
func HTTPTestMultiRegionCluster ¶
func HTTPTestMultiRegionCluster(t *testing.T, cb1, cb2 func(c *agent.Config), f func(s1 *agent.TestAgent, s2 *agent.TestAgent))
HTTPTestMultiRegionCluster generates a multi-region two node cluster, without automatically enabling test parallelism. This is necessary for any test that uses the environment.
func HTTPTestMultiRegionClusterParallel ¶
func HTTPTestMultiRegionClusterParallel(t *testing.T, cb1, cb2 func(c *agent.Config), f func(s1 *agent.TestAgent, s2 *agent.TestAgent))
HTTPTestMultiRegionClusterParallel generates a multi-region two node cluster and automatically enables test parallelism. This will panic on test which use the environment. For those, use httpTestMultiRegionCluster instead.
func HTTPTestParallel ¶
HTTPTestParallel generates a non-ACL enabled single node cluster and automatically enables test parallelism.
func HTTPTestWithACL ¶
HTTPTestWithACL generates an ACL enabled single node cluster, without automatically enabling test parallelism. This is necessary for any test that uses the environment.
func HTTPTestWithACLParallel ¶
HTTPTestWithACLParallel generates a ACL enabled single node cluster and automatically enables test parallelism.
func WithAgentConfig ¶
func WithAgentConfig(opts ...AgentOption) func(*agent.Config)
WithAgentConfig creates a callback function that applies all of the provided AgentOptions to the agent.Config.
func WithDefaultConfig ¶
WithDefaultConfig provides an agent.Config callback that generally applies across all tests
Types ¶
type AgentOption ¶
AgentOption is a functional option used as an argument to `WithAgentConfig`
func ACLEnabled ¶
func ACLEnabled() AgentOption
ACLEnabled is an AgentOption used to configure the TestServer with ACLs enabled. Once started, this agent will need to have the ACLs bootstrapped.
func LogLevel ¶
func LogLevel(level string) AgentOption
LogLevel is an AgentOption used to control the log level of the TestServer
func Region ¶
func Region(name string) AgentOption
Region is an AgentOption used to control the log level of the TestServer
func TLSEnabled ¶
func TLSEnabled() AgentOption
TLSEnabled is an AgentOption used to configure the TestServer with a set of test mTLS certificates.