Golang tests are in files named *_test.go
and start with Test
Types of tests:
Flaky tests and fragile tests.
- Try to recreate the situation locally
- Add more output to figure out what’s going on.
- Don’t run the test on a platform if it doesn’t add value. Example: TestComposerVersionConfig.
Slow tests
- Figure out why (doing too many things? Too many starts and stops? Can it do less? Is the actual test valid?) Example: TestDdevXhprofEnabled see PR.
Big Infra Test Improvements
- Run most tests only on Linux and macOS
- Duplicate less testing
- Add coverage for Orbstack and Rancher Desktop
- Spend more testing time on more important platforms, like macOS arm64.
Exercises: