What problem does it solve?
Fixing golden mock diffs that drift from real GCP behavior causes noisy test failures and unreliable validation of API contracts. This Skill helps you identify whether discrepancies come from missing mock defaulting logic or from normalization of volatile fields.
Core Features & Use Cases
- Diff-driven debugging: Use
hack/compare-mock output to pinpoint where mock vs real responses diverge.
- Mock default parity: Add
populateDefaultsFor<Resource> calls so server-side defaults appear consistently in mock responses for both Insert and Get paths.
- Normalizer updates for volatility: Update
mockgcp/mock<service>/normalize.go to ensure generated IDs and dynamic values (like IPs/URLs) are represented deterministically in golden fixtures.
- Golden fixture stabilization: Re-run comparisons and update
_http.log while replacing volatile values with placeholder variables to keep tests stable.
Quick Start
Run hack/compare-mock for the failing fixture test name, then update the mock defaults or normalization logic until the regenerated golden _http.log diff is clean.