Add unit tests for snap-preseed-channel and snap-preseed-validation plugin options
Metadata
Current evaluation
Merged PR #323 added unit coverage for snap-preseed-channel forwarding and snap-preseed-validation=enforce in generated snap prepare-image commands.
Resolution: closed resolved
Reason: PR #323 was merged into the mainline. It added tests confirming the channel and enforce validation options are wired into the generated command.
Evaluated by: mr-cal-bot
No scores available.
Issue body
`SnapPreseedPluginProperties` exposes `snap-preseed-channel` and `snap-preseed-validation`, but neither had test coverage verifying the CLI flags were correctly wired into the generated `snap prepare-image` command.
## Changes
- **`test_get_build_commands_with_channel`**: asserts `--channel=<value>` appears in the command when `snap-preseed-channel` is set
- **`test_get_build_commands_with_validation_enforce`**: asserts `--validation=enforce` replaces the default `--validation=ignore` when `snap-preseed-validation: enforce` is specified
```python
# Channel flag wired correctly
properties = SnapPreseedPluginProperties.unmarshal({
"snap-preseed-snaps": ["core24"],
"snap-preseed-channel": "latest/stable",
})
# → snap prepare-image --classic --arch=amd64 --validation=ignore --channel=latest/stable --snap=core24 "" <install_dir>
# Validation override wired correctly
properties = SnapPreseedPluginProperties.unmarshal({
"snap-preseed-snaps": ["core24"],
"snap-preseed-validation": "enforce",
})
# → snap prepare-image --classic --arch=amd64 --validation=enforce --snap=core24 "" <install_dir>
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #323 added unit coverage for snap-preseed-channel forwarding and snap-preseed-validation=enforce in generated snap prepare-image commands. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #323: added unit tests confirming snap-preseed-channel and enforce validation are passed to snap prepare-image; Canonical CLA passed. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/imagecraft#323: unit tests verify snap-preseed-channel and snap-preseed-validation correctly pass CLI flags to snap prepare-image; Canonical CLA passed. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Unit tests verify snap-preseed-channel and snap-preseed-validation plugin options correctly pass CLI flags to the snap prepare-image command. 32 lines added, zero removed. CI passed. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added unit tests for snap-preseed-channel and snap-preseed-validation plugin options. Tests confirm CLI flags correctly wire into the snap prepare-image command, validating channel and enforcement settings. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #333 docs: add snap-preseed plugin | imagecraft | merged | Merged PR #333 (commit 7c0a27a), adding a reference document for the snap-preseed plugin and linking it from the plugin documentation. |