-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Michael Harp edited this page Jan 28, 2026
·
1 revision
This project uses rspec-puppet for unit testing and puppet-lint for style checking.
GitHub Actions CI uses the local bundle for linting - this is authoritative for PRs:
cd site-modules/profile
bundle install # Install dependencies
bundle exec rake validate lint check # Validate syntax and lint
bundle exec rake parallel_spec # Run all rspec-puppet tests
bundle exec rake spec SPEC=spec/classes/openvox_agent_spec.rb # Run single specThe voxbox container can be used for testing but may have different lint rules than the CI bundle:
cd site-modules/profile
# Run puppet-lint
docker run --rm -v $PWD:/repo ghcr.io/voxpupuli/voxbox:8 lint
# Run all rake tasks list
docker run --rm -v $PWD:/repo ghcr.io/voxpupuli/voxbox:8
# Run spec tests
docker run --rm -v $PWD:/repo ghcr.io/voxpupuli/voxbox:8 spec
# Run a specific spec
docker run --rm -e "SPEC=spec/classes/static_catalogs_spec.rb" -v $PWD:/repo ghcr.io/voxpupuli/voxbox:8 spec
# Run syntax validation
docker run --rm -v $PWD:/repo ghcr.io/voxpupuli/voxbox:8 validate./scripts/bolt-validate.sh # Run Bolt validation plan from hostTests use rspec-puppet with rspec-puppet-facts for multi-OS testing.
Example spec structure:
describe 'profile::example' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
it { is_expected.to compile }
end
end
endSpec files go in site-modules/profile/spec/classes/ for class tests.