Skip to content

test: cover configuration, metadata, and the untested workflow branches - #42

Merged
tas50 merged 1 commit into
mainfrom
test/expand-coverage
Aug 24, 2026
Merged

tas50 merged 1 commit into
mainfrom
test/expand-coverage

Conversation

@tas50

@tas50 tas50 commented Aug 24, 2026

Copy link
Copy Markdown
Member

35 examples for a driver with 18 methods, and one of them was testing the wrong thing.

The example that could not fail

context 'when vro_disable_ssl_verify is false' do
  before do
    config[:vro_disable_ssl_verify] = true   # <- true
  end

  it 'returns true' do
    expect(driver.verify_ssl?).to eq(false)  # <- false
  end
end

A copy of the true context with the name changed and nothing else. Both branches of #verify_ssl? were asserting the same thing, so the false path — the one that decides whether the driver validates the vRO server's TLS certificate — had never been executed by a test. Fixed to set false and expect true.

What was untested

area why it matters
#name the string kitchen list prints
plugin_version kitchen diagnose output
configuration defaults vro_disable_ssl_verify defaulting to false is a security-relevant default and nothing pinned it
required_config five settings the driver cannot run without, none of them checked
#set_workflow_vars resets the memoized client, which is the only reason running destroy after create in one process works
#workflow_successful? neither branch

The #set_workflow_vars test is the one I would keep if I could keep only one: the memoization reset is load bearing and invisible, and a refactor that dropped @vro_client = nil would have gone green.

Verification

  • rake test — 51 examples, 0 failures (35 before; 16 new, 1 corrected)
  • cookstyle --chefstyle — clean; lib/ is untouched by this PR

@tas50
tas50 merged commit 6f3bcde into main Aug 24, 2026
8 checks passed
@tas50
tas50 deleted the test/expand-coverage branch August 24, 2026 01:55
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