mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +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:
		 Seth Vargo
					Seth Vargo
				
			
				
					committed by
					
						 Jeff Mitchell
						Jeff Mitchell
					
				
			
			
				
	
			
			
			 Jeff Mitchell
						Jeff Mitchell
					
				
			
						parent
						
							5b4abc09dd
						
					
				
				
					commit
					e3de6c463c
				
			| @@ -27,7 +27,11 @@ func TestOperatorUnsealCommand_Run(t *testing.T) { | ||||
| 	t.Run("error_non_terminal", func(t *testing.T) { | ||||
| 		t.Parallel() | ||||
|  | ||||
| 		client, closer := testVaultServer(t) | ||||
| 		defer closer() | ||||
|  | ||||
| 		ui, cmd := testOperatorUnsealCommand(t) | ||||
| 		cmd.client = client | ||||
| 		cmd.testOutput = ioutil.Discard | ||||
|  | ||||
| 		code := cmd.Run(nil) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user