Commit Graph

36 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Seth Hoenig
c4957b0901 e2e: mark framework package as deprecated (#16075)
Nothing more motivating than lots of deprecation warnings
to get some code refactored.
2023-02-07 08:10:40 -06:00
Seth Hoenig
f05aa6d5ec vault: configure user agent on Nomad vault clients (#15745)
* vault: configure user agent on Nomad vault clients

This PR attempts to set the User-Agent header on each Vault API client
created by Nomad. Still need to figure a way to set User-Agent on the
Vault client created internally by consul-template.

* vault: fixup find-and-replace gone awry
2023-01-10 10:39:45 -06:00
Seth Hoenig
0c62f445c3 build: run gofmt on all go source files
Go 1.19 will forecefully format all your doc strings. To get this
out of the way, here is one big commit with all the changes gofmt
wants to make.
2022-08-16 11:14:11 -05:00
Seth Hoenig
7e6767ddf8 e2e: have e2e use ci.Parallel
This is a followup to having tests run in serial in CI.

The e2e package isn't in CI, but lets use the helper anyway
so we can setup semgrep rules covering the entire repository.
2022-03-17 08:37:34 -05:00
Mahmood Ali
f7acda4260 e2e: use testify requires instead of t.Fatal
testify requires offer better error message that is easier to notice when seeing
a wall of text in the builds.
2021-01-26 09:14:47 -05:00
Kris Hicks
85ed8ddd4f Add gosimple linter (#9590) 2020-12-09 11:05:18 -08:00
Tim Gross
daf9ed3f9c e2e: remove unused framework provisioning code (#8908) 2020-09-18 11:46:47 -04:00
Tim Gross
75a913eb0a e2e: minor rename and cleanup (#8824) 2020-09-04 08:51:22 -04:00
Tim Gross
cd93c1f4da E2E: move Nomad installation to script on remote hosts (#8706)
This changeset moves the installation of Nomad binaries out of the
provisioning framework and into scripts that are installed on the remote host
during AMI builds.

This provides a few advantages:

* The provisioning framework can be reduced in scope (with the goal of moving
  most of it into the Terraform stack entirely).
* The scripts can be arbitrarily complex if we don't have to stuff them into
  ssh commands, so it's easier to make them idempotent. In this changeset, the
  scripts check the version of the existing binary and don't re-download when
  using the `--nomad_sha` or `--nomad_version` flags.
* The scripts can be OS/distro specific, which helps in building new test
  targets.
2020-08-20 16:10:00 -04:00
Tim Gross
d8ac3f9451 migrate E2E test runs to new AWS account (#8676) 2020-08-18 14:24:34 -04:00
Mahmood Ali
88ab2c8d7a e2e: avoid parsing Args in pkg init
Golang 1.13 introduced a change in test flag parsing:

> testing
> ...
> Testing flags are now registered in the new Init function, which is invoked by the generated main function for the test. As a result, testing flags are now only registered when running a test binary, and packages that call flag.Parse during package initialization may cause tests to fail.

https://golang.org/doc/go1.13#testing

Here, we ensure that e2e framework parsing occur in TestMain, by only
initializing Framework at Run invocation.
2020-03-02 14:13:54 -05:00
Tim Gross
8d173664cb e2e: add --quiet flag to s3 copy to reduce log spam (#7085) 2020-02-06 09:24:20 -05:00
Tim Gross
ed41d7b590 e2e: rename linux runner to avoid implicit build tag (#7070)
Go implicitly treats files ending with `_linux.go` as build tagged for
Linux only. This broke the e2e provisioning framework on macOS once we
tried importing it into the `e2e/consulacls` module.
2020-02-04 10:55:38 -05:00
Seth Hoenig
04b526662c e2e: setup consul ACLs a little more correctly 2020-01-31 19:06:11 -06:00
Seth Hoenig
6d99dd4841 e2e: e2e test for connect with consul acls
Provide script for managing Consul ACLs on a TF provisioned cluster for
e2e testing. Script can be used to 'enable' or 'disable' Consul ACLs,
and automatically takes care of the bootstrapping process if necessary.

The bootstrapping process takes a long time, so we may need to
extend the overall e2e timeout (20 minutes seems fine).

Introduces basic tests for Consul Connect with ACLs.
2020-01-31 19:05:36 -06:00
Seth Hoenig
dfc7d97462 e2e: add a -suite flag to e2e.Framework
This change allows for providing the -suite=<Name> flag when
running the e2e framework. If set, only the matching e2e/Framework.TestSuite.Component
will be run, and all ther suites will be skipped.
2020-01-29 14:57:43 -06:00
Tim Gross
0b6b475e7d e2e: update framework to allow deploying Nomad (#6969)
The e2e framework instantiates clients for Nomad/Consul but the
provisioning of the actual Nomad cluster is left to Terraform. The
Terraform provisioning process uses `remote-exec` to deploy specific
versions of Nomad so that we don't have to bake an AMI every time we
want to test a new version. But Terraform treats the resulting
instances as immutable, so we can't use the same tooling to update the
version of Nomad in-place. This is a prerequisite for upgrade testing.

This changeset extends the e2e framework to provide the option of
deploying Nomad (and, in the future, Consul/Vault) with specific
versions to running infrastructure. This initial implementation is
focused on deploying to a single cluster via `ssh` (because that's our
current need), but provides interfaces to hook the test run at the
start of the run, the start of each suite, or the start of a given
test case.

Terraform work includes:
* provides Terraform output that written to JSON used by the framework
  to configure provisioning via `terraform output provisioning`.
* provides Terraform output that can be used by test operators to
  configure their shell via `$(terraform output environment)`
* drops `remote-exec` provisioning steps from Terraform
* makes changes to the deployment scripts to ensure they can be run
  multiple times w/ different versions against the same host.
2020-01-22 08:48:52 -05:00
Preetha Appan
787e37860b Basic consul registration e2e 2019-01-26 10:58:25 -06:00
Danielle Tomlinson
646e077d32 e2e: Add consultemplate test
This adds a basic test for consul template, that verifies the behaviour
of consul-template with task blocking and restarting of tasks
2019-01-07 17:53:55 +01:00
Preetha Appan
7ad040166d new e2e test for spread, and refactor affinity tests to share util methods 2018-12-19 21:25:32 -06:00
Preetha Appan
4453602c24 Make affinity e2e tests wait for leader through Before method 2018-12-19 09:56:44 -06:00
Nick Ethier
ea0e32a177 e2e/framework: fix linting 2018-07-31 13:03:52 -04:00
Nick Ethier
134a0c41cd e2e/framework: code review fixes 2018-07-24 12:33:30 -04:00
Nick Ethier
165baa4ee1 e2e/framework: add framework.F context 2018-07-11 13:19:14 -04:00
Nick Ethier
7fcd9e23b1 e2e/framework: move *testing.T access to a context *framework.F which is scoped to each test 2018-07-11 13:12:23 -04:00
Nick Ethier
7c9ba61ae7 e2e/framework: strip flag prefix and use testify/require for embedded assertions 2018-07-11 13:12:23 -04:00
Nick Ethier
2f9d663bba e2e/framework: don't require NOMAD_ADDR and instead rely on defaults 2018-07-11 13:12:23 -04:00
Nick Ethier
4fba59748f e2e/framework: remove 'step' naming and wording 2018-07-11 13:12:23 -04:00
Nick Ethier
4b0010b74a e2e/framework: add missing errorf var 2018-07-11 13:12:23 -04:00
Nick Ethier
8353c54169 e2e/framework: cleanup provisioner and more docs 2018-07-11 13:12:23 -04:00
Nick Ethier
a30a5519f3 e2e/framework: additional documentation 2018-07-11 13:12:23 -04:00
Nick Ethier
7c224cf766 e2e/framework: add consul and vault client detection 2018-07-11 13:12:23 -04:00
Nick Ethier
cb9e1e14a4 e2e/framework: add minimal godocs 2018-07-11 13:12:23 -04:00
Nick Ethier
8be5b65324 e2e/framework: initial e2e framework implementation 2018-07-11 13:12:23 -04:00