chart-tests

Write and run pytest-based Helm chart tests for the Astronomer Private Cloud repository.

490|98|Updated Jan 15, 2018
One-click install
npx skills add https://github.com/astronomer/astronomer --skill chart-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chart-tests
Source: https://github.com/astronomer/astronomer/tree/main/.agents/skills/chart-tests
Command: npx skills add https://github.com/astronomer/astronomer --skill chart-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the friction of writing, maintaining, and running reliable Helm chart tests for the Astronomer Private Cloud (APC) repository, removing guesswork around pytest patterns, value nesting rules, and Kubernetes schema validation.

Core Features & Use Cases

  • Standardized pytest patterns: Provides reusable templates for writing chart tests using the repository's render_chart() utility, eliminating reliance on the unsupported helm unittest plugin.
  • Sub-chart value guidance: Prevents common override errors with clear rules for nesting values under the correct sub-chart keys for both top-level and nested sub-charts.
  • Cross-cutting test guardrails: Includes patterns for writing invariant tests that validate requirements across all rendered cluster objects, preventing admission controller rejections from missing security or probe configurations.
  • Use case: When adding a new component to the APC Helm chart, use this Skill to write parametrized tests that validate rendering across all supported Kubernetes versions and ensure all containers meet mandatory security context requirements.

Quick Start

Use the chart-tests skill to write a parametrized pytest that validates your new Helm chart component renders correctly across all supported Kubernetes versions and meets all required security and probe constraints.

Frequently Asked Questions about chart-tests

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

FAQPage Schema
How do I write pytest tests for Helm charts in Kubernetes?

To write pytest tests for Helm charts, use the repository's render_chart() utility to validate template rendering and check values against Kubernetes OpenAPI schemas. This approach replaces the unsupported helm unittest plugin with standardized, reusable test patterns.

How do I override sub-chart values correctly in a Helm chart test?

To override sub-chart values correctly in a Helm chart test, nest your values under the correct sub-chart keys. Following clear nesting rules for both top-level and nested sub-charts prevents common override errors during template rendering.

What is the best way to validate Helm chart security contexts across all rendered objects?

The best way to validate Helm chart security contexts is to write cross-cutting invariant tests. These tests validate requirements across all rendered cluster objects to prevent admission controller rejections from missing security or probe configurations.

Does the helm unittest plugin work for testing Astronomer Private Cloud deployments?

The helm unittest plugin is unsupported for testing Astronomer Private Cloud deployments. Instead, use standardized pytest patterns with the repository's render_chart() utility to reliably author and run Helm chart tests.

How do I parametrize Helm chart tests for multiple Kubernetes versions?

To parametrize Helm chart tests for multiple Kubernetes versions, write parametrized tests that validate rendering across all supported versions. This ensures your new component renders correctly and meets required security and probe constraints consistently.

Why are my Helm chart deployments failing admission controller checks?

Helm chart deployments fail admission controller checks when rendered objects lack mandatory security contexts or probe configurations. Write cross-cutting invariant tests to validate these requirements across all cluster objects before deployment.