test

package module
v0.0.0-...-9fc09ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

Tests

This folder contains automated tests for this Module. All of the tests are written in Go. Most of these are "integration tests" that deploy real infrastructure using Terraform and verify that infrastructure works as expected using a helper library called Terratest.

WARNING WARNING WARNING

Note #1: Many of these tests create real resources in an AWS account and then try to clean those resources up at the end of a test run. That means these tests may cost you money to run! When adding tests, please be considerate of the resources you create and take extra care to clean everything up when you're done!

Note #2: Never forcefully shut the tests down (e.g. by hitting CTRL + C) or the cleanup tasks won't run!

Note #3: We set -timeout 60m on all tests not because they necessarily take that long, but because Go has a default test timeout of 10 minutes, after which it forcefully kills the tests with a SIGQUIT, preventing the cleanup tasks from running. Therefore, we set an overlying long timeout to make sure all tests have enough time to finish and clean up.

Running the tests

Prerequisites
  • Install the latest version of Go.
  • Install dep for Go dependency management.
  • Install Terraform.
  • Configure your AWS credentials using one of the options supported by the AWS SDK. Usually, the easiest option is to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
One-time setup

Download Go dependencies using dep:

cd test
dep ensure
Run all the tests
cd test
go test -v -timeout 60m
Run a specific test

To run a specific test called TestFoo:

cd test
go test -v -timeout 60m -run TestFoo

Documentation

Index

Constants

View Source
const AWS_DEFAULT_REGION_ENV_VAR = "AWS_DEFAULT_REGION"
View Source
const CONSUL_AMI_TEMPLATE_VAR_DOWNLOAD_URL = "CONSUL_DOWNLOAD_URL"
View Source
const CONSUL_AMI_TEMPLATE_VAR_REGION = "aws_region"
View Source
const CONSUL_CLUSTER_EXAMPLE_DEFAULT_NUM_CLIENTS = 6
View Source
const CONSUL_CLUSTER_EXAMPLE_DEFAULT_NUM_SERVERS = 3
View Source
const CONSUL_CLUSTER_EXAMPLE_OUTPUT_CLIENT_ASG_NAME = "asg_name_clients"
View Source
const CONSUL_CLUSTER_EXAMPLE_OUTPUT_SERVER_ASG_NAME = "asg_name_servers"
View Source
const CONSUL_CLUSTER_EXAMPLE_VAR_AMI_ID = "ami_id"
View Source
const CONSUL_CLUSTER_EXAMPLE_VAR_CLUSTER_NAME = "cluster_name"
View Source
const CONSUL_CLUSTER_EXAMPLE_VAR_NUM_CLIENTS = "num_clients"
View Source
const CONSUL_CLUSTER_EXAMPLE_VAR_NUM_SERVERS = "num_servers"
View Source
const CONSUL_CLUSTER_EXAMPLE_VAR_SSH_KEY_NAME = "ssh_key_name"
View Source
const REPO_ROOT = "../"
View Source
const SAVED_AWS_REGION = "AwsRegion"

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL