Add section about unit tests
This commit is contained in:
		
							parent
							
								
									75435ef934
								
							
						
					
					
						commit
						305b77be90
					
				
							
								
								
									
										24
									
								
								README.md
								
								
								
								
							
							
						
						
									
										24
									
								
								README.md
								
								
								
								
							|  | @ -350,3 +350,27 @@ kubectl port-forward POD_NAME DLV_PORT:DLV_PORT | |||
| ``` | ||||
| $ dlv connect 127.0.0.1:DLV_PORT | ||||
| ``` | ||||
| 
 | ||||
| ### Unit tests | ||||
| 
 | ||||
| To run all unit tests, you can simply do: | ||||
| 
 | ||||
| ``` | ||||
| go test ./... | ||||
| ``` | ||||
| 
 | ||||
| For go 1.9 `vendor` directory would be excluded automatically. For previous | ||||
| versions you can exclude it manually: | ||||
| 
 | ||||
| ``` | ||||
| go test (glide novendor) | ||||
| ``` | ||||
| 
 | ||||
| In case if you need to debug your unit test, it's possible to use delve: | ||||
| 
 | ||||
| ``` | ||||
| $ dlv test ./pkg/util/retryutil/ | ||||
| Type 'help' for list of commands. | ||||
| (dlv) c | ||||
| PASS | ||||
| ``` | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue