docs: mention jhack scenario snapshot#2351
Conversation
There was a problem hiding this comment.
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.
docs/howto/manage-relations.md
Outdated
|
|
||
| ### Add code to use a relation | ||
|
|
||
| ### Capture live relation state for testing |
There was a problem hiding this comment.
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.
| ### Capture live relation state for testing | |
| #### Capture live relation state for testing |
There was a problem hiding this comment.
This is valid, there's probably a better place to mention jhack than the very beginning of "use a relation"
There was a problem hiding this comment.
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
dwilding
left a comment
There was a problem hiding this comment.
TIL jhack scenario snapshot 🙂
docs/howto/manage-relations.md
Outdated
|
|
||
| ### Add code to use a relation | ||
|
|
||
| ### Capture live relation state for testing |
There was a problem hiding this comment.
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
|
Updated and ready for real review. |
Fixes #1957