调试
- 作者仓库星标 357
- 许可证 GPL-2.0
- 作者仓库 woocommerce-ios
Debug a build failure or test failure in the WooCommerce iOS project.
For Build Failures
- Run the build and capture errors:
bundle exec fastlane build_for_testing 2>&1 \
| grep -E "error:|fatal|cannot find|undefined|ambiguous" | head -30
- Identify the failing file and error type
- Read the failing file and surrounding context
- Common root causes in this codebase:
- Missing module: Check Modules/Package.swift target dependencies
- Type mismatch: A Networking model changed — check if Yosemite/Storage need updates
- Cannot find type: May need
bundle exec rake generateafter adding GeneratedCopiable/Fakeable - Ambiguous reference: Duplicate type names across Networking vs Storage
- CoreData model errors: Check Storage/CoreData/ model versions
- Propose or apply the fix
For Test Failures
- Run the specific failing test (targeted tests require
xcodebuilddirectly):
xcodebuild -workspace WooCommerce.xcworkspace -scheme WooCommerce \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-sdk iphonesimulator test \
-only-testing:"<target>/<class>/<method>" 2>&1 | tail -50
- Read the test file and understand what it expects
- Read the implementation file being tested
- Check the mock class setup
- Common test failure patterns:
- Assertion mismatch: Verify expected vs actual, check mock stub values
- Async timeout: Check if mock callbacks are being invoked, verify continuation setup
- Nil unwrap: Check if mock return values are configured
- Wrong mock state: Verify spy properties are set correctly
- CoreData errors: Ensure InMemoryStorage is used, not persistent storage
- Missing @MainActor: Some tests need MainActor annotation
- Propose or apply the fix
If the simulator destination fails, run xcrun simctl list devices available to discover available simulators, then re-run with a matching device name.
- 流狐分类
- 工程开发
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @woocommerce · GPL-2.0
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 For Build Failures
Run the build and capture errors: Identify the failing file and error type Read the failing file and surrounding context
For Test Failures
Run the specific failing test (targeted tests require xcodebuild directly): Read the test file and understand what it expects Read the implementation file being tested
Debug a build failure or test failure in the WooCommerce iOS project.
## For Build Failures
1. Run the build and capture errors:
```bash
bundle exec fastlane build_for_testing 2>&1 \
| grep -E "error:|fatal|cannot find|undefined|ambiguous" | head -30
```
2. Identify the failing file and error type
3. Read the failing file and surrounding context
4. Common root causes in this codebase:
- **Missing module**: Check Modules/Package.swift target dependencies
- **Type mismatch**: A Networking model changed — check if Yosemite/Storage need updates
- **Cannot find type**: May need `bundle exec rake generate` after adding GeneratedCopiable/Fakeable
- **Ambiguous reference**: Duplicate type names across Networking vs Storage
- **CoreData model errors**: Check Storage/CoreData/ model versions
5. Propose or apply the fix
## For Test Failures
1. Run the specific failing test (targeted tests require `xcodebuild` directly):
```bash
xcodebuild -workspace WooCommerce.xcworkspace -scheme WooCommerce \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-sdk iphonesimulator test \
-only-testing:"<target>/<class>/<method>" 2>&1 | tail -50
```
2. Read the test file and understand what it expects
3. Read the implementation file being tested
4. Check the mock class setup
5. Common test failure patterns:
- **Assertion mismatch**: Verify expected vs actual, check mock stub values
- **Async timeout**: Check if mock callbacks are being invoked, verify continuation setup
- **Nil unwrap**: Check if mock return values are configured
- **Wrong mock state**: Verify spy properties are set correctly
- **CoreData errors**: Ensure InMemoryStorage is used, not persistent storage
- **Missing @MainActor**: Some tests need MainActor annotation
… 证据边界与执行链路
作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> For Build Failures → For Test Failures
要点 -> Missing module · Type mismatch · Cannot find type · Ambiguous reference · CoreData model errors · Assertion mismatch · Async timeout · Nil unwrap
文件/命令 -> bundle exec rake generate · xcodebuild · xcrun simctl list devices available · Modules/Package.swift · Yosemite/Storage · GeneratedCopiable/Fakeable · Storage/CoreData
内容 SHA-256 -> d24f2f8784a5
原文结构
适用与边界
原文中的明确线索
bundle exec rake generate、xcodebuild、xcrun simctl list devices available、Modules/Package.swift、Yosemite/Storage、GeneratedCopiable/Fakeable、Storage/CoreData