Skip to content

docs: mention jhack scenario snapshot#2351

Open
dimaqq wants to merge 5 commits intocanonical:mainfrom
dimaqq:docs-mention-jhack
Open

docs: mention jhack scenario snapshot#2351
dimaqq wants to merge 5 commits intocanonical:mainfrom
dimaqq:docs-mention-jhack

Conversation

@dimaqq
Copy link
Contributor

@dimaqq dimaqq commented Feb 27, 2026

Fixes #1957

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the documentation to mention using jhack scenario snapshot as a way to capture realistic live model/relation data and convert it into ops.testing state-transition tests, addressing #1957.

Changes:

  • Add a short note in the unit-testing how-to about capturing live relation inputs via jhack scenario snapshot.
  • Add a new section in the relations how-to describing a workflow for snapshotting live relation state and turning it into local tests.
  • Add a note in the state-transition testing explanation linking to the relations workflow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
docs/howto/write-unit-tests-for-a-charm.md Adds guidance pointing readers to jhack scenario snapshot for realistic relation test inputs.
docs/howto/manage-relations.md Introduces a new subsection describing snapshot-to-test workflow for relation debugging.
docs/explanation/state-transition-testing.md Adds a short pointer to the relations workflow for realistic starting data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


### Add code to use a relation

### Capture live relation state for testing
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The new "### Capture live relation state for testing" heading is the same level as "### Add code to use a relation", which leaves the "Add code..." section empty and also makes the existing "#### Using a charm library" subsection fall under the new testing section. Consider making "Capture..." a subsection under "Add code..." (e.g., use "####") or move it to a more appropriate place so the heading hierarchy matches the content.

Suggested change
### Capture live relation state for testing
#### Capture live relation state for testing

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is valid, there's probably a better place to mention jhack than the very beginning of "use a relation"

Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend putting the new section here:

  • Test the feature
    • Write unit tests
    • Write integration tests
  • Capture live relation state for testing

Alternative title idea: Generate tests from a deployed model

@dimaqq dimaqq marked this pull request as ready for review February 27, 2026 06:53
@dimaqq dimaqq requested a review from dwilding February 27, 2026 06:53
@dimaqq dimaqq changed the title docs: mention jhack scenario napshot docs: mention jhack scenario snapshot Feb 27, 2026
Copy link
Contributor

@dwilding dwilding left a comment

Choose a reason for hiding this comment

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

TIL jhack scenario snapshot 🙂


### Add code to use a relation

### Capture live relation state for testing
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend putting the new section here:

  • Test the feature
    • Write unit tests
    • Write integration tests
  • Capture live relation state for testing

Alternative title idea: Generate tests from a deployed model

@dimaqq
Copy link
Contributor Author

dimaqq commented Mar 13, 2026

Updated and ready for real review.

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.

Document jhack scenario snapshot

3 participants