Add unit tests for snap-preseed-channel and snap-preseed-validation plugin options
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged unit tests confirming snap-preseed-channel and snap-preseed-validation options correctly inject --channel and --validation=enforce flags into snap prepare-image commands. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #333 docs: add snap-preseed plugin | imagecraft | merged | Merged documentation update adding reference material for the snap-preseed plugin. Approved by two reviewers and passed CI checks. Modified three files with 140 additions and 4 deletions. | |
| #332 fix(snap-prepare): make keys optional | imagecraft | merged | Merged. Updates snap-preseed plugin to require only snap-preseed-snaps or snap-preseed-model-assert, making them mutually optional. Sets default validation to enforce. Approved by two reviewers and passed all CI checks. |