Skip to content

feat: implement the driver status hook - #88

Merged
tas50 merged 1 commit into
mainfrom
feat/status-hook
Aug 24, 2026
Merged

tas50 merged 1 commit into
mainfrom
feat/status-hook

Conversation

@tas50

@tas50 tas50 commented Aug 24, 2026

Copy link
Copy Markdown
Member

kitchen list could only report what the state file remembered, because Kitchen::Driver::Base#status was never overridden.

def status(state)
  return super unless state[:deployment_id]

  deployment = lookup_deployment(state[:deployment_id])
  return super unless deployment
  ...
end

vRA is now asked directly, so a deployment that failed to build, is still building, or was destroyed from the vRA console shows its real state without a converge.

live is true only for CREATE_SUCCESSFUL, matching Vra::Deployment#successful?. CREATE_INPROGRESS and CREATE_FAILED report live: false but keep their own name, which distinguishes "not ready yet" from "will never be ready" — a distinction a bare boolean loses.

Falling back rather than failing

kitchen list should not raise on a driver it is only interrogating, so the base "unknown" answer covers: no deployment in state, vRA answering Vra::Exception::NotFound (a real answer — the deployment is gone), and vRA being unreachable. lookup_deployment rescues ::StandardError, with the leading :: because Kitchen::StandardError would otherwise win lexical lookup inside module Kitchen and narrow the rescue to Test Kitchen's own errors.

Verification

  • rake test — 55 examples, 0 failures (48 before; 7 new), rake exit 0
  • cookstyle --chefstyle — 5 files, no offenses
  • yard stats — 100% documented

@tas50
tas50 merged commit 933e254 into main Aug 24, 2026
8 checks passed
@tas50
tas50 deleted the feat/status-hook branch August 24, 2026 03:00
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.

1 participant