Update unit specs to match refactored integrations interface#5
Update unit specs to match refactored integrations interface#5
Conversation
Co-authored-by: alvagante <283804+alvagante@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Aligns the module’s RSpec unit tests and Hiera fixture data with the refactored pabawi integrations interface (Array[String[1]] $integrations) to fix failing specs caused by the removed boolean flags and hash-based integrations config.
Changes:
- Updated
spec/classes/init_spec.rbto exercise integrations viaintegrations => ['name']and adjusted the invalid-type expectation accordingly. - Updated
spec/fixtures/data/common.yamlto removepabawi::bolt_enable/pabawi::puppetdb_enableand switchpabawi::integrationsfrom{}to[].
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/classes/init_spec.rb | Refactors spec contexts to use the new integrations array interface and updates the type-validation assertion. |
| spec/fixtures/data/common.yaml | Updates fixture Hiera data to the new interface by removing old flags and setting integrations to an empty array. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Integration flags | ||
| pabawi::bolt_enable: false | ||
| pabawi::puppetdb_enable: false | ||
| pabawi::integrations: {} | ||
| pabawi::integrations: [] | ||
|
|
||
| # Bolt integration configuration (required if bolt_enable is true) |
There was a problem hiding this comment.
The comments in this fixture still refer to the removed bolt_enable/puppetdb_enable flags (and call this section “Integration flags”). Since the interface is now pabawi::integrations: ['bolt', ...], please update these comments to reference enabling integrations via the integrations array to avoid misleading fixture documentation.
The
pabawiclass was refactored to replacebolt_enable/puppetdb_enableboolean params and a hash-typedintegrationsparameter with a singleArray[String[1]] $integrations, but the unit spec and Hiera fixture data still referenced the old interface, causing test failures.Changes
spec/classes/init_spec.rb: Replaced all contexts usingbolt_enable,puppetdb_enable, andintegrationshash with equivalent contexts using the new array form:Updated the invalid-type test to assert an
Array[Stringtype error instead of aBooleanone.spec/fixtures/data/common.yaml: Removedpabawi::bolt_enableandpabawi::puppetdb_enableentries; changedpabawi::integrations: {}topabawi::integrations: [].🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.