test(app): add the plugin contract runner and fixture replay - #184
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M1 PR 9b:插件契約執行器、fixture 錄製與重播、
checks.json(ADR 0015 §決定 4–6;擁有者決定 8)。做了什麼
meta。SourceHttpClient最底層的 dio adapter。***的欄位只要求存在,不比值。對不上,或有 fixture 沒被用到,都讓測試失敗。checks.json:鍵是能力名,格式本身就保證每個能力最多一條案例。期望寫成筆數、欄位非空,或AppError類別加原因。app/test/plugins/contract/。對任一插件目錄執行的指令是FMP_PLUGIN_DIR=<目錄> flutter test test/plugins/contract/contract_test.dart。斷言涵蓋:app/test/;fmp互相依賴;lib/會違反分層 lint。livetag,只給不需要登入的案例用;寫檔前一律經過遮蔽。checks.json的期望就整組不寫,原本的檔案不動。meta.edited標記的手寫 fixture 不會被重錄。app/內所有 fixture 都不得有未遮蔽的憑證。兩道檢查(重跑遮蔽函式、比對常見欄位)各自做過變異驗證。fmp-test補上checks.json;新增一個會發 HTTP 請求的fmp-test-http,網域是*.fmp.test,fixture 手寫。flutter test內,ci.yml只補註解說明。驗證
dart format、dart analyze --fatal-infos、flutter analyze:零問題。flutter test:516 個通過,2 個跳過(都是live);test/plugins連跑兩次都穩定。app/外的插件目錄實際跑過,路徑用 Windows 反斜線、含空格也試過:7 個通過。flutter test卡在 loading 階段,之後依序重跑 14 次都沒重現,已記進後續待辦。沒有使用者看得到的改動,不需要實機驗證。
Review 指南
contract_runner.dart(_execute、recordContract)和fixture_adapters.dart(重播比對、錄製遮蔽)。contract_runner_test.dart是每條規則的雙向變異測試。fmp-plugin.d.ts(FmpChecks、FmpFixture)和.trellis/spec/app/plugins/index.md。