oxidecomputer / oxidecomputer/packer-plugin-oxide

Expand acceptance test coverage (SSH path, -force, skip_create_image, user_data, data source assertions)

Open
#108 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Packer Plugin Testing
Dominant language
Go
Stars
2
Forks
1
Avg merge
3h 9m
Merged PRs (30d)
3

Description

Problem

All builder acceptance templates use communicator = "none", so the plugin's core value path is never exercised even when acceptance tests run: temp SSH key generation, Oxide SSH-key create/delete, external IP listing, StepConnect, and provisioning.

Untested configuration surface: -force (both conflict and no-conflict — see oxidecomputer/packer-plugin-oxide#101/oxidecomputer/packer-plugin-oxide#102), skip_create_image, user_data, ip_pool, ssh_public_keys. The data source acceptance test only asserts exit code 0 and never verifies the image_id output value.

Test smells to fix while in here:

  • Check functions only assert when buildCommand.ProcessState != nil, so a hung/unstarted command passes silently.
  • assertFileContains passes the expected string to regexp.MatchString, so expectations containing regex metacharacters will silently mis-match.

Fix

  • Add an acceptance case with communicator = "ssh" and a trivial shell provisioner.
  • Add cases for -force, skip_create_image, and user_data.
  • Assert data source output values (e.g., via a locals/manifest trick or log assertion).
  • Fix the Check/assertFileContains smells.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the builder acceptance templates and the data source acceptance test mentioned in the issue, then inspect the Check functions and assertFileContains helper. Run the acceptance tests while covering SSH, -force, skip_create_image, and user_data cases. Done means the core SSH and provisioning path is exercised, data source image_id output is verified, and hung commands or literal expected strings cannot pass silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.