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

Fix Build: handle awesome spawn update #22772

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Nov 2, 2023

handle change in attributes passed to CommandResult#initialize

  10) Ansible::Runner.run with special characters calls launch with expected arguments
      Failure/Error: let(:result)     { AwesomeSpawn::CommandResult.new("ansible-runner", "output", "", "0") }

      ArgumentError:
        wrong number of arguments (given 4, expected 5)
      # /Users/kbrock/.gem/ruby/3.0.6/gems/awesome_spawn-1.6.0/lib/awesome_spawn/command_result.rb:5:in `initialize'
      # ./spec/lib/ansible/runner_spec.rb:6:in `new'
      # ./spec/lib/ansible/runner_spec.rb:6:in `block (2 levels) in <main>'

@kbrock kbrock added the test label Nov 2, 2023
@kbrock kbrock requested a review from Fryguy as a code owner November 2, 2023 16:01
@kbrock kbrock changed the title handle awesome spawn update Fix Build: handle awesome spawn update Nov 2, 2023
@Fryguy
Copy link
Member

Fryguy commented Nov 2, 2023

We probably want to move to stub_good/bad_run here - cc @agrare

@Fryguy
Copy link
Member

Fryguy commented Nov 2, 2023

@kbrock Can you also change the gem reference to enforce 1.6.0 as a minimum version? This will fail in the reverse direction is the old gem is still used.

@miq-bot
Copy link
Member

miq-bot commented Nov 2, 2023

Checked commit kbrock@2a509aa with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@kbrock
Copy link
Member Author

kbrock commented Nov 2, 2023

Darn. We do not depend upon awesome spawn. Would prefer not to add it.

Agree with the need though. researching

@agrare
Copy link
Member

agrare commented Nov 2, 2023

Darn. We do not depend upon awesome spawn. Would prefer not to add it.

If we use it in core code I think we have to have it in our Gemfile

@Fryguy
Copy link
Member

Fryguy commented Nov 2, 2023

It's probably in manageiq-gems-pending.

@Fryguy Fryguy merged commit 8fb050f into ManageIQ:master Nov 2, 2023
@Fryguy Fryguy self-assigned this Nov 2, 2023
@kbrock kbrock deleted the awesome_spawn_command branch November 2, 2023 17:28
@kbrock
Copy link
Member Author

kbrock commented Nov 2, 2023

Did try this but it got in my way:

#require "awesome_spawn/spec_helper"
#  include AwesomeSpawn::SpecHelper

    # anything = Pathname.new(...)
    it "runs ansible-runner with the role" do
      expect(Ansible::Runner).to receive(:async?).and_return(false)
      stub_good_run!("ansible-runner", :env => a_hash_including(env_vars),
        :params => ["start", anything(), :json, {:ident => "result", :role => role_name, :roles_path => role_path, :role_skip_facts => nil}]
      )
      described_class.run_role_async(env_vars, extra_vars, role_name, :roles_path => role_path)
    end

@Fryguy
Copy link
Member

Fryguy commented Nov 8, 2023

Backported to quinteros in commit 04ae74b.

commit 04ae74b73b585392d7ba9fb6474638dd8b470380
Author: Jason Frey <[email protected]>
Date:   Thu Nov 2 12:29:28 2023 -0400

    Merge pull request #22772 from kbrock/awesome_spawn_command
    
    Fix Build: handle awesome spawn update
    
    (cherry picked from commit 8fb050f96962da3870011386b5a4178c7851ca89)

Fryguy added a commit that referenced this pull request Nov 8, 2023
Fix Build: handle awesome spawn update

(cherry picked from commit 8fb050f)
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