Fix MockGCP Diffs

Official

Make mock outputs match real GCP behavior.

AuthorGoogleCloudPlatform
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: Fix MockGCP Diffs
Download link: https://github.com/GoogleCloudPlatform/k8s-config-connector/archive/main.zip#fix-mockgcp-diffs

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.