sdlc-agent-11-unit-test

Generates and executes PyTest suites with coverage reports for reviewed PySpark and SQL code.

1|2|Updated Aug 10, 2026
One-click install
npx skills add https://github.com/TRRaveendra/AI-Agents-Databricks --skill sdlc-agent-11-unit-test-trraveendra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sdlc-agent-11-unit-test
Source: https://github.com/TRRaveendra/AI-Agents-Databricks/tree/main/ai-agent-skills/databricks-sdlc-agent-skills/11-unit-test-agent
Command: npx skills add https://github.com/TRRaveendra/AI-Agents-Databricks --skill sdlc-agent-11-unit-test-trraveendra

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires databricks-sdk, and includes references (resource) components.

What problem does it solve? Manually writing unit tests for PySpark and SQL transformations in a Databricks pipeline is slow and often skipped, leaving data pipelines without verified test coverage or real pass/fail evidence. ## Core Features & Use Cases - PyTest Generation: Creates test cases covering happy paths, edge cases, negative cases, and mock data using chispa, pytest-spark, and local SparkSession fixtures. - Real Test Execution: Runs tests via the Databricks Jobs API or serverless notebooks and captures actual pass/fail results and coverage, never fabricated numbers. - Contract-Validated Output: Returns JSON matching a strict output contract and writes artifacts (tests/*.py, coverage_report.md) to Unity Catalog Volumes for the next pipeline agent. - Use Case: As stage 11 of a 15-agent SDLC pipeline, it consumes reviewed PySpark/SQL from the Code Review Agent and hands a validated test suite plus coverage report to the Testing Agent. ## Quick Start Generate and execute a PyTest suite with a coverage report for the reviewed PySpark code from ticket {ticket} and write the artifacts to the lakehouse.

Frequently Asked Questions about sdlc-agent-11-unit-test

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

FAQPage Schema
How do I generate PyTest tests for PySpark code in Databricks?

This agent drafts PyTest cases via the Databricks Foundation Model API covering happy paths, edge cases, and negative cases, using chispa, pytest-spark, and local SparkSession fixtures. It then executes them through the Jobs API and records real pass/fail results.

How to measure test coverage for PySpark pipelines?

The agent executes the generated test suite as a Databricks job run or serverless notebook and captures actual coverage metrics into a coverage_report.md artifact. It never reports fabricated coverage numbers, only measured results.

Can I call Genie Code from an API to write tests?

No, Genie Code has no public API and cannot be invoked headlessly from an orchestrator. Use the Databricks Foundation Model API (Model Serving pay-per-token endpoints) or a Mosaic AI Agent endpoint for code generation instead.

What happens when the unit test output fails contract validation?

The agent performs one repair retry with the validation error appended to the context. If validation still fails, the run is routed to state.needs_human for the approval-gate agents to review.

Where are unit test artifacts stored in the Databricks pipeline?

Artifacts are written to /Volumes/{catalog}/state/artifacts/{ticket}/11_unit-test-agent/ in Unity Catalog Volumes. The agent also upserts tracking rows into state.artifacts and logs the full run trace to state.agent_runs.