Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Consul's internal testutil package from our unit tests #528

Closed
jwreagor opened this issue Nov 13, 2017 · 1 comment
Closed

Remove Consul's internal testutil package from our unit tests #528

jwreagor opened this issue Nov 13, 2017 · 1 comment

Comments

@jwreagor
Copy link
Contributor

Ref: #519 (comment).

Within ContainerPilot's discovery/consul_test.go we're currently utilizing an internal testing package created for Consul. If we're to continue testing a live consul process then we should execute and control the process ourselves. Another option is to stub out Consul's API or it's HTTP client within our unit tests and exercise this functionality with proper integration tests.

jwreagor pushed a commit to jwreagor/containerpilot that referenced this issue Nov 13, 2017
This commit removes the use case within the discovery package's tests that
depended on an internal Consul test package, `testutil`. We replace this with
our own TestServer object which is responsible for executing a locally installed
`consul` binary. Consul is installed by our Makefile target `tools` for local
development use.

Ref: TritonDataCenter#528
jwreagor pushed a commit to jwreagor/containerpilot that referenced this issue Nov 14, 2017
This commit removes the use case within the discovery package's tests that
depended on an internal Consul test package, `testutil`. We replace this with
our own TestServer object which is responsible for executing a locally installed
`consul` binary. Consul is installed by our Makefile target `tools` for local
development use.

Ref: TritonDataCenter#528
@jwreagor
Copy link
Contributor Author

This refactoring ended up going really well. We've pulled out a package while keeping another around that isn't as much of a moving target for internal Consul testing (testutil/retry). We're also tracking Consul 1.0.0 proper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant