hashicorp / hashicorp/consul

Improve API client tests with a mock HTTP server

Open
#6,313 3 comments 2 reactions 0 assignees View on GitHub
type/enhancement type/umbrella-☂️
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

Right now API client "unit" tests require a full agent to be running for testing. We should improve this by having a mock HTTP server which can respond to our API requests without actually running any agent code.

We will still need integration tests to run against the actual binary but hopefully we can do that in a way where we can point it at a random consul version and let it run which would improve our backwards compat testing.

This mock would also allow us to test some of the enterprise endpoints with stubs in OSS without actually pulling the full endpoint into oss (like for licensing).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.