Skip to content

Add unit tests for snap-preseed-channel and snap-preseed-validation plugin options#323

Merged
smethnani merged 2 commits intowork/classic-snap-prepare-image-pluginfrom
copilot/sub-pr-320
Apr 22, 2026
Merged

Add unit tests for snap-preseed-channel and snap-preseed-validation plugin options#323
smethnani merged 2 commits intowork/classic-snap-prepare-image-pluginfrom
copilot/sub-pr-320

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

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
# 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>

Copilot AI changed the title [WIP] [WIP] Address feedback: Add relevant tests for snap prepare-image plugins Add unit tests for snap-preseed-channel and snap-preseed-validation plugin options Apr 21, 2026
Copilot AI requested a review from lengau April 21, 2026 20:14
@smethnani smethnani marked this pull request as ready for review April 22, 2026 08:18
@smethnani smethnani merged commit 60e09f8 into work/classic-snap-prepare-image-plugin Apr 22, 2026
2 checks passed
@smethnani smethnani deleted the copilot/sub-pr-320 branch April 22, 2026 08:18
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.

3 participants