Skip to content

[skill] Add mz-tests skill for running and adding tests in Materialize#35218

Open
mtabebe wants to merge 1 commit intoMaterializeInc:mainfrom
mtabebe:ma/skill/mz-tests
Open

[skill] Add mz-tests skill for running and adding tests in Materialize#35218
mtabebe wants to merge 1 commit intoMaterializeInc:mainfrom
mtabebe:ma/skill/mz-tests

Conversation

@mtabebe
Copy link
Contributor

@mtabebe mtabebe commented Feb 25, 2026

Add a Claude skill that runs or helps add tests: sqllogictest (.slt), testdrive (.td), pgtest (.pt), and Rust unit tests.

Includes a quick reference table, environment setup (cargo env), and steps for each framework plus guidance for adding new tests.

Defers to doc/developer/guide-testing.md for more detail.

@mtabebe mtabebe requested review from aljoscha, bosconi and def- February 25, 2026 19:41
@github-actions
Copy link

Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone.

PR title guidelines

  • Use imperative mood: "Fix X" not "Fixed X" or "Fixes X"
  • Be specific: "Fix panic in catalog sync when controller restarts" not "Fix bug" or "Update catalog code"
  • Prefix with area if helpful: compute: , storage: , adapter: , sql:

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

Add a Claude skill that runs or helps add tests: sqllogictest (.slt),
testdrive (.td), pgtest (.pt), and Rust unit tests.

Includes a quick reference table, environment setup (cargo env), and
steps for each framework plus guidance for adding new tests.

Defers to doc/developer/guide-testing.md for more detail.
allowed-tools: [Bash, Read, Edit, Grep, Glob, Task]
---

Run or help add tests in the Materialize repo. Supports sqllogictest, testdrive, pgtest, and Rust unit tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the most interesting test frameworks unfortunately, the zoo mentioned in https://www.notion.so/materialize/You-ve-been-handed-a-Bug-by-QA-what-now-26c13f48d37b807c88deed9257ae97ac

Comment on lines +80 to +82
- Always show the full error output before attempting fixes.
- Ask before modifying test files.
- Do NOT commit test changes — I'll decide when to commit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those sound like your individual preferences? Not sure they belong in a skill

- For Rust: use `#[mz_ore::test]` (or `#[mz_ore::test(tokio::test)]` for async).
- Do NOT modify files in `test/sqllogictest/sqlite` or `test/sqllogictest/cockroach` (upstream).

4. Show full output. If tests fail, show failures clearly and offer to help fix.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience when you tell an LLM that, it will sometimes just "fix" the test by changing the expected output to what the actual output is, instead of fixing the bug in Materialize ;)


### Running `slt` (sqllogictest)
```bash
./bin/sqllogictest [--release] -- test/sqllogictest/FILE.slt -v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention --optimized. It's what you should actually use by default. It's about as fast to build as Debug, but nearly as fast as Release to execute.

Comment on lines +49 to +50
cd test/testdrive
./mzcompose run default FILE.td
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing directory just do bin/mzcompose --find testdrive run default FILE.td.

@def-
Copy link
Contributor

def- commented Feb 25, 2026

I wish we could have the same guide for humans as for LLMs, but that's more of a general complaint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants