Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow empty string in package_apt_pin #1025

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

wyardley
Copy link
Contributor

@wyardley wyardley commented Nov 14, 2024

  • Require package_apt_pin to be a non-empty string or number
  • Use nil instead of empty string in test for empty pin

Resolves a test failure that seems to have cropped up since the last time tests ran (probably a new version of the apt module).

This is technically breaking in a minor way, though guessing we don't need to cut a major for it. Alternately, I could continue to be less strict in the module's validation, and just update the test case 🤷

  3) rabbitmq on ubuntu-20.04-x86_64 with no pin it sets up an apt::source is expected to contain Apt::Source[rabbitmq] with location => "https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu", repos => "main" and key => "{\"id\"=>\"8C695B0219AFDEB04A058ED8F4E789204D206F89\", \"source\"=>\"https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey\", \"content\"=>nil}"
     Failure/Error:
       is_expected.to contain_apt__source('rabbitmq').with(
         'location' => "https://packagecloud.io/rabbitmq/rabbitmq-server/#{os_facts['os']['name'].downcase}",
         'repos' => 'main',
         'key' => '{"id"=>"8C695B0219AFDEB04A058ED8F4E789204D206F89", "source"=>"https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey", "content"=>nil}'
       )
     
     Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Resource Statement, Apt::Pin[rabbitmq]: parameter 'priority' expects a value of type Integer or String[1], got String (file: /Users/wby/git/puppet-rabbitmq/spec/fixtures/modules/rabbitmq/manifests/repo/apt.pp, line: 41) on node xxxx

* Require package_apt_pin to be a non-empty string or number
* Use `nil` instead of empty string in test for empty pin
@wyardley wyardley added skip-changelog bug Something isn't working and removed skip-changelog labels Nov 14, 2024
@wyardley wyardley changed the title Fix apt pin for new version of apt module Disallow empty string in package_apt_pin Nov 14, 2024
- Add hosts entry for `foobar` in acceptance test step (resolves issue
  that was causing rabbitmq not to start)
- Switch `rabbitmq::cluster[:local_node]` to have `catch_failures =
  true` vs `expect_failures = true`
@wyardley wyardley merged commit c5afc5f into voxpupuli:master Nov 15, 2024
11 checks passed
@wyardley wyardley deleted the wyardley/fix_test branch November 15, 2024 05:02
@wyardley wyardley mentioned this pull request Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants