Files
git.stella-ops.org/docs/testing/README.md

169 lines
5.4 KiB
Markdown

# Testing Documentation
> Comprehensive guides for testing StellaOps before and during development.
---
## Quick Start
### Before Committing
```bash
# Quick smoke test (~2 min)
./devops/scripts/validate-before-commit.sh quick
# Full PR validation (~15 min)
./devops/scripts/validate-before-commit.sh
# Windows
.\devops\scripts\validate-before-commit.ps1
```
See [PRE_COMMIT_CHECKLIST.md](PRE_COMMIT_CHECKLIST.md) for the validation checklist.
---
## Documentation Index
### Local Testing
| Document | Description |
|----------|-------------|
| [LOCAL_CI_GUIDE.md](LOCAL_CI_GUIDE.md) | Complete guide to local CI testing |
| [PRE_COMMIT_CHECKLIST.md](PRE_COMMIT_CHECKLIST.md) | Quick checklist for pre-commit validation |
### Testing Strategy
| Document | Description |
|----------|-------------|
| [TESTING_MASTER_PLAN.md](TESTING_MASTER_PLAN.md) | Overall testing strategy and goals |
| [testing-strategy-models.md](testing-strategy-models.md) | Testing strategy models and approaches |
| [TEST_COVERAGE_MATRIX.md](TEST_COVERAGE_MATRIX.md) | Coverage matrix by module and category |
| [testkit-usage-guide.md](testkit-usage-guide.md) | Guide to using the StellaOps TestKit |
### CI/CD Integration
| Document | Description |
|----------|-------------|
| [ci-quality-gates.md](ci-quality-gates.md) | Quality gates for CI/CD pipelines |
| [ci-lane-filters.md](ci-lane-filters.md) | Test lane filter configuration |
| [ci-lane-integration.md](ci-lane-integration.md) | CI lane integration guide |
### Specialized Testing
| Document | Description |
|----------|-------------|
| [determinism-gates.md](determinism-gates.md) | Determinism verification gates |
| [determinism-verification.md](determinism-verification.md) | Determinism testing guide |
| [security-testing-guide.md](security-testing-guide.md) | Security testing practices |
| [mutation-testing-guide.md](mutation-testing-guide.md) | Mutation testing guide |
| [mutation-testing-baselines.md](mutation-testing-baselines.md) | Mutation testing baselines |
| [e2e-reproducibility.md](e2e-reproducibility.md) | End-to-end reproducibility testing |
| [competitor-parity-testing.md](competitor-parity-testing.md) | Competitive parity testing |
### Component-Specific
| Document | Description |
|----------|-------------|
| [webservice-test-discipline.md](webservice-test-discipline.md) | Web service testing discipline |
| [webservice-test-rollout-plan.md](webservice-test-rollout-plan.md) | Web service test rollout plan |
| [connector-fixture-discipline.md](connector-fixture-discipline.md) | Connector fixture testing |
| [schema-validation.md](schema-validation.md) | Schema validation testing |
### Sprint Planning
| Document | Description |
|----------|-------------|
| [SPRINT_DEPENDENCY_GRAPH.md](SPRINT_DEPENDENCY_GRAPH.md) | Sprint dependency visualization |
| [SPRINT_EXECUTION_PLAYBOOK.md](SPRINT_EXECUTION_PLAYBOOK.md) | Sprint execution guide |
| [testing-quality-guardrails-implementation.md](testing-quality-guardrails-implementation.md) | Quality guardrails implementation |
---
## Test Categories
| Category | Description | When Run |
|----------|-------------|----------|
| **Unit** | Component isolation tests | Always |
| **Architecture** | Dependency and layering rules | PR-gating |
| **Contract** | API compatibility validation | PR-gating |
| **Integration** | Database and service tests | PR-gating |
| **Security** | Security assertion tests | PR-gating |
| **Golden** | Corpus-based regression tests | PR-gating |
| **Performance** | Latency and throughput tests | Extended |
| **Benchmark** | BenchmarkDotNet runs | Extended |
| **Determinism** | Reproducibility tests | Extended |
| **AirGap** | Offline operation tests | Extended |
| **Chaos** | Resilience tests | Extended |
---
## Quick Commands
```bash
# Local CI runner
./devops/scripts/local-ci.sh smoke # Quick validation
./devops/scripts/local-ci.sh pr # PR-gating suite
./devops/scripts/local-ci.sh module # Module tests
./devops/scripts/local-ci.sh full # All tests
# Pre-commit validation
./devops/scripts/validate-before-commit.sh # PR-gating
./devops/scripts/validate-before-commit.sh quick # Smoke only
./devops/scripts/validate-before-commit.sh full # Everything
# Web/Angular tests
./devops/scripts/local-ci.sh module --module Web # Web module tests
./devops/scripts/local-ci.sh pr --category Web # Web as part of PR
# Service management
docker compose -f devops/compose/docker-compose.ci.yaml up -d
docker compose -f devops/compose/docker-compose.ci.yaml down
```
---
## Web/Angular Testing
The Angular frontend (`src/Web/StellaOps.Web`) has its own test suite:
```bash
cd src/Web/StellaOps.Web
# Install dependencies
npm ci
# Unit tests (Karma/Jasmine)
npm run test:ci
# E2E tests (Playwright)
npx playwright install --with-deps chromium
npm run test:e2e
# Accessibility tests (Axe)
npm run test:a11y
# Production build
npm run build -- --configuration production
# Storybook build
npm run storybook:build
```
| Test Type | Framework | Command | Duration |
|-----------|-----------|---------|----------|
| Unit | Karma/Jasmine | `npm run test:ci` | ~3 min |
| E2E | Playwright | `npm run test:e2e` | ~5 min |
| A11y | Axe-core | `npm run test:a11y` | ~2 min |
| Build | Angular CLI | `npm run build` | ~2 min |
---
## Related Documentation
- [CI/CD Overview](../cicd/README.md)
- [Workflow Triggers](../cicd/workflow-triggers.md)
- [Path Filters](../cicd/path-filters.md)
- [Test Infrastructure](../../src/__Tests/AGENTS.md)