Test reusable code blocks directly where you build them. Mage’s built-in data validation makes it easy to catch issues early and deploy with confidence
Mage’s inline data validation framework makes testing your pipelines simple, modular, and lightning-fast. Every data loader and transformer block supports built-in testing, so you can write and run validations right alongside your transformation logic.
Define one or more @test
functions inside any block—each function receives the block’s output data and can contain any validation logic you need. Whether it’s schema checks, row counts, data types, or business rules, Mage will automatically run all test functions after the main block executes.
💡 Why it matters:
Catch bugs early: Blocks fail fast if test conditions aren’t met.
Stay modular: Write reusable test logic specific to each block’s purpose.
Speed it up: Run tests in parallel for rapid validation at scale.
Instant visibility: View test results directly in block logs for easy debugging.
With Mage, testing isn’t a separate process—it’s built into your workflow. Just write, validate, and ship confidently.
Your AI data engineer