foreman_remote_execution 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +28 -2
  3. data/.rubocop_todo.yml +0 -7
  4. data/Gemfile +1 -1
  5. data/app/controllers/api/v2/foreign_input_sets_controller.rb +1 -2
  6. data/app/controllers/api/v2/job_invocations_controller.rb +2 -2
  7. data/app/controllers/api/v2/job_templates_controller.rb +2 -3
  8. data/app/controllers/api/v2/remote_execution_features_controller.rb +1 -2
  9. data/app/controllers/api/v2/template_inputs_controller.rb +1 -2
  10. data/app/controllers/concerns/foreman/controller/parameters/job_template.rb +3 -3
  11. data/app/controllers/concerns/foreman/controller/parameters/template_input.rb +2 -2
  12. data/app/controllers/job_invocations_controller.rb +4 -7
  13. data/app/controllers/job_templates_controller.rb +2 -2
  14. data/app/controllers/remote_execution_features_controller.rb +1 -2
  15. data/app/helpers/remote_execution_helper.rb +22 -17
  16. data/app/lib/actions/remote_execution/run_host_job.rb +4 -10
  17. data/app/models/concerns/foreman_remote_execution/host_extensions.rb +29 -1
  18. data/app/models/host_status/execution_status.rb +1 -1
  19. data/app/models/input_template_renderer.rb +1 -1
  20. data/app/models/job_invocation.rb +12 -7
  21. data/app/models/job_invocation_composer.rb +15 -6
  22. data/app/models/job_invocation_task_group.rb +1 -1
  23. data/app/models/job_template.rb +45 -29
  24. data/app/models/job_template_importer.rb +21 -9
  25. data/app/models/remote_execution_feature.rb +4 -4
  26. data/app/models/setting/remote_execution.rb +7 -5
  27. data/app/models/ssh_execution_provider.rb +1 -3
  28. data/app/models/targeting.rb +6 -5
  29. data/app/models/template_invocation.rb +43 -1
  30. data/app/views/job_invocations/_form.html.erb +1 -1
  31. data/app/views/job_invocations/_tab_overview.html.erb +10 -1
  32. data/config/routes.rb +2 -2
  33. data/db/migrate/20150903192731_add_execution_to_interface.rb +6 -6
  34. data/db/migrate/20151215114631_add_host_id_to_template_invocation.rb +3 -2
  35. data/db/migrate/20160114120200_rename_job_categories.rb +1 -1
  36. data/db/migrate/20160127134031_add_advanced_to_template_input.rb +1 -1
  37. data/db/seeds.d/70-job_templates.rb +1 -1
  38. data/db/seeds.d/90-bookmarks.rb +1 -1
  39. data/doc/Gemfile +1 -1
  40. data/lib/foreman_remote_execution/engine.rb +1 -1
  41. data/lib/foreman_remote_execution/version.rb +1 -1
  42. data/lib/tasks/foreman_remote_execution_tasks.rake +1 -1
  43. data/locale/action_names.rb +1 -1
  44. data/locale/de/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  45. data/locale/de/foreman_remote_execution.po +39 -12
  46. data/locale/en/foreman_remote_execution.po +38 -11
  47. data/locale/en_GB/foreman_remote_execution.po +38 -11
  48. data/locale/es/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  49. data/locale/es/foreman_remote_execution.po +39 -12
  50. data/locale/foreman_remote_execution.pot +175 -141
  51. data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  52. data/locale/fr/foreman_remote_execution.po +39 -12
  53. data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  54. data/locale/ja/foreman_remote_execution.po +39 -12
  55. data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  56. data/locale/ko/foreman_remote_execution.po +39 -12
  57. data/locale/pt_BR/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  58. data/locale/pt_BR/foreman_remote_execution.po +39 -12
  59. data/locale/ru/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  60. data/locale/ru/foreman_remote_execution.po +39 -12
  61. data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  62. data/locale/zh_CN/foreman_remote_execution.po +39 -12
  63. data/locale/zh_TW/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  64. data/locale/zh_TW/foreman_remote_execution.po +39 -12
  65. data/test/benchmark/run_hosts_job_benchmark.rb +2 -2
  66. data/test/benchmark/targeting_benchmark.rb +2 -2
  67. data/test/factories/foreman_remote_execution_factories.rb +27 -2
  68. data/test/functional/api/v2/job_templates_controller_test.rb +1 -1
  69. data/test/test_plugin_helper.rb +2 -19
  70. data/test/unit/concerns/host_extensions_test.rb +54 -5
  71. data/test/unit/concerns/nic_extensions_test.rb +1 -1
  72. data/test/unit/execution_task_status_mapper_test.rb +1 -2
  73. data/test/unit/input_template_renderer_test.rb +1 -1
  74. data/test/unit/job_invocation_composer_test.rb +21 -29
  75. data/test/unit/job_invocation_test.rb +1 -2
  76. data/test/unit/job_template_effective_user_test.rb +1 -1
  77. data/test/unit/job_template_importer_test.rb +38 -20
  78. data/test/unit/job_template_test.rb +8 -8
  79. data/test/unit/remote_execution_feature_test.rb +6 -6
  80. data/test/unit/remote_execution_provider_test.rb +2 -1
  81. data/test/unit/targeting_test.rb +6 -6
  82. data/test/unit/template_input_test.rb +1 -1
  83. data/test/unit/template_invocation_input_value_test.rb +3 -3
  84. metadata +3 -3
@@ -1,6 +1,6 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
- describe RemoteExecutionProvider do
3
+ class RemoteExecutionProviderTest < ActiveSupport::TestCase
4
4
  describe '.providers' do
5
5
  let(:providers) { RemoteExecutionProvider.providers }
6
6
  it { providers.must_be_kind_of HashWithIndifferentAccess }
@@ -13,6 +13,7 @@ describe RemoteExecutionProvider do
13
13
  end
14
14
 
15
15
  describe '.register_provider' do
16
+ before { RemoteExecutionProvider.providers.delete(:new) }
16
17
  let(:new_provider) { RemoteExecutionProvider.providers[:new] }
17
18
  it { new_provider.must_be_nil }
18
19
 
@@ -1,6 +1,6 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
- describe Targeting do
3
+ class TargetingTest < ActiveSupport::TestCase
4
4
  let(:targeting) { FactoryGirl.build(:targeting) }
5
5
  let(:bookmark) { bookmarks(:one) }
6
6
  let(:host) { FactoryGirl.create(:host) }
@@ -88,10 +88,10 @@ describe Targeting do
88
88
  context 'for two hosts' do
89
89
  let(:query) { Targeting.build_query_from_hosts([ host.id, second_host.id ]) }
90
90
 
91
- it 'builds query using host names joining with or' do
92
- query.must_include "name = #{host.name}"
93
- query.must_include "name = #{second_host.name}"
94
- query.must_include ' or '
91
+ it 'builds query using host names joining inside ^' do
92
+ query.must_include host.name
93
+ query.must_include second_host.name
94
+ query.must_include 'name ^'
95
95
 
96
96
  Host.search_for(query).must_include host
97
97
  Host.search_for(query).must_include second_host
@@ -102,7 +102,7 @@ describe Targeting do
102
102
  let(:query) { Targeting.build_query_from_hosts([ host.id ]) }
103
103
 
104
104
  it 'builds query using host name' do
105
- query.must_equal "name = #{host.name}"
105
+ query.must_equal "name ^ (#{host.name})"
106
106
  Host.search_for(query).must_include host
107
107
  Host.search_for(query).wont_include second_host
108
108
  end
@@ -1,6 +1,6 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
- describe TemplateInput do
3
+ class TemplateInputTest < ActiveSupport::TestCase
4
4
  let(:template_input) { FactoryGirl.build(:template_input) }
5
5
 
6
6
  context 'export' do
@@ -1,6 +1,6 @@
1
1
  require 'test_plugin_helper'
2
2
 
3
- describe TemplateInvocationInputValue do
3
+ class TemplateInvocationInputTest < ActiveSupport::TestCase
4
4
  let(:template) { FactoryGirl.build(:job_template, :template => 'service restart <%= input("service_name") -%>') }
5
5
  let(:renderer) { InputTemplateRenderer.new(template) }
6
6
  let(:job_invocation) { FactoryGirl.create(:job_invocation) }
@@ -29,10 +29,10 @@ describe TemplateInvocationInputValue do
29
29
 
30
30
  it 'supports large inputs' do
31
31
  template.template_inputs << FactoryGirl.build(:template_input, :name => 'service_name',
32
- :input_type => 'user', :required => true)
32
+ :input_type => 'user', :required => true)
33
33
  assert_valid FactoryGirl.create(:template_invocation_input_value,
34
34
  :template_invocation => template_invocation,
35
35
  :template_input => template.template_inputs.first,
36
- :value => 'foreman' * 1000000)
36
+ :value => 'foreman' * 1_000_000)
37
37
  end
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -428,7 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
428
428
  version: '0'
429
429
  requirements: []
430
430
  rubyforge_project:
431
- rubygems_version: 2.5.1
431
+ rubygems_version: 2.4.5
432
432
  signing_key:
433
433
  specification_version: 4
434
434
  summary: A plugin bringing remote execution to the Foreman, completing the config