mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
Always use a local test server (#4207)
Some commands didn't setup a local test server since they didn't need it. Other commands didn't setup a local test server because Seth forgot. Long story short, I kept seeing weird requests to my Vault server when I ran tests, and that should never happen. This ensures all test requests will go to a test Vault instance. Benchmarks show this adds 0.4s to the command test suite.
This commit is contained in:
committed by
Jeff Mitchell
parent
5b4abc09dd
commit
e3de6c463c
@@ -26,7 +26,12 @@ func TestVersionCommand_Run(t *testing.T) {
|
||||
t.Run("output", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
client, closer := testVaultServer(t)
|
||||
defer closer()
|
||||
|
||||
ui, cmd := testVersionCommand(t)
|
||||
cmd.client = client
|
||||
|
||||
code := cmd.Run(nil)
|
||||
if exp := 0; code != exp {
|
||||
t.Errorf("expected %d to be %d", code, exp)
|
||||
|
||||
Reference in New Issue
Block a user