Skip to content

Commit 0162588

Browse files
committed
Update deprecated Beaker method
The assert_no_match method in Beaker was long deprecated then eventually removed altogether in voxpupuli/beaker@6282311 This commit updates all instances of assert_no_match in Puppet's Beaker tests with refute_match.
1 parent 99ae2cf commit 0162588

33 files changed

+67
-67
lines changed

acceptance/tests/agent/last_run_summary_report.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
step "Check that '#{statedir}' exists and has no 'last_run_summary.yaml' file" do
7676
on(agent, "ls #{statedir}",:acceptable_exit_codes => [0]) do |result|
77-
assert_no_match(/last_run_summary.yaml/, result.stdout)
77+
refute_match(/last_run_summary.yaml/, result.stdout)
7878
end
7979
end
8080

acceptance/tests/environment/should_find_existing_production_environment.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595

9696
step 'Expect no production environment folder changes' do
9797
on(agent, "ls #{custom_environment_path}") do |result|
98-
assert_no_match(/production/, result.stdout)
98+
refute_match(/production/, result.stdout)
9999
end
100100

101101
on(agent, "ls #{default_environment_path}") do |result|
@@ -110,7 +110,7 @@
110110
step 'Expect production environment folder to be recreated in the custom path' do
111111
on(agent, puppet("agent -t"), :acceptable_exit_codes => [0, 2]) do |result|
112112
step 'Expect the module to be gone on the server node' do
113-
assert_no_match(/Error:.*i18ndemo/, result.stderr)
113+
refute_match(/Error:.*i18ndemo/, result.stderr)
114114
end if agent == master
115115

116116
step 'Expect the production environment, along with the module, to be synced back on the agent node' do
@@ -123,7 +123,7 @@
123123
end
124124

125125
on(agent, "ls #{default_environment_path}") do |result|
126-
assert_no_match(/production/, result.stdout)
126+
refute_match(/production/, result.stdout)
127127
end
128128
end
129129

@@ -134,7 +134,7 @@
134134
step 'Expect production environment folder to be found in both paths but use the default one' do
135135
on(agent, puppet("agent -t"), :acceptable_exit_codes => [0, 2]) do |result|
136136
step 'Expect the module to be gone' do
137-
assert_no_match(/Error:.*i18ndemo/, result.stderr)
137+
refute_match(/Error:.*i18ndemo/, result.stderr)
138138
end if agent == master
139139
end
140140

acceptance/tests/environment/use_environment_from_environmentpath.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def run_with_environment(agent, environment, options = {})
180180
end
181181

182182
run_with_environment(agent, "production", :expected_exit_code => 2) do |tmpdir, catalog_result|
183-
assert_no_match(/module-atmp/, catalog_result.stdout, "module-atmp was included despite the default environment being loaded")
183+
refute_match(/module-atmp/, catalog_result.stdout, "module-atmp was included despite the default environment being loaded")
184184

185185
assert_match(/environment fact from module-globalmod/, catalog_result.stdout)
186186

acceptance/tests/language/pcore_resource_types_should_have_precedence_over_ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def refresh
101101

102102
step 'compile catalog and make sure that ruby code is NOT executed' do
103103
on master, puppet('catalog', 'find', master.hostname) do |result|
104-
assert_no_match(/running ruby code/, result.stderr)
104+
refute_match(/running ruby code/, result.stderr)
105105
catalog_results[master.hostname]['pcore_cat'] = JSON.parse(result.stdout.sub(/^[^{]+/,''))
106106
end
107107
end

acceptance/tests/pluginsync/3935_pluginsync_should_follow_symlinks.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
with_puppet_running_on master, master_opts, basedir do
4343
agents.each do |agent|
4444
on(agent, puppet('agent', "-t"))
45-
assert_no_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/pluginfacts/, stderr)
46-
assert_no_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/plugins/, stderr)
45+
refute_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/pluginfacts/, stderr)
46+
refute_match(/Could not retrieve information from environment production source\(s\) puppet:\/\/\/plugins/, stderr)
4747
end
4848
end

acceptance/tests/pluginsync/7316_apps_should_be_available_via_pluginsync.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def main()
7979

8080
step "run the agent" do
8181
on(agent, puppet("agent --libdir='#{agent_lib_dir}' --test --environment '#{tmp_environment}'")) do |result|
82-
assert_no_match(
82+
refute_match(
8383
/The \`source_permissions\` parameter is deprecated/,
8484
result.stderr,
8585
"pluginsync should not get a deprecation warning for source_permissions")

acceptance/tests/provider/package/gem.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'gem' } )
5959
apply_manifest_on(agent, package_manifest, :catch_failures => true) do
6060
list = on(agent, "#{system_gem_command} list").stdout
61-
assert_no_match(/#{package} \(/, list)
61+
refute_match(/#{package} \(/, list)
6262
end
6363
on(agent, "#{system_gem_command} uninstall #{package}")
6464
end
@@ -106,7 +106,7 @@
106106
package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'gem', command: puppet_gem_command } )
107107
apply_manifest_on(agent, package_manifest, :catch_failures => true) do
108108
list = on(agent, "#{puppet_gem_command} list").stdout
109-
assert_no_match(/#{package} \(/, list)
109+
refute_match(/#{package} \(/, list)
110110
end
111111
on(agent, "#{puppet_gem_command} uninstall #{package}")
112112
end

acceptance/tests/provider/package/pip.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'pip' } )
7575
apply_manifest_on(agent, package_manifest, :catch_failures => true) do
7676
list = on(agent, "#{pip_command} list --disable-pip-version-check").stdout
77-
assert_no_match(/#{package} \(/, list)
77+
refute_match(/#{package} \(/, list)
7878
end
7979
end
8080
end

acceptance/tests/provider/package/puppetserver_gem.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
package_manifest = resource_manifest('package', package, { ensure: 'absent', provider: 'puppetserver_gem' } )
3232
apply_manifest_on(master, package_manifest, catch_failures: true) do
3333
list = on(master, "puppetserver gem list").stdout
34-
assert_no_match(/#{package} \(/, list)
34+
refute_match(/#{package} \(/, list)
3535
end
3636
end
3737
end

acceptance/tests/resource/file/bin_diff_output_content_attribute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
on(agent, puppet('apply','--show_diff'), :stdin => manifest) do
5656
assert_match(/content: content changed '{sha256}#{initial_sha_checksum}' to '{sha256}#{updated_sha_checksum}'/, stdout, "#{agent}: checksum of binary file not matched after update")
57-
assert_no_match(/content: Received a Log attribute with invalid encoding:/, stdout, "#{agent}: Received a Log attribute with invalid encoding")
57+
refute_match(/content: Received a Log attribute with invalid encoding:/, stdout, "#{agent}: Received a Log attribute with invalid encoding")
5858
if initial_bin_data.valid_encoding? && updated_bin_data.valid_encoding?
5959
assert_match(/^- ?#{initial_bin_data}$/, stdout, "#{agent}: initial utf-8 data not found in binary diff")
6060
assert_match(/^\+ ?#{updated_bin_data}$/, stdout, "#{agent}: updated utf-8 data not found in binary diff")

0 commit comments

Comments
 (0)