ci: swap freeport for portal in packages (#15661)

This commit is contained in:
Seth Hoenig
2023-01-03 11:25:20 -06:00
committed by GitHub
parent 99ab6d439c
commit dab4d7ed7a
24 changed files with 201 additions and 1041 deletions

View File

@@ -14,12 +14,11 @@ Each unit test should meet a few criteria:
- Undo any changes to the environment
- Set environment variables must be unset (use `t.Setenv`)
- Scratch files/dirs must be removed (use `t.TempDir`)
- Consumed ports must be freed (e.g. `TestServer.Cleanup`, `freeport.Return`)
- Able to run in parallel
- All package level `Test*` functions should start with `ci.Parallel`
- Always use dynamic scratch dirs, files
- Always get ports from helpers (`TestServer`, `TestClient`, `TestAgent`, `freeport.Get`)
- Always get ports via `ci.PortAllocator.Grab()`
- Log control
- Logging must go through the `testing.T` (use `helper/testlog.HCLogger`)