testing-hashql

Generate structured semantic metadata for Skill Unit documents in RAG workflows.

1.6k|123|Updated Jul 15, 2019
One-click install
npx skills add https://github.com/hashintel/hash --skill testing-hashql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-hashql
Source: https://github.com/hashintel/hash/tree/main/.claude/skills/testing-hashql
Command: npx skills add https://github.com/hashintel/hash --skill testing-hashql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests. Use when writing tests for HashQL code, using //~ annotations, running --bless, debugging test failures, or choosing the right testing approach.

Core Features & Use Cases

  • Compiletest UI tests for diagnostics and pipeline stages
  • Unit tests for internal logic
  • insta snapshot tests for core crates and syntax fragments
  • Comprehensive testing guides and debugging workflows

Quick Start

Run the HashQL compiletest harness: cargo run -p hashql-compiletest run; use --bless to update outputs.

Frequently Asked Questions about testing-hashql

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

FAQPage Schema
How do I write and run compiletest UI tests for HashQL diagnostics?

Compiletest UI tests validate HashQL compiler diagnostics and pipeline stages using //~ annotations. Run `cargo run -p hashql-compiletest run` to execute the harness, then use `--bless` to update expected outputs when behavior changes intentionally.

What's the difference between compiletest, unit tests, and snapshot tests for HashQL?

Compiletest validates UI and diagnostics; unit tests verify internal logic; insta snapshot tests capture and compare syntax fragment outputs. Choose compiletest for pipeline stages, unit tests for core functions, and snapshot tests for serialized syntax trees and crate behavior.

How do I debug failing HashQL tests and update test expectations?

Review test output from `cargo run -p hashql-compiletest run`, examine //~ annotation mismatches, then run with `--bless` to accept corrected outputs. Comprehensive debugging workflows guide identifying root causes in diagnostics, pipeline execution, or snapshot divergence.

Can I use snapshot testing for HashQL syntax fragments and core crates?

Yes, insta snapshot tests are designed for HashQL core crates and syntax fragments. They capture serialized outputs, store expected results, and flag regressions when code changes. Use them alongside unit tests for regression coverage.

What testing approach should I use for HashQL compiler pipeline stages?

Compiletest is the primary harness for pipeline stages and diagnostics. It runs UI tests with //~ annotations to verify compiler output at each stage, making it ideal for validating end-to-end behavior and error messages.

Do I need prior testing framework knowledge to use HashQL compiletest?

Compiletest is tailored for HashQL; you need familiarity with Rust testing basics and //~ annotation syntax. Comprehensive guides and debugging workflows are provided for adopting compiletest without deep testing framework expertise.