mz-platform-checks

Create and debug platform checks testing Materialize features across restarts and upgrades.

6.4k|512|Updated Feb 22, 2019
One-click install
npx skills add https://github.com/MaterializeInc/materialize --skill mz-platform-checks
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mz-platform-checks
Source: https://github.com/MaterializeInc/materialize/tree/main/.agents/skills/mz-platform-checks
Command: npx skills add https://github.com/MaterializeInc/materialize --skill mz-platform-checks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests that verify Materialize features survive restarts and upgrades requires understanding a specific framework of Check classes, scenarios, and testdrive fragments. This Skill guides you through creating, modifying, and debugging platform checks correctly the first time.

Core Features & Use Cases

  • Check Authoring: Provides the exact anatomy of a Check class with initialize, manipulate, and validate methods returning Testdrive fragments.
  • Version Gating & Decorators: Explains how to disable checks, mark non-idempotent external interactions, and gate checks by Materialize version.
  • CI Failure Debugging: Gives a step-by-step workflow to reproduce failing scenarios locally using mzcompose commands.
  • Use Case: You added a new SQL feature and need to verify it survives cluster restarts. Use this Skill to write a Check class in misc/python/materialize/checks/all_checks/ and run it against the RestartEntireMz scenario.

Quick Start

Write a new platform check for my feature that creates a table, inserts data across restart phases, and validates the results survive an upgrade.

Frequently Asked Questions about mz-platform-checks

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

FAQPage Schema
How do I write a platform check in Materialize?▼

Create a Python class extending Check in misc/python/materialize/checks/all_checks/ with initialize, manipulate, and validate methods returning Testdrive fragments. The directory's __init__.py auto-discovers new files, so no manual registration is needed.

How to run a single platform check against a specific scenario?▼

Run bin/mzcompose --find platform-checks run default --scenario=RestartEntireMz --check=MyFeature. Use --scenario=NoRestartNoUpgrade to debug the check logic itself without restarts interfering.

Why must manipulate() return exactly two Testdrive fragments?▼

The framework asserts manipulate returns exactly 2 elements because scenarios run two manipulation phases separated by restart or upgrade actions. Both phases always execute before validate runs.

How do I version-gate a platform check for newer Materialize features?▼

Override _can_run to compare self.base_version against MzVersion.parse_mz, or use [version>=VVMMPP] prefixes on testdrive lines for syntax that changed between versions, such as [version>=9200] for v0.92.0.

Why does my platform check fail when validate runs multiple times?▼

Validate may be called more than once, so it must be idempotent. Create only TEMPORARY objects or explicitly drop any objects created during validation to avoid duplicate-object errors.