Skip to content

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Jun 13, 2025

This commit introduces Bats tests for ansible-runner to allow testing the manageiq-ansible-venv installation. This tests cover ansible-runner CLI tests as well as tests running through the Ansible::Runner Ruby class, even without database access.

This commit also includes changes to Ansible::Runner itself to allow for better detection of ansible and the manageiq-ansible-venv, allowing the tests to run on the old appliances with python3.9 as well as the new appliances with python3.12.

As such, this can (and should) be merged ahead of ManageIQ/manageiq-rpm_build#573.

I've executed these tests on containers and appliances before and after the RPM upgrade in ManageIQ/manageiq-rpm_build#573 both with and without sourcing the manageiq-ansible-venv.

Testing in containers you do the following:

dnf install bats
git clone https://github.com/bats-core/bats-support ~/.bats/libs/bats-support
git clone https://github.com/bats-core/bats-assert ~/.bats/libs/bats-assert

vmdb
source ./container_env
mkdir -p spec/lib

# Then outside of the container in the manageiq repo you do
# docker cp spec/lib/ansible <container_id>:/var/www/miq/vmdb/spec/lib

$ bats spec/lib/ansible/runner_execution_spec.bats
runner_execution_spec.bats
 ✓ [ansible-runner] runs a playbook
 ✓ [ansible-runner] runs a playbook with variables in a vars file
 ✓ [ansible-runner] runs a playbook with vault encrypted variables
 ✓ [ansible-runner] runs a playbook with variables in a vault encrypted vars file
 ✓ [ansible-runner] runs a playbook using roles from github
 ✓ [ansible-runner] runs a role
 ✓ [ansible-runner] vmware collection
 ✓ [ansible-runner] aws collection
 ✓ [Ansible::Runner] runs a playbook
 ✓ [Ansible::Runner] runs a playbook with variables in a vars file
 - [Ansible::Runner] runs a playbook with vault encrypted variables (skipped: requires database access)
 - [Ansible::Runner] runs a playbook with variables in a vault encrypted vars file (skipped: requires database access)
 ✓ [Ansible::Runner] runs a playbook using roles from github
 ✓ [Ansible::Runner] runs a role
 ✓ [Ansible::Runner] vmware collection
 ✓ [Ansible::Runner] aws collection

16 tests, 0 failures, 2 skipped

Folow ups:

  • Add the new aws and vmware tests to the rspec tests.
  • Add tests for all of the other collections

end

def venv_bin_path
Dir.glob(File.join(VENV_ROOT, "bin")).first
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is "clever", but it's effectively a way to check the presence of a directory and return nil if not present

setup_file() {
export BATS_LIB_PATH="$HOME/.bats/libs:$BATS_LIB_PATH"

export PYTHON_VERSION="3.12"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If testing before the upgrade to python3.12, you just have to change this to 3.9. Note that aws will fail, but that's because it's actually broken right now. 🙃 This test actually found the bug.

@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from 318292e to e4288c7 Compare June 13, 2025 22:54
@Fryguy Fryguy requested a review from jrafanie as a code owner June 13, 2025 22:54
return true unless requirements_file.exist?

require "awesome_spawn"
AwesomeSpawn.run!("ansible-galaxy", :params => ["install", {:roles_path= => roles_dir, :role_file= => requirements_file}])
AwesomeSpawn.run!("ansible-galaxy", :env => env, :params => ["install", {:roles_path= => roles_dir, :role_file= => requirements_file}])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new rpm changes, ansible-galaxy now lives inside the venv, so we need the venv environment in order to even run it.

@@ -221,6 +221,8 @@ def run_via_cli(hosts, credentials, env_vars, extra_vars, tags: nil, ansible_run

params = runner_params(base_dir, ansible_runner_method, playbook_or_role_args, verbosity)

# puts "#{env_vars_hash.map { |k, v| "#{k}=#{v}" }.join(" ")} #{AwesomeSpawn.build_command_line("ansible-runner", params)}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a debug thing that I do ALL THE TIME. I'm just leaving it in the code now :)

end

def runner_env
{"PYTHONPATH" => python_path}.delete_nils
{"PYTHONPATH" => runner_python_path, "PATH" => runner_path}.compact
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, we should have been setting the path before as well, which is why this change works on the old python3.9 and the new python3.12. On either version, the virtual env activate sets both of these.

def ansible_python_version_raw
`ansible --version 2>/dev/null`.chomp
ansible = venv_bin_path ? File.join(venv_bin_path, "ansible") : "ansible"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking this allows it to run locally, on the old appliance where it doesn't live in the venv, and on the new appliance where is does live in the venv.

@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from e4288c7 to 2636165 Compare June 14, 2025 00:27
}

@test "[Ansible::Runner] runs a playbook with vault encrypted variables" {
skip "requires database access"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is annoying. The way creds work through Ansible::Runner requires an Authentication record in the database, and then the interface expect the Authentication id. I don't like that and IMO, Ansible::Runner should be database agnostic. It should accept string or perhaps an object that responds_to something, but not a literal ActiveRecord id.

Because of this, on a raw container where we don't have the database, I can't run this test. The same test is above via CLI, so I'm not too worried about it.

I've already written up a change where the interface can accept a String or an object, but I want that in a separate PR.

@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from 2636165 to 69fe8f3 Compare June 16, 2025 22:01
@Fryguy Fryguy changed the title [WIP] Add appliance/container tests for ansible-runner Add appliance/container tests for ansible-runner Jun 16, 2025
@miq-bot miq-bot removed the wip label Jun 16, 2025
@Fryguy
Copy link
Member Author

Fryguy commented Jun 16, 2025

@bdunne This is ready to go.

@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from 69fe8f3 to d958a8f Compare June 17, 2025 02:29
@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from d958a8f to a7312a3 Compare June 17, 2025 02:33
def venv_python_path
return @venv_python_path if defined?(@venv_python_path)

@venv_python_path = Dir.glob(File.join(VENV_ROOT, "lib/python*/site-packages")).first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to change the * to 3.12 before merge?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, let me do that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

This commit introduces Bats tests for ansible-runner to allow testing
the manageiq-ansible-venv installation. This tests cover ansible-runner
CLI tests as well as tests running through the Ansible::Runner Ruby
class, even without database access.

This commit also includes changes to Ansible::Runner itself to allow for
better detection of ansible and the manageiq-ansible-venv, allowing the
tests to run on the old appliances with python3.9 as well as the new
appliances with python3.12.
@Fryguy Fryguy force-pushed the add_ansible_runner_appliance_tests branch from a7312a3 to 707b594 Compare June 17, 2025 17:49
@miq-bot
Copy link
Member

miq-bot commented Jun 17, 2025

Checked commit Fryguy@707b594 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.62.0, and yamllint
5 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Rubocop - Linter::Rubocop STDERR:
`EnsureNode#body` is deprecated and will be changed in the next major version of rubocop-ast. Use `EnsureNode#branch` instead to get the body of the `ensure` branch.
Called from:
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:88:in `check_ensure_node'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:65:in `check_branch'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:100:in `check_begin_node'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:67:in `check_branch'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:100:in `check_begin_node'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:67:in `check_branch'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/style/redundant_assignment.rb:51:in `on_def'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `public_send'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `block (2 levels) in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:171:in `with_cop_error_handling'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:106:in `block in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:69:in `on_def'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_sclass'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_class'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_class'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_module'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:87:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:156:in `investigate_partial'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:98:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:345:in `block in inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `flat_map'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:287:in `block in do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:321:in `block in iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:283:in `do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:164:in `block in file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:189:in `file_offense_cache'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:163:in `file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:154:in `process_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:135:in `block in each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `reduce'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:120:in `inspect_files'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:73:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command.rb:11:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/environment.rb:18:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:118:in `run_command'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:125:in `execute_runners'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:51:in `block in run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:77:in `profile_if_needed'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:43:in `run'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `block in <top (required)>'
/usr/share/ruby/benchmark.rb:311:in `realtime'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `<top (required)>'
/usr/bin/rubocop:25:in `load'
/usr/bin/rubocop:25:in `<main>'

`EnsureNode#body` is deprecated and will be changed in the next major version of rubocop-ast. Use `EnsureNode#branch` instead to get the body of the `ensure` branch.
Called from:
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/layout/indentation_width.rb:67:in `on_ensure'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `public_send'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `block (2 levels) in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:171:in `with_cop_error_handling'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:106:in `block in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:69:in `on_ensure'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_kwbegin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_def'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_def'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_sclass'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_class'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_class'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_module'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:87:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:156:in `investigate_partial'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:98:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:345:in `block in inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `flat_map'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:287:in `block in do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:321:in `block in iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:283:in `do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:164:in `block in file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:189:in `file_offense_cache'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:163:in `file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:154:in `process_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:135:in `block in each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `reduce'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:120:in `inspect_files'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:73:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command.rb:11:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/environment.rb:18:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:118:in `run_command'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:125:in `execute_runners'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:51:in `block in run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:77:in `profile_if_needed'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:43:in `run'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `block in <top (required)>'
/usr/share/ruby/benchmark.rb:311:in `realtime'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `<top (required)>'
/usr/bin/rubocop:25:in `load'
/usr/bin/rubocop:25:in `<main>'

`EnsureNode#body` is deprecated and will be changed in the next major version of rubocop-ast. Use `EnsureNode#branch` instead to get the body of the `ensure` branch.
Called from:
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/lint/empty_ensure.rb:51:in `on_ensure'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `public_send'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `block (2 levels) in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:171:in `with_cop_error_handling'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:106:in `block in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:69:in `on_ensure'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_kwbegin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_def'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_def'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_sclass'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_class'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_class'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_module'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:87:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:156:in `investigate_partial'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:98:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:345:in `block in inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `flat_map'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:287:in `block in do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:321:in `block in iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:283:in `do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:164:in `block in file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:189:in `file_offense_cache'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:163:in `file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:154:in `process_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:135:in `block in each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `reduce'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:120:in `inspect_files'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:73:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command.rb:11:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/environment.rb:18:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:118:in `run_command'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:125:in `execute_runners'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:51:in `block in run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:77:in `profile_if_needed'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:43:in `run'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `block in <top (required)>'
/usr/share/ruby/benchmark.rb:311:in `realtime'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `<top (required)>'
/usr/bin/rubocop:25:in `load'
/usr/bin/rubocop:25:in `<main>'

`EnsureNode#body` is deprecated and will be changed in the next major version of rubocop-ast. Use `EnsureNode#branch` instead to get the body of the `ensure` branch.
Called from:
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/lint/ensure_return.rb:54:in `on_ensure'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `public_send'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:107:in `block (2 levels) in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:171:in `with_cop_error_handling'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:106:in `block in trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:105:in `trigger_responding_cops'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:69:in `on_ensure'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_kwbegin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_def'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_def'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `block in on_dstr'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `each'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:146:in `on_dstr'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_begin'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_sclass'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:163:in `on_class'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_class'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:147:in `on_while'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:71:in `on_module'
/usr/share/gems/gems/rubocop-ast-1.44.0/lib/rubocop/ast/traversal.rb:20:in `walk'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/commissioner.rb:87:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:156:in `investigate_partial'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cop/team.rb:98:in `investigate'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:345:in `block in inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `flat_map'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:344:in `inspect_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:287:in `block in do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:321:in `block in iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:314:in `iterate_until_no_changes'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:283:in `do_inspection_loop'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:164:in `block in file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:189:in `file_offense_cache'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:163:in `file_offenses'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:154:in `process_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:135:in `block in each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `reduce'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:134:in `each_inspected_file'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:120:in `inspect_files'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/runner.rb:73:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:26:in `block in execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:52:in `with_redirect'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:25:in `execute_runner'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command/execute_runner.rb:17:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/command.rb:11:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli/environment.rb:18:in `run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:118:in `run_command'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:125:in `execute_runners'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:51:in `block in run'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:77:in `profile_if_needed'
/usr/share/gems/gems/rubocop-1.56.3/lib/rubocop/cli.rb:43:in `run'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `block in <top (required)>'
/usr/share/ruby/benchmark.rb:311:in `realtime'
/usr/share/gems/gems/rubocop-1.56.3/exe/rubocop:19:in `<top (required)>'
/usr/bin/rubocop:25:in `load'
/usr/bin/rubocop:25:in `<main>'


@miq-bot
Copy link
Member

miq-bot commented Jun 17, 2025

Some comments on commit Fryguy@707b594

lib/tasks/test_security_helper.rb

  • ⚠️ - 26 - Detected puts. Remove all debugging statements.

spec/lib/ansible/runner_execution_spec.bats

  • ⚠️ - 135 - Detected puts. Remove all debugging statements.
  • ⚠️ - 139 - Detected puts. Remove all debugging statements.

@bdunne bdunne merged commit 3d3b8ae into ManageIQ:master Jun 17, 2025
8 checks passed
@Fryguy Fryguy deleted the add_ansible_runner_appliance_tests branch July 11, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants