harness-migration

Migrate legacy Harness unit tests to Scenario-based testing for Juju charms.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/tonyandrewmeyer/cantrip --skill harness-migration
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: harness-migration
Source: https://github.com/tonyandrewmeyer/cantrip/tree/main/src/cantrip/skills/harness-migration
Command: npx skills add https://github.com/tonyandrewmeyer/cantrip --skill harness-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrates legacy Harness unit tests to the modern Scenario-based testing framework to improve reliability and readability.

Core Features & Use Cases

  • Guides per-file and per-event migration strategies from Harness to Scenario.
  • Provides concrete examples and a clear workflow for updating tests, dependencies, and test structure.
  • Helps teams standardize on the scenario-tests pattern for Juju charms.

Quick Start

Migrate existing Harness-based unit tests to Scenario tests using the guidance in this skill.

Frequently Asked Questions about harness-migration

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

FAQPage Schema
How do I migrate Harness unit tests to Scenario-based tests for Juju charms?▼

Migrate Harness unit tests to Scenario by replacing ops.testing.Harness constructs with Context and State, updating dependencies, and aligning test organization with the scenario-tests pattern per-file and per-event.

What is the difference between Harness and Scenario testing for Juju charms?▼

Scenario testing replaces legacy Harness by using Context and State to improve reliability and maintainability, whereas Harness relies on older ops.testing constructs for simulating charm lifecycle events.

Can I migrate Harness tests to Scenario tests on a per-file basis?▼

Yes, you can migrate Harness tests to Scenario tests on a per-file and per-event basis, validating converted results using Scenario's Context and State constructs incrementally.

When should I migrate my ops.testing.Harness tests to the Scenario framework?▼

Migrate Harness tests to Scenario when your charm projects require improved test reliability and maintainability, standardizing test organization on the modern scenario-tests pattern.

Does migrating Harness tests to Scenario require updating project dependencies?▼

Yes, migrating to Scenario requires updating dependencies to support the scenario-tests pattern, replacing Harness constructs with Context and State, and aligning test structure accordingly.