@educa-corp/sdd-framework 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build.js +113 -19
- package/bin/gate-trace.js +487 -0
- package/bin/index.js +445 -146
- package/bin/lint-trace.js +643 -0
- package/bin/self-check.js +804 -2
- package/bin/trace-schema.json +621 -10
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/README.md +20 -0
- package/core/commands/amend-prd.md +518 -0
- package/core/commands/debug.md +123 -511
- package/core/commands/define-product.md +86 -510
- package/core/commands/dev-gen-test.md +86 -510
- package/core/commands/dev-run-test.md +133 -519
- package/core/commands/dev-smoke-test.md +86 -510
- package/core/commands/extend-prd.md +128 -522
- package/core/commands/fix-bug.md +118 -509
- package/core/commands/generate-architecture.md +94 -515
- package/core/commands/generate-bdd.md +128 -513
- package/core/commands/generate-code.md +119 -510
- package/core/commands/generate-design-spec.md +86 -510
- package/core/commands/generate-prd.md +89 -510
- package/core/commands/generate-spec-manifest.md +86 -510
- package/core/commands/generate-tech-docs.md +120 -512
- package/core/commands/learn.md +172 -496
- package/core/commands/map-testids.md +86 -510
- package/core/commands/propose-scenario.md +86 -510
- package/core/commands/qc-analyze.md +86 -510
- package/core/commands/qc-design-test.md +86 -510
- package/core/commands/qc-plan.md +86 -510
- package/core/commands/qc-report.md +86 -510
- package/core/commands/qc-review.md +86 -510
- package/core/commands/qc-run-test.md +115 -513
- package/core/commands/refine-prd.md +112 -522
- package/core/commands/report-bug.md +86 -510
- package/core/commands/review-code.md +123 -511
- package/core/commands/review-context.md +136 -522
- package/core/commands/review-tech-docs.md +90 -511
- package/core/commands/setup-ai-first.md +166 -138
- package/core/commands/sync.md +155 -107
- package/core/commands/update-framework.md +16 -103
- package/core/commands/validate-traces.md +426 -511
- package/core/hooks/data-guard.js +174 -83
- package/core/hooks/settings.json +2 -1
- package/core/rules/workflow.md +64 -4
- package/core/steps/capture-lesson.md +34 -1
- package/core/steps/context-loader.md +50 -8
- package/core/steps/gate.md +92 -35
- package/core/steps/report-footer.md +23 -0
- package/core/templates/README.md +24 -1
- package/core/templates/ci/trace-gate.yml +146 -0
- package/core/templates/feature.template +1 -1
- package/core/templates/hooks/pre-push +61 -0
- package/docs/02-concepts/architecture.md +61 -6
- package/docs/02-concepts/traceability.md +57 -0
- package/docs/03-guides/architect.md +63 -0
- package/docs/04-reference/commands.md +148 -134
- package/docs/04-reference/model-selection.md +32 -19
- package/docs/04-reference/trace-schema.md +39 -0
- package/docs/explain/02b-extend-prd.md +1 -1
- package/docs/explain/02c-amend-prd.md +152 -0
- package/docs/explain/21-validate-traces.md +2 -1
- package/docs/explain/27-learn.md +5 -3
- package/docs/explain/28-sync.md +25 -0
- package/docs/explain/README.md +136 -135
- package/package.json +5 -9
- package/commands/debug.md +0 -917
- package/commands/debug.tmpl +0 -257
- package/commands/define-product.md +0 -862
- package/commands/define-product.tmpl +0 -225
- package/commands/dev-gen-test.md +0 -1124
- package/commands/dev-gen-test.tmpl +0 -490
- package/commands/dev-run-test.md +0 -859
- package/commands/dev-run-test.tmpl +0 -225
- package/commands/dev-smoke-test.md +0 -798
- package/commands/dev-smoke-test.tmpl +0 -217
- package/commands/extend-prd.md +0 -907
- package/commands/extend-prd.tmpl +0 -270
- package/commands/fix-bug.md +0 -910
- package/commands/fix-bug.tmpl +0 -197
- package/commands/generate-architecture.md +0 -775
- package/commands/generate-architecture.tmpl +0 -194
- package/commands/generate-bdd.md +0 -1347
- package/commands/generate-bdd.tmpl +0 -590
- package/commands/generate-code.md +0 -1283
- package/commands/generate-code.tmpl +0 -649
- package/commands/generate-design-spec.md +0 -1161
- package/commands/generate-design-spec.tmpl +0 -524
- package/commands/generate-prd.md +0 -1143
- package/commands/generate-prd.tmpl +0 -223
- package/commands/generate-spec-manifest.md +0 -745
- package/commands/generate-spec-manifest.tmpl +0 -164
- package/commands/generate-tech-docs.md +0 -1344
- package/commands/generate-tech-docs.tmpl +0 -273
- package/commands/learn.md +0 -723
- package/commands/learn.tmpl +0 -63
- package/commands/map-testids.md +0 -662
- package/commands/map-testids.tmpl +0 -81
- package/commands/propose-scenario.md +0 -783
- package/commands/propose-scenario.tmpl +0 -202
- package/commands/qc-analyze.md +0 -693
- package/commands/qc-analyze.tmpl +0 -112
- package/commands/qc-design-test.md +0 -650
- package/commands/qc-design-test.tmpl +0 -69
- package/commands/qc-plan.md +0 -630
- package/commands/qc-plan.tmpl +0 -49
- package/commands/qc-report.md +0 -641
- package/commands/qc-report.tmpl +0 -60
- package/commands/qc-review.md +0 -634
- package/commands/qc-review.tmpl +0 -53
- package/commands/qc-run-test.md +0 -750
- package/commands/qc-run-test.tmpl +0 -116
- package/commands/refine-prd.md +0 -1074
- package/commands/refine-prd.tmpl +0 -278
- package/commands/report-bug.md +0 -729
- package/commands/report-bug.tmpl +0 -148
- package/commands/review-code.md +0 -803
- package/commands/review-code.tmpl +0 -143
- package/commands/review-context.md +0 -1323
- package/commands/review-context.tmpl +0 -527
- package/commands/review-tech-docs.md +0 -982
- package/commands/review-tech-docs.tmpl +0 -401
- package/commands/setup-ai-first.md +0 -574
- package/commands/setup-ai-first.tmpl +0 -378
- package/commands/sync.md +0 -486
- package/commands/sync.tmpl +0 -384
- package/commands/update-framework.md +0 -290
- package/commands/update-framework.tmpl +0 -188
- package/commands/validate-traces.md +0 -1435
- package/commands/validate-traces.tmpl +0 -854
- package/hooks/data-guard.js +0 -141
- package/hooks/settings.json +0 -18
- package/modules/android-compose/module.yaml +0 -13
- package/modules/android-compose/stack-profile.yaml +0 -57
- package/modules/angular/architecture-snippets/component-patterns.md +0 -187
- package/modules/angular/module.yaml +0 -6
- package/modules/angular/stack-profile.yaml +0 -38
- package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
- package/modules/context-engineering/module.yaml +0 -9
- package/modules/context-engineering/stack-profile.yaml +0 -61
- package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
- package/modules/dotnet/module.yaml +0 -6
- package/modules/dotnet/stack-profile.yaml +0 -50
- package/modules/flutter/module.yaml +0 -14
- package/modules/flutter/stack-profile.yaml +0 -59
- package/modules/golang/architecture-snippets/domain-layout.md +0 -283
- package/modules/golang/module.yaml +0 -6
- package/modules/golang/stack-profile.yaml +0 -40
- package/modules/ios-swiftui/module.yaml +0 -13
- package/modules/ios-swiftui/stack-profile.yaml +0 -55
- package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
- package/modules/java-spring/module.yaml +0 -15
- package/modules/java-spring/stack-profile.yaml +0 -28
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
- package/modules/nextjs/module.yaml +0 -14
- package/modules/nextjs/stack-profile.yaml +0 -74
- package/modules/nuxt/module.yaml +0 -14
- package/modules/nuxt/stack-profile.yaml +0 -58
- package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
- package/modules/phaser-game/module.yaml +0 -15
- package/modules/phaser-game/stack-profile.yaml +0 -90
- package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
- package/modules/php-laravel/module.yaml +0 -15
- package/modules/php-laravel/stack-profile.yaml +0 -56
- package/modules/qc-playwright/stack-profile.yaml +0 -66
- package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
- package/modules/react/module.yaml +0 -14
- package/modules/react/stack-profile.yaml +0 -63
- package/modules/react-native/module.yaml +0 -14
- package/modules/react-native/stack-profile.yaml +0 -56
- package/modules/vue/module.yaml +0 -14
- package/modules/vue/stack-profile.yaml +0 -65
- package/rules/data-protection.md +0 -80
- package/rules/workflow.md +0 -73
- package/scripts/init.sh +0 -49
- package/scripts/upgrade.sh +0 -94
- package/skills/code/SKILL.md +0 -19
- package/skills/code/SKILL.tmpl +0 -19
- package/skills/debug/SKILL.md +0 -19
- package/skills/debug/SKILL.tmpl +0 -19
- package/skills/design-spec/SKILL.md +0 -11
- package/skills/design-spec/SKILL.tmpl +0 -11
- package/skills/discovery/SKILL.md +0 -14
- package/skills/discovery/SKILL.tmpl +0 -14
- package/skills/prd/SKILL.md +0 -19
- package/skills/prd/SKILL.tmpl +0 -19
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
- package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
- package/skills/qc/qa-analyst/business-rules.md +0 -59
- package/skills/qc/qa-analyst/data-flow.md +0 -64
- package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
- package/skills/qc/qa-designer/e2e/journey.md +0 -41
- package/skills/qc/qa-designer/exploratory/charter.md +0 -68
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
- package/skills/qc/qa-designer/functional/api.md +0 -45
- package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
- package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
- package/skills/qc/qa-designer/integration/api.md +0 -42
- package/skills/qc/qa-designer/integration/db.md +0 -39
- package/skills/qc/qa-designer/integration/gui.md +0 -40
- package/skills/qc/qa-designer/integration/kafka.md +0 -40
- package/skills/qc/qa-designer/non-functional.md +0 -40
- package/skills/qc/qa-planner/test-plan.md +0 -120
- package/skills/qc/qa-reviewer/script/e2e.md +0 -87
- package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
- package/skills/qc/qa-reviewer/script/functional.md +0 -101
- package/skills/qc/qa-reviewer/script/integration.md +0 -91
- package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
- package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
- package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
- package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
- package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
- package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
- package/skills/qc/qa-runner/e2e.md +0 -49
- package/skills/qc/qa-runner/exploratory/session.md +0 -36
- package/skills/qc/qa-runner/functional/api.md +0 -35
- package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
- package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
- package/skills/qc/qa-runner/integration.md +0 -47
- package/skills/qc/qa-runner/non-functional.md +0 -49
- package/skills/qc/qa-runner/report/report.md +0 -37
- package/skills/setup-ai-first/SKILL.md +0 -19
- package/skills/setup-ai-first/SKILL.tmpl +0 -19
- package/skills/spec/SKILL.md +0 -19
- package/skills/spec/SKILL.tmpl +0 -19
- package/skills/test/SKILL.md +0 -18
- package/skills/test/SKILL.tmpl +0 -18
- package/steps/business-language.md +0 -56
- package/steps/capture-lesson.md +0 -79
- package/steps/context-loader.md +0 -385
- package/steps/gate.md +0 -94
- package/steps/report-footer.md +0 -102
- package/steps/review-fanout.md +0 -159
- package/steps/spawn-agent.md +0 -129
- package/steps/trace-mirror.md +0 -53
- package/templates/README.md +0 -47
- package/templates/architecture.template.md +0 -394
- package/templates/design-spec.template.md +0 -217
- package/templates/feature.template +0 -123
- package/templates/platform-guide.template.md +0 -145
- package/templates/prd.template.md +0 -283
- package/templates/product-definition.template.md +0 -188
- package/templates/project-context.yaml +0 -212
- package/templates/tech-design.template.md +0 -490
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
# /dev-run-test — Chạy Dev Self-Check Tests & Report kết quả
|
|
2
|
-
|
|
3
|
-
> **Scope — dev self-check (smoke), không phải bộ test chính thức.** Chạy các test do
|
|
4
|
-
> `/dev-gen-test` sinh ra để dev xác nhận code mình chạy được trước khi review. Đây là một
|
|
5
|
-
> self-check của dev, **không** phải lần chạy test authoritative của QC/dev-team (flow riêng).
|
|
6
|
-
> Pass/fail được publish lên Living Docs như tín hiệu **dev self-test** — nó cho QC biết
|
|
7
|
-
> dev đã chạy check của họ; KHÔNG phải tuyên bố về độ phủ test chính thức.
|
|
8
|
-
|
|
9
|
-
## Gate
|
|
10
|
-
{{include:steps/gate.md}}
|
|
11
|
-
|
|
12
|
-
*Lưu ý: Với lệnh này, target ở Bước 1 là một UC-ID hoặc tên service. Context loading cung cấp `conventions.test_command` và `tech_stack.module`.*
|
|
13
|
-
|
|
14
|
-
## Context
|
|
15
|
-
{{include:steps/context-loader.md}}
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Service Detection
|
|
20
|
-
|
|
21
|
-
Đọc `active_module` từ context (đã phân giải ở context-loader Bước 1).
|
|
22
|
-
Dùng nó để chọn đúng lệnh chạy và bảng phân tích lỗi bên dưới.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Submodule Working Directory
|
|
27
|
-
|
|
28
|
-
*Bỏ qua section này nếu `service_root` chưa được set (single-service mode).*
|
|
29
|
-
|
|
30
|
-
Khi chạy ở **umbrella/submodule mode** (`service_root` được phân giải ở context-loader Bước 1.6):
|
|
31
|
-
|
|
32
|
-
- Mọi lệnh trong section **Run** bên dưới phải thực thi từ trong `{service_root}/`
|
|
33
|
-
- `conventions.test_command` được nạp từ `{service_root}/.agent/project-context.yaml` — đã riêng theo service
|
|
34
|
-
- Prefix mọi lệnh shell bằng `cd {service_root} &&`:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
cd {service_root}
|
|
38
|
-
|
|
39
|
-
# Then run any of the commands in the Run section below, e.g.:
|
|
40
|
-
{conventions.test_command}
|
|
41
|
-
mvn test -Dtest={ClassName} # java-spring
|
|
42
|
-
go test ./... -run Test{FunctionName} # golang
|
|
43
|
-
npx vitest run src/... # web-frontend
|
|
44
|
-
flutter test test/{domain}/... # flutter
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
> **Vì sao cd?** Session Claude Code mở ở umbrella root. Mỗi service submodule có build tool, test runner, và cây dependency riêng — test phải chạy từ trong thư mục service.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Run
|
|
52
|
-
|
|
53
|
-
### Nếu `platform_type = backend`
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Run all tests for this UC
|
|
57
|
-
{conventions.test_command}
|
|
58
|
-
|
|
59
|
-
# Scoped to specific class (faster feedback)
|
|
60
|
-
# java-spring:
|
|
61
|
-
mvn test -Dtest={ClassName}
|
|
62
|
-
# golang:
|
|
63
|
-
go test ./... -run Test{FunctionName}
|
|
64
|
-
# dotnet:
|
|
65
|
-
dotnet test --filter "FullyQualifiedName~{ClassName}"
|
|
66
|
-
# php-laravel:
|
|
67
|
-
php artisan test --filter {ClassName}
|
|
68
|
-
# context-engineering (pytest):
|
|
69
|
-
pytest tests/{domain}/{test_file}.py -v
|
|
70
|
-
pytest tests/{domain}/{test_file}.py::{TestClass}::{test_method} -v
|
|
71
|
-
pytest tests/ --cov={source_dir} --cov-report=term-missing
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Nếu `platform_type = web-frontend`
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Run all tests
|
|
78
|
-
{conventions.test_command}
|
|
79
|
-
|
|
80
|
-
# Scoped (Vitest / Jest):
|
|
81
|
-
npx vitest run src/features/{domain}/{Component}.test.tsx
|
|
82
|
-
npx jest src/features/{domain}/{Component}.test.tsx
|
|
83
|
-
|
|
84
|
-
# E2E (Playwright):
|
|
85
|
-
npx playwright test {UC-ID}
|
|
86
|
-
# E2E (Cypress):
|
|
87
|
-
npx cypress run --spec "cypress/e2e/{UC-ID}*"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Nếu `platform_type = mobile`
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
# Flutter:
|
|
94
|
-
flutter test test/{domain}/{UC-ID}_test.dart
|
|
95
|
-
flutter test integration_test/{UC-ID}_test.dart # integration
|
|
96
|
-
|
|
97
|
-
# React Native:
|
|
98
|
-
npx jest {UC-ID}
|
|
99
|
-
|
|
100
|
-
# iOS (Xcode command line):
|
|
101
|
-
xcodebuild test -scheme {Scheme} -destination 'platform=iOS Simulator,name=iPhone 15'
|
|
102
|
-
|
|
103
|
-
# Android:
|
|
104
|
-
./gradlew test # unit tests
|
|
105
|
-
./gradlew connectedAndroidTest # instrumented (device/emulator required)
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
> **Lưu ý cho Android instrumented test:** cần một emulator đang chạy hoặc device kết nối trước khi chạy `connectedAndroidTest`. Khởi động qua Android Studio hoặc: `emulator -avd {AVD_NAME} &`
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Analyze Failures
|
|
113
|
-
|
|
114
|
-
### Backend failure patterns
|
|
115
|
-
|
|
116
|
-
#### java-spring / golang / dotnet / php-laravel
|
|
117
|
-
|
|
118
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
119
|
-
|---|---|---|
|
|
120
|
-
| `NullPointerException` | Thiếu setup mock | Kiểm tra `given(...)`/`coEvery`/`mockk` cho dependency null |
|
|
121
|
-
| `Bean not found` | Thiếu khai báo mock | Thêm `@MockBean` / inject mock |
|
|
122
|
-
| `Expected 200, got 401` | Thiếu setup auth | Thêm auth token/user vào test context |
|
|
123
|
-
| `Expected 200, got 400` | Request body fail validation | Kiểm tra field bắt buộc trong DTO |
|
|
124
|
-
| `Expected 200, got 403` | Sai role | Thêm đúng role cho test user |
|
|
125
|
-
| `LazyInitializationException` | Lazy collection ngoài transaction | Thêm `@Transactional` hoặc eager fetch |
|
|
126
|
-
| `Mapper not found` | Code chưa compile | Chạy build trước khi test |
|
|
127
|
-
| `DataIntegrityViolationException` | Trùng key trong DB setup | Dùng `@Transactional` + rollback, hoặc clean DB giữa các test |
|
|
128
|
-
| Assertion mismatch | Sai giá trị mock return | Đọc lại setup `given(...).willReturn(...)` |
|
|
129
|
-
|
|
130
|
-
#### context-engineering (AI/LLM pipelines)
|
|
131
|
-
|
|
132
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
133
|
-
|---|---|---|
|
|
134
|
-
| `AssertionError` trên output mock LLM | Giá trị mock return không khớp schema | Kiểm tra lại setup `mock_llm.return_value` / `mock_llm.complete.return_value` |
|
|
135
|
-
| `ValidationError` trên response | Cấu trúc output LLM không khớp schema kỳ vọng | Siết schema check hoặc thêm retry logic trong test |
|
|
136
|
-
| `ConnectionError` / `APIError` | LLM API thật bị gọi trong test | Đảm bảo mock `patch('...')` được áp dụng — không bao giờ gọi LLM thật trong unit test |
|
|
137
|
-
| `TimeoutError` | Test gọi LLM endpoint live | Thêm mock; kiểm tra test fixture |
|
|
138
|
-
| Kết quả flaky / non-deterministic | Response LLM thật dùng trong assertion | Thay bằng giá trị mock return tất định |
|
|
139
|
-
|
|
140
|
-
### Web frontend failure patterns
|
|
141
|
-
|
|
142
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
143
|
-
|---|---|---|
|
|
144
|
-
| `Unable to find role "..."` | Element chưa render | Bọc trong `await waitFor(() => ...)` |
|
|
145
|
-
| `TestingLibraryElementError: Found multiple elements` | Selector quá rộng | Dùng `getByRole(..., { name: '...' })` để thu hẹp |
|
|
146
|
-
| `Network request not intercepted` | Thiếu MSW handler / `cy.intercept` | Thêm handler cho endpoint |
|
|
147
|
-
| `act(...)` warning | State update sau khi test kết thúc | Await async event / `await userEvent.click(...)` |
|
|
148
|
-
| `Cannot read properties of undefined` | Component render trước khi data load | Thêm loading state hoặc mock data đã resolve |
|
|
149
|
-
| Playwright timeout | Page chưa navigate / element ẩn | Kiểm tra route, thêm `waitForSelector` |
|
|
150
|
-
| `expect(page.locator(...)).toBeVisible` fail | Sai selector | Dùng Playwright Inspector để tìm đúng locator |
|
|
151
|
-
|
|
152
|
-
### Mobile failure patterns
|
|
153
|
-
|
|
154
|
-
#### Flutter
|
|
155
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
156
|
-
|---|---|---|
|
|
157
|
-
| `pumpAndSettle timed out` | Async operation chưa hoàn thành | Dùng `pump(Duration(...))` cho delay cụ thể |
|
|
158
|
-
| `No widget found` | Widget chưa render / sai finder | Kiểm tra `find.byType`, `find.text`, `find.byKey` |
|
|
159
|
-
| `setState called after dispose` | Widget bị dispose trước khi async xong | Cancel async trong `dispose()` |
|
|
160
|
-
| BLoC state mismatch | Sai event emit | Verify `mockBloc` nhận đúng event |
|
|
161
|
-
|
|
162
|
-
#### React Native
|
|
163
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
164
|
-
|---|---|---|
|
|
165
|
-
| `Unable to find element` | Thiếu `testID` hoặc sai query | Thêm `accessibilityLabel` hoặc `testID` vào component |
|
|
166
|
-
| `act(...)` warning | Async state update | Bọc trong `act(async () => { ... })` |
|
|
167
|
-
| Thiếu navigation mock | `useNavigation` chưa mock | Thêm jest mock cho `@react-navigation/native` |
|
|
168
|
-
|
|
169
|
-
#### iOS / Android
|
|
170
|
-
| Error Pattern | Nguyên nhân thường gặp | Suggested Fix |
|
|
171
|
-
|---|---|---|
|
|
172
|
-
| `XCTAssertEqual failed` | Sai giá trị kỳ vọng | Kiểm tra output ViewModel cho mock đã cho |
|
|
173
|
-
| `Compose node not found` | Sai `contentDescription` / `testTag` | Thêm `Modifier.testTag(...)` vào composable |
|
|
174
|
-
| `Hilt injection failed` | Thiếu test module | Thêm `@UninstallModules` + `@BindValue` trong test class |
|
|
175
|
-
| Emulator not available | `connectedAndroidTest` không có device | Khởi động emulator trước, chờ nó boot |
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Write Trace State
|
|
180
|
-
|
|
181
|
-
Sau khi chạy, lưu kết quả vào **TSV authoritative** trong service để chúng tới được
|
|
182
|
-
report Living Docs ở spec module (qua `/sync` + `/validate-traces`). Các file test
|
|
183
|
-
ở lại trong service — chỉ *status* của lần chạy được report.
|
|
184
|
-
|
|
185
|
-
Cập nhật **sổ của platform đang test** `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv` (`{platform}` = platform của code/`.feature` đang test — `system` cho backend, `web`/`app` cho FE/App; nếu `domain`/`prd_slug` không phân giải được từ spec target, định vị TSV bằng cách glob `{paths.trace_dir}/**/{UC-ID}-{platform}.tsv` — nó được tạo trước đó bởi `/generate-bdd`) — cho mỗi scenario row (khớp `sc_id` qua tag
|
|
186
|
-
`@trace.verifies={UC-ID}-SC{N}` của test). *(Umbrella + `spec_source`: `trace_dir` là `{spec_source}/.trace` — test chạy từ `service_root` nhưng update `dev_selftest` ghi vào **spec repo**; commit/push spec submodule cho nó.)*
|
|
187
|
-
|
|
188
|
-
| Cột | Giá trị |
|
|
189
|
-
|--------|-------|
|
|
190
|
-
| `dev_selftest` | `pass` nếu mọi test của SC này pass · `fail` nếu có cái fail · `not_run` nếu test của nó bị skip/vắng |
|
|
191
|
-
| `dev_selftest_at` | hôm nay `YYYY-MM-DD` |
|
|
192
|
-
| `last_updated` | hôm nay `YYYY-MM-DD` |
|
|
193
|
-
|
|
194
|
-
Giữ nguyên mọi cột khác — đặc biệt **không bao giờ** đụng `qc_status`/`qc_run_at`
|
|
195
|
-
(kết quả QC automation chính thức, do `/qc-run-test` sở hữu). `dev_selftest` (dev smoke)
|
|
196
|
-
và `qc_status` (QC chính thức) là hai tín hiệu riêng. `dev_selftest`/`dev_selftest_at` cũng
|
|
197
|
-
trực giao với `status` (OK/GAP/DRIFT/UNTRACKED/ORPHANED): `status` theo dõi *coverage*, `dev_selftest`
|
|
198
|
-
theo dõi *kết quả chạy* gần nhất của dev.
|
|
199
|
-
|
|
200
|
-
## Refresh Panel Mirror
|
|
201
|
-
{{include:steps/trace-mirror.md}}
|
|
202
|
-
|
|
203
|
-
## Output
|
|
204
|
-
|
|
205
|
-
{{include:steps/report-footer.md}}
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
/dev-run-test Report — {UC-ID} ({active_module})
|
|
209
|
-
✅ Passed: {N} | ❌ Failed: {M} | ⏭️ Skipped: {K} | Duration: {X}s
|
|
210
|
-
|
|
211
|
-
## Failed Tests
|
|
212
|
-
| Test | Error | Root Cause |
|
|
213
|
-
|------|-------|------------|
|
|
214
|
-
|
|
215
|
-
## Recommendations
|
|
216
|
-
{fix cụ thể cho từng failure}
|
|
217
|
-
|
|
218
|
-
Trace: {paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv updated (dev_selftest, dev_selftest_at)
|
|
219
|
-
|
|
220
|
-
Next:
|
|
221
|
-
Mọi test pass → /review-code {UC-ID}
|
|
222
|
-
Test fail → /fix-bug {TICKET_ID} (bug thật) hoặc fix test (sai expectation)
|
|
223
|
-
|
|
224
|
-
📊 Living Docs: chạy /validate-traces (hoặc /sync) để push trace này lên dashboard spec-module.
|
|
225
|
-
```
|