open-nomad/e2e
Tim Gross 457e3ad5c6
e2e: document e2e provisioning process (#6976)
2020-01-22 16:55:17 -05:00
..
affinities e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
bin e2e update shell scripts argument quoting 2019-06-04 15:52:32 -04:00
cli e2e/cli/command: Wait() after execution 2019-11-25 10:56:40 -08:00
clientstate e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
connect e2e: add test for multiple sevice sidecars in the same alloc 2020-01-06 12:48:35 -05:00
consul e2e: ensure group script check tests interpolation (#6972) 2020-01-22 09:54:54 -05:00
consultemplate e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
deployment e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
e2eutil e2e: add allocstats test for Windows (#6775) 2019-11-26 08:05:42 -05:00
example e2e/cli: fix formatting 2018-07-31 13:52:25 -04:00
execagent e2e: add NomadAgent and basic client state test 2019-03-21 07:14:34 -07:00
fabio e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
framework e2e: update framework to allow deploying Nomad (#6969) 2020-01-22 08:48:52 -05:00
hostvolumes e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
metrics commit a hclfmt to eliminate diffs after 'make dev' 2020-01-09 08:18:51 -05:00
migrations chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
nomad09upgrade e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
nomadexec e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
prometheus e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
rescheduling chore: Format hcl configurations 2019-07-20 16:55:07 +02:00
spread e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
taskevents e2e: add a Windows client to test runner (#6735) 2019-11-25 13:31:00 -05:00
terraform e2e: document e2e provisioning process (#6976) 2020-01-22 16:55:17 -05:00
upgrades script e2e/upgrades: cluster upgrade scripts 2019-09-24 14:35:45 -04:00
vault docs: vault integration docs should reference new token_explicit_max_ttl field 2019-12-02 14:22:47 -06:00
.gitignore e2e: document e2e provisioning process (#6976) 2020-01-22 16:55:17 -05:00
README.md e2e: document e2e provisioning process (#6976) 2020-01-22 16:55:17 -05:00
e2e_test.go e2e: update framework to allow deploying Nomad (#6969) 2020-01-22 08:48:52 -05:00

README.md

End to End Tests

This package contains integration tests.

The terraform folder has provisioning code to spin up a Nomad cluster on AWS. The tests work with the NOMAD_ADDR environment variable which can be set either to a local dev Nomad agent or a Nomad client on AWS.

Local Development

The workflow when developing end to end tests locally is to run the provisioning step described below once, and then run the tests as described below.

When making local changes, use ./bin/update $(which nomad) /usr/local/bin/nomad and ./bin/run sudo systemctl restart nomad to destructively modify the provisioned cluster.

Provisioning Test Infrastructure on AWS

You'll need Terraform and AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to setup AWS instances on which e2e tests will run. See the README for details. The number of servers and clients is configurable, as is the configuration file for each client and server.

Provisioning e2e Framework Nomad Cluster

You can use the Terraform output from the previous step to generate a provisioning configuration file for the e2e framework.

# from the ./e2e/terraform directory
terraform output provisioning | jq . > ../provisioning.json

By default the provisioning.json will include a nomad_sha field for each node. You can edit this file to change the version of Nomad you want to deploy. Because each node has its own value, you can create cluster of mixed versions. The provisioning framework accepts any of the following options:

  • nomad_sha: This is a Nomad binary identified by its full commit SHA that's stored in a shared s3 bucket that Nomad team developers can access. That commit SHA can be from any branch that's pushed to remote. (Ex. "nomad_sha": "0b6b475e7da77fed25727ea9f01f155a58481b6c")
  • nomad_local_binary: This is a path to a Nomad binary on your own host. (Ex. "nomad_local_binary": "/home/me/nomad")
  • nomad_version: This is a version number of Nomad that's been released to HashiCorp. (Ex. "nomad_version": "0.10.2")

You can pass the following flags to go test to override the values in provisioning.json for all nodes:

  • -nomad.local_file=string: provision this specific local binary of Nomad
  • -nomad.sha=string: provision this specific sha from S3
  • -nomad.version=string: provision this version from releases.hashicorp.com

Deploy Nomad to the cluster:

# from the ./e2e/terraform directory, set your client environment
$(terraform output environment)

cd ..
go test -v . -provision.terraform ./provisioning.json -skipTests

Running

After completing the provisioning step above, you can set the client environment for NOMAD_ADDR and run the tests as shown below:

# from the ./e2e/terraform directory, set your client environment
# if you haven't already
$(terraform output environment)

cd ..
go test -v .

If you want to run a specific test, you'll need to regex-escape some of the test's name so that the test runner doesn't skip over framework struct method names in the full name of the tests:

 go test -v . -run 'TestE2E/Consul/\*consul\.ScriptChecksE2ETest/TestGroup'