Opt-in to Strict Testing

Remove ratcheting exclusions and regenerate golden outputs for strict Kubernetes e2e testing.

1.1k|367|Updated Apr 8, 2019
One-click install
npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill opt-in-to-strict-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Opt-in to Strict Testing
Source: https://github.com/GoogleCloudPlatform/k8s-config-connector/tree/main/.gemini/skills/opt-in-to-strict-testing
Command: npx skills add https://github.com/GoogleCloudPlatform/k8s-config-connector --skill opt-in-to-strict-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you opt Config Connector (or another controller-backed resource set) into strict testing so server-side apply and re-reconciliation checks reliably validate differencing detection, reducing the chance that controllers incorrectly decide an update is needed.

Core Features & Use Cases

  • Opt-in via ratcheting exclusions: Removes selected resources from the exclusions configured in tests/e2e/ratcheting.go so strict testing is enabled for the targeted GroupKinds.
  • Regenerate golden fixtures for server-side apply: Updates _generated_object_*.golden.yaml and _http.log because expected request/object generation changes under strict testing.
  • Validate behavior with re-run tests: Confirms tests pass without WRITE_GOLDEN_OUTPUT=1, and provides guidance for diagnosing re-reconciliation failures caused by differencing or normalization bugs.

Quick Start

Ask the agent to enable strict testing for your chosen API group resources by editing tests/e2e/ratcheting.go, regenerating golden outputs with WRITE_GOLDEN_OUTPUT=1 using the appropriate presubmit script, and then re-running the same presubmit without WRITE_GOLDEN_OUTPUT=1 to confirm the tests pass.

Frequently Asked Questions about Opt-in to Strict Testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable strict testing for Kubernetes controller reconciliation?

To enable strict testing, remove targeted GroupVersionKinds from ratcheting exclusions in tests/e2e/ratcheting.go and regenerate golden fixtures for server-side apply validation. This ensures differencing detection is proven correct for the selected API group resources.

Why do my e2e tests fail after removing resources from ratcheting exclusions?

E2e tests fail because expected outputs change under strict testing. Regenerate _generated_object_*.golden.yaml and _http.log files by running the presubmit entrypoint with WRITE_GOLDEN_OUTPUT=1 before re-running tests without that flag.

What is re-reconciliation validation in Kubernetes controller testing?

Re-reconciliation validation verifies that a controller correctly determines no update is needed on a subsequent pass. Strict testing proves differencing detection works by comparing newly generated golden outputs against actual server-side apply results.

How do I fix TestRereconciliation diffs after enabling strict testing?

Address TestRereconciliation diffs by normalizing the controller or mapper logic. Re-run the presubmit tests without WRITE_GOLDEN_OUTPUT=1 to confirm the differencing detection no longer falsely triggers an update for the targeted resources.

Can I use strict testing for any GroupVersionKind in my controller project?

Yes, strict testing applies to specific GroupVersionKinds within an API group. You opt-in by removing the desired resources from the exclusions list, regenerating the golden outputs, and verifying the server-side apply behavior.

What is the best way to regenerate golden fixtures for server-side apply tests?

Regenerate golden fixtures by executing the correct presubmit script with WRITE_GOLDEN_OUTPUT=1. This updates the _generated_object_*.golden.yaml and _http.log files to reflect the expected requests and object generation under strict testing.