|
| 1 | +--- |
| 2 | +title: "K8s Playgrounds - Task Master PRD" |
| 3 | +version: 1.0 |
| 4 | +owner: "Testing/Platform Team" |
| 5 | +sprint: |
| 6 | + name: "Comprehensive Testing Implementation" |
| 7 | + start: "2025-10-20" |
| 8 | + end: "2025-11-28" |
| 9 | +task_master: |
| 10 | + schema: "v1" |
| 11 | + parse_instructions: |
| 12 | + - "Parse phases[].tasks[] to build the task graph." |
| 13 | + - "A task is runnable when status == 'todo' and all dependencies are 'done'." |
| 14 | + - "Use id as the canonical handle; titles may change." |
| 15 | + - "Prefer assignee if present; otherwise default to team: Testing/Platform." |
| 16 | + - "When commands are provided, run them non-interactively from repo root." |
| 17 | + - "Artifacts should be written to the paths listed under deliverables." |
| 18 | + default_shell: "/usr/bin/bash" |
| 19 | + working_directory: "/home/calelin/dev/k8s-playgrounds" |
| 20 | + reporting: |
| 21 | + summary_file: "test-reports/test_summary.txt" |
| 22 | + junit_report: "test-reports/test_report.xml" |
| 23 | + coverage_html: "coverage/index.html" |
| 24 | + coverage_json: "coverage/coverage-final.json" |
| 25 | +--- |
| 26 | + |
| 27 | +# Product Requirements Document (PRD) |
| 28 | +## Comprehensive Testing, Coverage, and CI/CD Enablement |
| 29 | + |
| 30 | +This PRD defines the executable plan for Task Master to orchestrate the testing and CI/CD work. It mirrors and operationalizes the goals captured in `docs/TASK_MASTER.md` and `docs/TESTING_PRD.md`. |
| 31 | + |
| 32 | +## Goals and Success Criteria |
| 33 | +- 100% unit test coverage across backend services and controllers |
| 34 | +- 100% integration test coverage for system interactions |
| 35 | +- Performance benchmarks established and tracked |
| 36 | +- CI/CD pipeline executes tests and reports on every commit |
| 37 | +- Zero ESLint and TypeScript errors in main |
| 38 | + |
| 39 | +## Global Deliverables |
| 40 | +- `test-reports/` with JUnit, HTML, and JSON summaries |
| 41 | +- `coverage/` with v8 provider outputs (text, HTML, JSON) |
| 42 | +- GitHub Actions workflow file for CI execution |
| 43 | + |
| 44 | +## Phases |
| 45 | + |
| 46 | +### Phase 1: Foundation Setup |
| 47 | +status: done |
| 48 | +owner: "Testing/Platform Team" |
| 49 | +deliverables: |
| 50 | + - "vitest.config.ts" |
| 51 | + - "test/setup.ts" |
| 52 | + - "test/utils/" |
| 53 | +success_criteria: |
| 54 | + - "Test runner configured with v8 coverage provider" |
| 55 | + - "Global setup file executes without errors" |
| 56 | +tasks: |
| 57 | + - id: TFN-001 |
| 58 | + title: "Verify Vitest configuration and coverage thresholds" |
| 59 | + status: done |
| 60 | + type: verify |
| 61 | + paths: |
| 62 | + - "vitest.config.ts" |
| 63 | + acceptance_criteria: |
| 64 | + - "Coverage thresholds present and >= 100 for statements/branches/functions/lines" |
| 65 | + |
| 66 | +### Phase 2: Unit Tests Completion |
| 67 | +status: in_progress |
| 68 | +owner: "Testing/Platform Team" |
| 69 | +deliverables: |
| 70 | + - "coverage/" |
| 71 | + - "test-reports/" |
| 72 | +success_criteria: |
| 73 | + - "All unit tests passing" |
| 74 | + - "Coverage 100% for lines, branches, functions, statements" |
| 75 | +tasks: |
| 76 | + - id: UTS-001 |
| 77 | + title: "Run backend unit tests with coverage" |
| 78 | + status: todo |
| 79 | + type: command |
| 80 | + assignee: "CI" |
| 81 | + commands: |
| 82 | + - "pnpm test:backend -- --coverage --reporter=junit --reporter=verbose" |
| 83 | + artifacts: |
| 84 | + - "coverage/" |
| 85 | + - "test-reports/" |
| 86 | + acceptance_criteria: |
| 87 | + - "Command exits 0" |
| 88 | + - "Coverage JSON file exists at coverage/coverage-final.json" |
| 89 | + - "JUnit file exists at test-reports/test_report.xml" |
| 90 | + |
| 91 | + - id: UTS-002 |
| 92 | + title: "Ensure 100% coverage across backend services/controllers" |
| 93 | + status: todo |
| 94 | + type: verify |
| 95 | + dependencies: |
| 96 | + - UTS-001 |
| 97 | + verifier: |
| 98 | + kind: coverage |
| 99 | + path: "coverage/coverage-final.json" |
| 100 | + thresholds: |
| 101 | + statements: 100 |
| 102 | + branches: 100 |
| 103 | + functions: 100 |
| 104 | + lines: 100 |
| 105 | + acceptance_criteria: |
| 106 | + - "All thresholds >= 100" |
| 107 | + |
| 108 | +### Phase 3: Integration Tests |
| 109 | +status: todo |
| 110 | +owner: "Testing/Platform Team" |
| 111 | +deliverables: |
| 112 | + - "test/integration/ results" |
| 113 | + - "test-reports/ integration JUnit" |
| 114 | +success_criteria: |
| 115 | + - "Integration tests implemented and green" |
| 116 | +tasks: |
| 117 | + - id: INT-001 |
| 118 | + title: "Run integration tests" |
| 119 | + status: todo |
| 120 | + type: command |
| 121 | + commands: |
| 122 | + - "pnpm test:integration -- --reporter=junit" |
| 123 | + artifacts: |
| 124 | + - "test-reports/" |
| 125 | + acceptance_criteria: |
| 126 | + - "Command exits 0" |
| 127 | + |
| 128 | +### Phase 4: Performance Benchmarks |
| 129 | +status: todo |
| 130 | +owner: "Testing/Platform Team" |
| 131 | +deliverables: |
| 132 | + - "test/performance/benchmarks results" |
| 133 | +success_criteria: |
| 134 | + - "Benchmarks captured and stored under reports" |
| 135 | +tasks: |
| 136 | + - id: PERF-001 |
| 137 | + title: "Execute performance benchmarks" |
| 138 | + status: todo |
| 139 | + type: command |
| 140 | + commands: |
| 141 | + - "pnpm test:performance" |
| 142 | + acceptance_criteria: |
| 143 | + - "Command exits 0" |
| 144 | + |
| 145 | +### Phase 5: CI/CD Pipeline |
| 146 | +status: todo |
| 147 | +owner: "DevOps Team" |
| 148 | +deliverables: |
| 149 | + - ".github/workflows/ci.yml" |
| 150 | + - "badges in README.md" |
| 151 | +success_criteria: |
| 152 | + - "CI runs unit, integration, and performance tests on pushes and PRs" |
| 153 | +tasks: |
| 154 | + - id: CI-001 |
| 155 | + title: "Add GitHub Actions workflow for tests and coverage upload" |
| 156 | + status: todo |
| 157 | + type: file_create |
| 158 | + path: ".github/workflows/ci.yml" |
| 159 | + template: | |
| 160 | + name: CI |
| 161 | + on: |
| 162 | + push: |
| 163 | + branches: [ main ] |
| 164 | + pull_request: |
| 165 | + branches: [ main ] |
| 166 | + jobs: |
| 167 | + test: |
| 168 | + runs-on: ubuntu-latest |
| 169 | + steps: |
| 170 | + - uses: actions/checkout@v4 |
| 171 | + - uses: actions/setup-node@v4 |
| 172 | + with: |
| 173 | + node-version: '20' |
| 174 | + - run: pnpm install --frozen-lockfile |
| 175 | + - run: pnpm test:backend -- --coverage --reporter=junit || true |
| 176 | + - run: pnpm test:integration -- --reporter=junit || true |
| 177 | + - run: pnpm test:performance || true |
| 178 | + - name: Upload coverage artifact |
| 179 | + uses: actions/upload-artifact@v4 |
| 180 | + with: |
| 181 | + name: coverage |
| 182 | + path: coverage |
| 183 | + - name: Upload test reports |
| 184 | + uses: actions/upload-artifact@v4 |
| 185 | + with: |
| 186 | + name: test-reports |
| 187 | + path: test-reports |
| 188 | + acceptance_criteria: |
| 189 | + - ".github/workflows/ci.yml is created and valid YAML" |
| 190 | + |
| 191 | + - id: CI-002 |
| 192 | + title: "Add coverage and test badges to README" |
| 193 | + status: todo |
| 194 | + type: file_update |
| 195 | + paths: |
| 196 | + - "README.md" |
| 197 | + acceptance_criteria: |
| 198 | + - "Badges rendered at top of README" |
| 199 | + |
| 200 | +## Risks and Blockers |
| 201 | +- Typeahead system: case sensitivity and debouncing issues |
| 202 | +- Web crawler system: content extraction and filtering problems |
| 203 | + |
| 204 | +## Start Here (for Task Master) |
| 205 | +1. Queue tasks in this order respecting dependencies: UTS-001 → UTS-002 → INT-001 → PERF-001 → CI-001 → CI-002. |
| 206 | +2. Execute command-type tasks in a non-interactive shell from the repo root. |
| 207 | +3. Persist artifacts to paths listed in each task. |
| 208 | +4. Mark tasks as done when acceptance criteria are satisfied. |
| 209 | + |
| 210 | +## References |
| 211 | +- `docs/TASK_MASTER.md` |
| 212 | +- `docs/TESTING_PRD.md` |
| 213 | +- `PRD.md` |
| 214 | + |
| 215 | + |
0 commit comments