Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.
This commit is contained in:
164
docs/testing/PRE_COMMIT_CHECKLIST.md
Normal file
164
docs/testing/PRE_COMMIT_CHECKLIST.md
Normal file
@@ -0,0 +1,164 @@
|
||||
# Pre-Commit Checklist
|
||||
|
||||
> Quick reference for validating changes before committing.
|
||||
|
||||
---
|
||||
|
||||
## TL;DR - Minimum Validation
|
||||
|
||||
```bash
|
||||
# 1. Quick smoke test (2 min)
|
||||
./devops/scripts/local-ci.sh smoke
|
||||
|
||||
# 2. If smoke passes, full PR check (15 min)
|
||||
./devops/scripts/local-ci.sh pr
|
||||
|
||||
# 3. Commit
|
||||
git add -A && git commit -m "Your message"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Validation Levels
|
||||
|
||||
### Level 1: Quick Check (Always)
|
||||
|
||||
```bash
|
||||
./devops/scripts/local-ci.sh smoke
|
||||
```
|
||||
|
||||
**Time:** ~2 minutes
|
||||
**Validates:** Build + Unit tests
|
||||
|
||||
---
|
||||
|
||||
### Level 2: PR-Ready (Before opening PR)
|
||||
|
||||
```bash
|
||||
./devops/scripts/local-ci.sh pr
|
||||
```
|
||||
|
||||
**Time:** ~15 minutes
|
||||
**Validates:** Unit, Architecture, Contract, Integration, Security, Golden
|
||||
|
||||
---
|
||||
|
||||
### Level 3: Module-Focused (Changed modules only)
|
||||
|
||||
```bash
|
||||
./devops/scripts/local-ci.sh module
|
||||
```
|
||||
|
||||
**Time:** Varies by module
|
||||
**Validates:** Auto-detected or specified module
|
||||
|
||||
---
|
||||
|
||||
### Level 4: Full Suite (Major changes/releases)
|
||||
|
||||
```bash
|
||||
./devops/scripts/local-ci.sh full
|
||||
```
|
||||
|
||||
**Time:** ~45 minutes
|
||||
**Validates:** All categories including Performance, Benchmark, AirGap, Chaos
|
||||
|
||||
---
|
||||
|
||||
## Quick Commands
|
||||
|
||||
| Purpose | Command |
|
||||
|---------|---------|
|
||||
| Smoke test | `./devops/scripts/local-ci.sh smoke` |
|
||||
| PR check | `./devops/scripts/local-ci.sh pr` |
|
||||
| Module tests | `./devops/scripts/local-ci.sh module --module Scanner` |
|
||||
| Single category | `./devops/scripts/local-ci.sh pr --category Unit` |
|
||||
| Verbose output | `./devops/scripts/local-ci.sh pr --verbose` |
|
||||
| Dry run | `./devops/scripts/local-ci.sh pr --dry-run` |
|
||||
| Release check | `./devops/scripts/local-ci.sh release --dry-run` |
|
||||
|
||||
---
|
||||
|
||||
## Windows (PowerShell)
|
||||
|
||||
```powershell
|
||||
.\devops\scripts\local-ci.ps1 smoke
|
||||
.\devops\scripts\local-ci.ps1 pr
|
||||
.\devops\scripts\local-ci.ps1 module -Module Scanner
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Service Management
|
||||
|
||||
```bash
|
||||
# Start
|
||||
docker compose -f devops/compose/docker-compose.ci.yaml up -d
|
||||
|
||||
# Stop
|
||||
docker compose -f devops/compose/docker-compose.ci.yaml down
|
||||
|
||||
# Reset
|
||||
docker compose -f devops/compose/docker-compose.ci.yaml down -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Test Categories
|
||||
|
||||
| Category | When Required |
|
||||
|----------|---------------|
|
||||
| **Unit** | Always |
|
||||
| **Architecture** | PR-gating |
|
||||
| **Contract** | API changes |
|
||||
| **Integration** | Database/service changes |
|
||||
| **Security** | Any code changes |
|
||||
| **Golden** | Output format changes |
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Build fails
|
||||
```bash
|
||||
dotnet clean src/StellaOps.sln
|
||||
dotnet build src/StellaOps.sln
|
||||
```
|
||||
|
||||
### Tests fail
|
||||
```bash
|
||||
./devops/scripts/local-ci.sh pr --verbose
|
||||
cat out/local-ci/logs/Unit-*.log
|
||||
```
|
||||
|
||||
### Services won't start
|
||||
```bash
|
||||
docker compose -f devops/compose/docker-compose.ci.yaml down -v
|
||||
docker compose -f devops/compose/docker-compose.ci.yaml up -d
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Checklist
|
||||
|
||||
**Before every commit:**
|
||||
- [ ] `./devops/scripts/local-ci.sh smoke` passes
|
||||
|
||||
**Before opening PR:**
|
||||
- [ ] `./devops/scripts/local-ci.sh pr` passes
|
||||
- [ ] `git status` shows only intended changes
|
||||
|
||||
**Before release:**
|
||||
- [ ] `./devops/scripts/local-ci.sh full` passes
|
||||
- [ ] `./devops/scripts/local-ci.sh release --dry-run` succeeds
|
||||
|
||||
---
|
||||
|
||||
## Results Location
|
||||
|
||||
```
|
||||
out/local-ci/
|
||||
trx/ # Test reports (TRX format)
|
||||
logs/ # Execution logs
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user