Commit Graph

4 Commits

Author SHA1 Message Date
Jake Champlin 999611b888
provider/nomad: Update Nomad provider tests
Nomad server could have already purged the test job `foo` by the time the test checks to make sure the `foo` job has been deleted, resulting in a `404` response from the Nomad server.

```
$ make testacc TEST=./builtin/providers/nomad
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/04 15:51:01 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/nomad -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestResourceJob_basic
--- PASS: TestResourceJob_basic (1.78s)
=== RUN   TestResourceJob_refresh
--- PASS: TestResourceJob_refresh (3.30s)
=== RUN   TestResourceJob_disableDestroyDeregister
--- PASS: TestResourceJob_disableDestroyDeregister (3.63s)
=== RUN   TestResourceJob_idChange
--- PASS: TestResourceJob_idChange (3.44s)
=== RUN   TestResourceJob_parameterizedJob
--- PASS: TestResourceJob_parameterizedJob (1.76s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/nomad  13.924s
```
2017-05-04 15:52:55 -04:00
Jake Champlin 5370a0dc30
provider/nomad: Update acceptance tests to correctly reflect nomad API
Previously Nomad acceptance tests would look for a `404` response from the Nomad API when querying a nomad job after it had been stopped. Nomad has, for a while now, cached jobs such that they are still returnable from the API but have `"dead"` as their status.

```
$ make testacc TEST=./builtin/providers/nomad
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/03 16:27:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/nomad -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestResourceJob_basic
--- PASS: TestResourceJob_basic (0.03s)
=== RUN   TestResourceJob_refresh
--- PASS: TestResourceJob_refresh (0.04s)
=== RUN   TestResourceJob_disableDestroyDeregister
--- PASS: TestResourceJob_disableDestroyDeregister (0.05s)
=== RUN   TestResourceJob_idChange
--- PASS: TestResourceJob_idChange (0.06s)
=== RUN   TestResourceJob_parameterizedJob
--- PASS: TestResourceJob_parameterizedJob (0.02s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/nomad  0.222s
```
2017-05-03 16:33:42 -04:00
Jake Champlin 79c117877e
provider/nomad: Update jobspec parser
Updates vendored Nomad jobspec parser such that parameterized nomad job files can no be parsed and used with Terraform.
Also fixes tests to adhere to new jobspec version, and update documentation to reflect such as well.
2017-02-03 18:19:23 -05:00
Mitchell Hashimoto bb5f6498e2
provider/nomad 2016-10-24 10:34:06 -07:00