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

Use the smart_proxy_plugin.yml reusable GHA workflow #95

Merged
merged 4 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ jobs:
test:
name: Tests
needs: rubocop
uses: theforeman/actions/.github/workflows/test-gem.yml@v0
with:
command: bundle exec rake test
uses: theforeman/actions/.github/workflows/smart_proxy_plugin.yml@v0
...
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ group :rubocop do
end

group :test do
gem 'ci_reporter_test_unit'
gem 'mocha', '~> 1'
gem 'rack-test'
gem 'rake', '~> 13'
gem 'smart_proxy', github: 'theforeman/smart-proxy', branch: 'develop'
gem 'smart_proxy', github: 'theforeman/smart-proxy', branch: ENV.fetch('SMART_PROXY_BRANCH', 'develop')
gem 'test-unit', '~> 3'
gem 'webmock', '~> 1'
end
11 changes: 0 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,3 @@ RuboCop::RakeTask.new(:rubocop) do |task|
task.patterns = ['bin/foreman-node', 'lib/**/*.rb', 'test/**/*.rb']
task.fail_on_error = false
end

begin
require 'ci/reporter/rake/test_unit'
rescue LoadError
# test group not enabled
else
namespace :jenkins do
desc nil # No description means it's not listed in rake -T
task unit: ['ci:setup:testunit', :test]
end
end
2 changes: 1 addition & 1 deletion smart_proxy_salt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = Dir['{bin,etc,lib/smart_proxy_salt,salt,sbin,settings.d,bundler.d}/**/*'] + ['lib/smart_proxy_salt.rb'] + s.extra_rdoc_files
s.executables = s.files.grep(%r{^bin/}) { |file| File.basename(file) }
s.homepage = 'https://github.com/theforeman/smart_proxy_salt'
s.license = 'GPL-3.0'
s.license = 'GPL-3.0-only'
s.required_ruby_version = '>= 2.7', '< 4'
s.add_runtime_dependency('smart_proxy_dynflow', '~> 0.5', '>= 0.5.0')
end
8 changes: 6 additions & 2 deletions test/unit/salt_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ def test_capture_jid
def test_override_exit_status
runner = SaltRunner.new({}, :suspended_action => nil)
assert_nil runner.jid
assert_equal 1, runner.publish_exit_status(0)
runner.publish_exit_status(0)
updates = runner.generate_updates
assert_equal 1, updates[{:suspended_action => nil}].exit_status
runner.publish_data('jid: 12345', 'stdout')
assert_equal 0, runner.publish_exit_status(0)
runner.publish_exit_status(0)
updates = runner.generate_updates
assert_equal 0, updates[{:suspended_action => nil}].exit_status
Comment on lines -35 to +41
Copy link
Member

Choose a reason for hiding this comment

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

@adamruzicka would you mind having a look here whether the test fix looks sane to you? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, thank you.

end

def test_generate_command
Expand Down