From a31c7ffe723286b899c59b1a2d87a78f9ac0dcfb Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 12 Apr 2024 14:57:28 +0100 Subject: [PATCH] (CAT-1807) Remove all reference of analytics from the acceptance tests --- spec/acceptance/get_config_spec.rb | 16 +++++++++------- spec/spec_helper_acceptance.rb | 7 ------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/spec/acceptance/get_config_spec.rb b/spec/acceptance/get_config_spec.rb index 117cd2c3e..3dbac5144 100644 --- a/spec/acceptance/get_config_spec.rb +++ b/spec/acceptance/get_config_spec.rb @@ -8,26 +8,28 @@ describe command('pdk get config') do its(:exit_status) { is_expected.to eq 0 } # This setting should appear in all pdk versions - its(:stdout) { is_expected.to match(/user\.analytics\.user-id=/) } + its(:stdout) { is_expected.to match(/user.module_defaults.author=/) } its(:stderr) { is_expected.to have_no_output } end - describe command('pdk get config user.analytics.disabled') do + describe command('pdk get config user.module_defaults.author') do its(:exit_status) { is_expected.to eq 0 } # This setting, and only, this setting should appear in output - its(:stdout) { is_expected.to eq("true\n") } + its(:stdout) { is_expected.to match("true\n") } its(:stderr) { is_expected.to have_no_output } end - describe command('pdk get config user.analytics') do + describe command('pdk get config user.module_defaults') do its(:exit_status) { is_expected.to eq 0 } # There should be two configuration items returned - its(:stdout) { expect(is_expected.target.split("\n").count).to eq(2) } + its(:stdout) { expect(is_expected.target.split("\n").count).to eq(4) } its(:stdout) do result = is_expected.target.split("\n").sort - expect(result[0]).to match('user.analytics.disabled=true') - expect(result[1]).to match(/user.analytics.user-id=.+/) + expect(result[0]).to match(/user.module_defaults.author=.+/) + expect(result[1]).to match(/user.module_defaults.forge_username=.+/) + expect(result[2]).to match(/user.module_defaults.license-url=.+/) + expect(result[3]).to match(/user.module_defaults.template-url=.+/) end its(:stderr) { is_expected.to have_no_output } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 941bfe555..3ccb37f86 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -67,7 +67,6 @@ def execute_script(script) end tempdir = nil -analytics_config = nil # TODO: --path is deprecated # bundler won't install bundler into the --path, so in order to access ::Bundler.with_unbundled_env @@ -97,11 +96,6 @@ def execute_script(script) Dir.chdir(tempdir) puts "Working in #{tempdir}" - analytics_config = Tempfile.new('analytics.yml') - analytics_config.write(YAML.dump('disabled' => true)) - analytics_config.close - ENV['PDK_ANALYTICS_CONFIG'] = analytics_config.path - # Remove PUPPET_GEM_VERSION if it exists in the test environment ENV.delete('PUPPET_GEM_VERSION') end @@ -111,7 +105,6 @@ def execute_script(script) FileUtils.rm_rf(tempdir) FileUtils.rm_rf(RSpec.configuration.template_dir) puts "Cleaned #{tempdir}" - analytics_config.unlink end c.after do |e|