Skip to content

Commit

Permalink
Also move default analytics setting test to unit tests
Browse files Browse the repository at this point in the history
A separate test is necessary for the default, because we don't omit
the setting but rather comment it for discoverability. But we don't
really need to test if any behaviors change by including a commented
line (the file already includes many comments) so a unit test should
suffice for that case.
  • Loading branch information
wbclark authored and ehelms committed Jan 26, 2024
1 parent d66b306 commit 71214fa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
15 changes: 0 additions & 15 deletions spec/acceptance/settings_spec.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
require 'spec_helper_acceptance'

describe 'ANALYTICS setting' do
context 'default ANALYTICS' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
include pulpcore
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^# ANALYTICS = False$/) }
end
end

context 'ANALYTICS disabled' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
Expand Down
1 change: 1 addition & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.with_content(%r{ALLOWED_CONTENT_CHECKSUMS = \["sha224", "sha256", "sha384", "sha512"\]})
.with_content(%r{REDIS_URL = "redis://localhost:6379/8"})
.with_content(%r{CACHE_ENABLED = False})
.with_content(%r{# ANALYTICS = False})
.without_content(%r{sslmode})
.without_content(%r{WORKER_TTL})
is_expected.to contain_concat__fragment('logging').with_content(<<~LOGGING)
Expand Down

0 comments on commit 71214fa

Please sign in to comment.