refactor: move slow performance tests to extra test suite
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-01-28 12:00:32 +01:00
parent fce01ddf83
commit 67e06e12ce
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
10 changed files with 433 additions and 5 deletions

View file

@ -116,8 +116,67 @@ Based on the initial analysis (`mix test --slowest 20`), the following test file
1. ✅ **Done:** Optimize seeds tests (this document)
2. ⏳ **Next:** Review and optimize LiveView tests with large data setups
3. ⏳ **Next:** Implement shared fixtures for policy tests
4. ⏳ **Next:** Tag performance tests as `:slow` for conditional execution
5. ⏳ **Future:** Consider nightly integration test suite for comprehensive coverage
4. ✅ **Done:** Tag performance tests as `:slow` for conditional execution
5. ✅ **Done:** Nightly integration test suite for comprehensive coverage
---
## Slow Test Suite
Performance tests have been tagged with `@tag :slow` and separated into a dedicated test suite.
### Structure
- **Performance Tests:** Explicit tests that validate performance characteristics (e.g., N+1 query prevention, filter performance with large datasets)
- **Tagging:** All performance tests are tagged with `@tag :slow` or `@moduletag :slow`
- **Execution:** Standard test runs exclude slow tests, but they can be executed on demand
### Execution
**Fast Tests (Default):**
```bash
just test-fast
# or
mix test --exclude slow
# With specific files or options
just test-fast test/membership/member_test.exs
just test-fast --seed 123
```
**Performance Tests Only:**
```bash
just test-slow
# or
mix test --only slow
# With specific files or options
just test-slow test/mv_web/member_live/index_test.exs
just test-slow --seed 123
```
**All Tests:**
```bash
just test
# or
mix test
# With specific files or options
just test-all test/mv_web/
just test-all --max-failures 5
```
**Note:** All suite commands (`test-fast`, `test-slow`, `test-all`) support additional arguments. The suite semantics (tags) are always preserved - additional arguments are appended to the command.
### CI/CD Integration
- **Standard CI:** Runs `mix test --exclude slow` for faster feedback loops
- **Nightly Builds:** Separate pipeline (`nightly-tests`) runs daily at 2 AM and executes all performance tests
- **Manual Execution:** Performance tests can be executed anytime with `just test-slow`
### Further Details
See [test-slow-suite.md](test-slow-suite.md) for complete documentation of the Slow Test Suite.
---
@ -148,6 +207,7 @@ Based on the initial analysis (`mix test --slowest 20`), the following test file
## References
- **Detailed Documentation:** `docs/test-optimization-seeds.md`
- **Slow Test Suite:** `docs/test-slow-suite.md`
- **Test File:** `test/seeds_test.exs`
- **Original Analysis:** Internal benchmarking session (2026-01-28)
- **Related Guidelines:** `CODE_GUIDELINES.md` - Section 4 (Testing Standards)