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
@@ -20,6 +20,9 @@ msgstr ""
20
20
  "4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=1"
21
21
  "1 && n%100<=14)? 2 : 3);\n"
22
22
 
23
+ msgid "%s"
24
+ msgstr ""
25
+
23
26
  msgid "%s ago"
24
27
  msgstr "%s назад"
25
28
 
@@ -99,9 +102,18 @@ msgstr "Закрыть"
99
102
  msgid "Concurrency level"
100
103
  msgstr "Параллелизм"
101
104
 
105
+ msgid "Concurrency level limited to"
106
+ msgstr ""
107
+
102
108
  msgid "Control concurrency level and distribution over time"
103
109
  msgstr "Контроль параллельного выполнения и распределения во времени"
104
110
 
111
+ msgid "Could not find any suitable interface for execution"
112
+ msgstr ""
113
+
114
+ msgid "Could not render the preview because no host matches the search query."
115
+ msgstr ""
116
+
105
117
  msgid "Could not use any proxy. Consider configuring %{global_proxy}, %{fallback_proxy} or %{no_proxy} in settings"
106
118
  msgstr ""
107
119
 
@@ -189,12 +201,6 @@ msgstr "Выполнение"
189
201
  msgid "Exit status: %s"
190
202
  msgstr "Код завершения: %s"
191
203
 
192
- msgid "Explanation"
193
- msgstr "Объяснение"
194
-
195
- msgid "Export"
196
- msgstr "Экспорт"
197
-
198
204
  msgid "Export a job template to ERB"
199
205
  msgstr "Экспорт шаблона в ERB"
200
206
 
@@ -300,6 +306,9 @@ msgstr "Шаблоны заданий"
300
306
  msgid "Job category"
301
307
  msgstr "Категория"
302
308
 
309
+ msgid "Job execution failed"
310
+ msgstr ""
311
+
303
312
  msgid "Job finished with error"
304
313
  msgstr "Задание было завершено с ошибкой"
305
314
 
@@ -408,9 +417,6 @@ msgstr "Ожидание"
408
417
  msgid "Perform no more executions after this time"
409
418
  msgstr "Остановить после указанного числа повторений"
410
419
 
411
- msgid "Playbook execution failed"
412
- msgstr ""
413
-
414
420
  msgid "Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port."
415
421
  msgstr ""
416
422
 
@@ -501,12 +507,18 @@ msgstr "SSH"
501
507
  msgid "SSH provider specific options"
502
508
  msgstr "Параметры провайдера SSH"
503
509
 
510
+ msgid "Schedule Remote Job"
511
+ msgstr ""
512
+
504
513
  msgid "Schedule the job for a future time"
505
514
  msgstr "Настроить время запуска"
506
515
 
507
516
  msgid "Schedule the job to start at a later time"
508
517
  msgstr "Отложенный запуск"
509
518
 
519
+ msgid "Scheduled to start at"
520
+ msgstr ""
521
+
510
522
  msgid "Scroll to bottom"
511
523
  msgstr "Перейти вниз"
512
524
 
@@ -537,6 +549,12 @@ msgstr "Выберите все возможные прокси для этой
537
549
  msgid "Selectable values for user inputs"
538
550
  msgstr "Список возможных значений"
539
551
 
552
+ msgid "Set to distribute over"
553
+ msgstr ""
554
+
555
+ msgid "Should the ip addresses on host interfaces be preferred over the fqdn? It is useful, when DNS not resolving the fqdns properly. You may override this per host by setting a parameter called remote_execution_connect_by_ip."
556
+ msgstr ""
557
+
540
558
  msgid "Show foreign input set details"
541
559
  msgstr "Показать информацию о внешнем наборе входных параметров"
542
560
 
@@ -628,12 +646,12 @@ msgstr "Шаблон заблокирован."
628
646
  msgid "This template is locked. Please clone it to a new template to customize."
629
647
  msgstr "Шаблон заблокирован. Скопируйте его для создания нового шаблона на его основе."
630
648
 
631
- msgid "This template is used to generate the description Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
632
- msgstr "Это шаблон для генерации описания. Для того чтобы добавить переменную, используйте синтаксис %{package}; категорию задания — %{job_category}; название шаблона — %{template_name}."
633
-
634
649
  msgid "This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
635
650
  msgstr "Это шаблон для генерации описания. Для того чтобы добавить переменную, используйте синтаксис %{package}; категорию задания — %{job_category}; название шаблона — %{template_name}."
636
651
 
652
+ msgid "This template is used to generate the description.<br/>Input values can be used using the syntax %{package}.<br/>You may also include the job category and template<br/>name using %{job_category} and %{template_name}."
653
+ msgstr ""
654
+
637
655
  msgid "Time span"
638
656
  msgstr "Интервал"
639
657
 
@@ -786,12 +804,18 @@ msgstr "связанный шаблон «%s» не найден"
786
804
  msgid "input macro with name '%s' used, but no input with such name defined for this template"
787
805
  msgstr "ожидается макрос «%s», но входных параметров с таким именем для этого шаблона не обнаружено"
788
806
 
807
+ msgid "minutes"
808
+ msgstr ""
809
+
789
810
  msgid "planned"
790
811
  msgstr "запланировано"
791
812
 
792
813
  msgid "queued"
793
814
  msgstr "в очереди"
794
815
 
816
+ msgid "queued to start executing in %{time}"
817
+ msgstr ""
818
+
795
819
  msgid "remove template input"
796
820
  msgstr "удалить параметр ввода"
797
821
 
@@ -810,6 +834,9 @@ msgstr "завершено"
810
834
  msgid "success"
811
835
  msgstr "успешно"
812
836
 
837
+ msgid "tasks at a time"
838
+ msgstr ""
839
+
813
840
  msgid "template"
814
841
  msgstr "шаблон"
815
842
 
@@ -17,6 +17,9 @@ msgstr ""
17
17
  "Language: zh_CN\n"
18
18
  "Plural-Forms: nplurals=1; plural=0;\n"
19
19
 
20
+ msgid "%s"
21
+ msgstr ""
22
+
20
23
  msgid "%s ago"
21
24
  msgstr "%s 前"
22
25
 
@@ -94,9 +97,18 @@ msgstr "关闭"
94
97
  msgid "Concurrency level"
95
98
  msgstr "并发等级"
96
99
 
100
+ msgid "Concurrency level limited to"
101
+ msgstr ""
102
+
97
103
  msgid "Control concurrency level and distribution over time"
98
104
  msgstr "控制并行等级及分配时间"
99
105
 
106
+ msgid "Could not find any suitable interface for execution"
107
+ msgstr ""
108
+
109
+ msgid "Could not render the preview because no host matches the search query."
110
+ msgstr ""
111
+
100
112
  msgid "Could not use any proxy. Consider configuring %{global_proxy}, %{fallback_proxy} or %{no_proxy} in settings"
101
113
  msgstr ""
102
114
 
@@ -184,12 +196,6 @@ msgstr "执行"
184
196
  msgid "Exit status: %s"
185
197
  msgstr "退出状态:%s"
186
198
 
187
- msgid "Explanation"
188
- msgstr "说明"
189
-
190
- msgid "Export"
191
- msgstr "导出"
192
-
193
199
  msgid "Export a job template to ERB"
194
200
  msgstr "导出任务模版到 ERB"
195
201
 
@@ -295,6 +301,9 @@ msgstr "任务模板"
295
301
  msgid "Job category"
296
302
  msgstr "任务类别"
297
303
 
304
+ msgid "Job execution failed"
305
+ msgstr ""
306
+
298
307
  msgid "Job finished with error"
299
308
  msgstr "任务完成但有错误"
300
309
 
@@ -403,9 +412,6 @@ msgstr "等待处理"
403
412
  msgid "Perform no more executions after this time"
404
413
  msgstr "这个时间后不再执行任何操作"
405
414
 
406
- msgid "Playbook execution failed"
407
- msgstr ""
408
-
409
415
  msgid "Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port."
410
416
  msgstr ""
411
417
 
@@ -496,12 +502,18 @@ msgstr "SSH"
496
502
  msgid "SSH provider specific options"
497
503
  msgstr "SSH 提供者的具体选项"
498
504
 
505
+ msgid "Schedule Remote Job"
506
+ msgstr ""
507
+
499
508
  msgid "Schedule the job for a future time"
500
509
  msgstr "将该任务调度为在将来的某个时间开始"
501
510
 
502
511
  msgid "Schedule the job to start at a later time"
503
512
  msgstr "将该任务调度为于稍后开始"
504
513
 
514
+ msgid "Scheduled to start at"
515
+ msgstr ""
516
+
505
517
  msgid "Scroll to bottom"
506
518
  msgstr "滚动到底部"
507
519
 
@@ -532,6 +544,12 @@ msgstr "为这个子网选择所有可使用的远程执行代理服务器。添
532
544
  msgid "Selectable values for user inputs"
533
545
  msgstr "用户输入的可选值"
534
546
 
547
+ msgid "Set to distribute over"
548
+ msgstr ""
549
+
550
+ msgid "Should the ip addresses on host interfaces be preferred over the fqdn? It is useful, when DNS not resolving the fqdns properly. You may override this per host by setting a parameter called remote_execution_connect_by_ip."
551
+ msgstr ""
552
+
535
553
  msgid "Show foreign input set details"
536
554
  msgstr "显示外部输入集详情"
537
555
 
@@ -621,12 +639,12 @@ msgstr "这个模板已锁定,无法编辑。"
621
639
  msgid "This template is locked. Please clone it to a new template to customize."
622
640
  msgstr "这个模板已锁定。请克隆一个新模板进行编辑。"
623
641
 
624
- msgid "This template is used to generate the description Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
625
- msgstr "这个模板是用来生成描述。可和使用句法 %{package} 输入参数值。还可以和使用 %{job_category} 和 %{template_name} 在其中包含任务类别及模板名称。"
626
-
627
642
  msgid "This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
628
643
  msgstr "这个模板是用来生成描述。可和使用句法 %{package} 输入参数值。还可以和使用 %{job_category} 和 %{template_name} 在其中包含任务类别及模板名称。"
629
644
 
645
+ msgid "This template is used to generate the description.<br/>Input values can be used using the syntax %{package}.<br/>You may also include the job category and template<br/>name using %{job_category} and %{template_name}."
646
+ msgstr ""
647
+
630
648
  msgid "Time span"
631
649
  msgstr "时间跨度"
632
650
 
@@ -779,12 +797,18 @@ msgstr "未找到所包含模板 '%s'"
779
797
  msgid "input macro with name '%s' used, but no input with such name defined for this template"
780
798
  msgstr "名为 '%s' 的输入宏已被使用,但没有为这个模板定义使用这个名称的输入。"
781
799
 
800
+ msgid "minutes"
801
+ msgstr ""
802
+
782
803
  msgid "planned"
783
804
  msgstr ""
784
805
 
785
806
  msgid "queued"
786
807
  msgstr "已排队"
787
808
 
809
+ msgid "queued to start executing in %{time}"
810
+ msgstr ""
811
+
788
812
  msgid "remove template input"
789
813
  msgstr "删除模板输入"
790
814
 
@@ -803,6 +827,9 @@ msgstr "已成功"
803
827
  msgid "success"
804
828
  msgstr "成功"
805
829
 
830
+ msgid "tasks at a time"
831
+ msgstr ""
832
+
806
833
  msgid "template"
807
834
  msgstr "模板"
808
835
 
@@ -17,6 +17,9 @@ msgstr ""
17
17
  "Language: zh_TW\n"
18
18
  "Plural-Forms: nplurals=1; plural=0;\n"
19
19
 
20
+ msgid "%s"
21
+ msgstr ""
22
+
20
23
  msgid "%s ago"
21
24
  msgstr "%s 之前"
22
25
 
@@ -94,9 +97,18 @@ msgstr "關閉"
94
97
  msgid "Concurrency level"
95
98
  msgstr "同步等級"
96
99
 
100
+ msgid "Concurrency level limited to"
101
+ msgstr ""
102
+
97
103
  msgid "Control concurrency level and distribution over time"
98
104
  msgstr "隨時間控制週期等級並散佈"
99
105
 
106
+ msgid "Could not find any suitable interface for execution"
107
+ msgstr ""
108
+
109
+ msgid "Could not render the preview because no host matches the search query."
110
+ msgstr ""
111
+
100
112
  msgid "Could not use any proxy. Consider configuring %{global_proxy}, %{fallback_proxy} or %{no_proxy} in settings"
101
113
  msgstr ""
102
114
 
@@ -184,12 +196,6 @@ msgstr "執行"
184
196
  msgid "Exit status: %s"
185
197
  msgstr "退出狀態:%s"
186
198
 
187
- msgid "Explanation"
188
- msgstr "解釋"
189
-
190
- msgid "Export"
191
- msgstr ""
192
-
193
199
  msgid "Export a job template to ERB"
194
200
  msgstr ""
195
201
 
@@ -295,6 +301,9 @@ msgstr "工作範本"
295
301
  msgid "Job category"
296
302
  msgstr "工作類別"
297
303
 
304
+ msgid "Job execution failed"
305
+ msgstr ""
306
+
298
307
  msgid "Job finished with error"
299
308
  msgstr "工作完成但發生錯誤"
300
309
 
@@ -403,9 +412,6 @@ msgstr "等待處理中"
403
412
  msgid "Perform no more executions after this time"
404
413
  msgstr "此時間之後不再進行任何執行"
405
414
 
406
- msgid "Playbook execution failed"
407
- msgstr ""
408
-
409
415
  msgid "Port to use for SSH communication. Default port 22. You may override per host by setting a parameter called remote_execution_ssh_port."
410
416
  msgstr ""
411
417
 
@@ -496,12 +502,18 @@ msgstr "SSH"
496
502
  msgid "SSH provider specific options"
497
503
  msgstr "SSH 供應者特定選項"
498
504
 
505
+ msgid "Schedule Remote Job"
506
+ msgstr ""
507
+
499
508
  msgid "Schedule the job for a future time"
500
509
  msgstr "排程工作至未來時間"
501
510
 
502
511
  msgid "Schedule the job to start at a later time"
503
512
  msgstr "排程工作至晚一點的時間"
504
513
 
514
+ msgid "Scheduled to start at"
515
+ msgstr ""
516
+
505
517
  msgid "Scroll to bottom"
506
518
  msgstr "捲動至底端"
507
519
 
@@ -532,6 +544,12 @@ msgstr "為此子網路儘可能選擇遠端執行代理。加入有著同樣供
532
544
  msgid "Selectable values for user inputs"
533
545
  msgstr "使用者輸入可選擇的值"
534
546
 
547
+ msgid "Set to distribute over"
548
+ msgstr ""
549
+
550
+ msgid "Should the ip addresses on host interfaces be preferred over the fqdn? It is useful, when DNS not resolving the fqdns properly. You may override this per host by setting a parameter called remote_execution_connect_by_ip."
551
+ msgstr ""
552
+
535
553
  msgid "Show foreign input set details"
536
554
  msgstr "顯示外部輸入集的詳細資料"
537
555
 
@@ -621,12 +639,12 @@ msgstr "此範本已鎖定,因此無法編輯。"
621
639
  msgid "This template is locked. Please clone it to a new template to customize."
622
640
  msgstr "此範本已鎖定。請將它複製至一個新的範本以自訂化。"
623
641
 
624
- msgid "This template is used to generate the description Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
625
- msgstr "這範本是用來產生描述。輸入值可以使用 %{package} 語法。您也可以使用 %{job_category} 與 %{template_name} 來包括工作類別與範本名稱。"
626
-
627
642
  msgid "This template is used to generate the description. Input values can be used using the syntax %{package}. You may also include the job category and template name using %{job_category} and %{template_name}."
628
643
  msgstr "這範本是用來產生描述。輸入值可以使用 %{package} 語法。您也可以使用 %{job_category} 與 %{template_name} 來包括工作類別與範本名稱。"
629
644
 
645
+ msgid "This template is used to generate the description.<br/>Input values can be used using the syntax %{package}.<br/>You may also include the job category and template<br/>name using %{job_category} and %{template_name}."
646
+ msgstr ""
647
+
630
648
  msgid "Time span"
631
649
  msgstr "時間跨度"
632
650
 
@@ -779,12 +797,18 @@ msgstr "找不到包含的範本 '%s'"
779
797
  msgid "input macro with name '%s' used, but no input with such name defined for this template"
780
798
  msgstr "使用了名為 '%s' 的輸入巨集,但此範本並未輸入這樣的名稱"
781
799
 
800
+ msgid "minutes"
801
+ msgstr ""
802
+
782
803
  msgid "planned"
783
804
  msgstr ""
784
805
 
785
806
  msgid "queued"
786
807
  msgstr "已排程"
787
808
 
809
+ msgid "queued to start executing in %{time}"
810
+ msgstr ""
811
+
788
812
  msgid "remove template input"
789
813
  msgstr "移除範本輸入"
790
814
 
@@ -803,6 +827,9 @@ msgstr "已成功"
803
827
  msgid "success"
804
828
  msgstr "成功"
805
829
 
830
+ msgid "tasks at a time"
831
+ msgstr ""
832
+
806
833
  msgid "template"
807
834
  msgstr "範本"
808
835
 
@@ -1,4 +1,4 @@
1
- require "benchmark/benchmark_helper"
1
+ require 'benchmark/benchmark_helper'
2
2
  require 'dynflow/testing'
3
3
 
4
4
  # Add plugin to FactoryGirl's paths
@@ -63,7 +63,7 @@ foreman_benchmark do
63
63
  Benchmark.ips do |x|
64
64
  x.config(:time => 10, :warmup => 0)
65
65
 
66
- x.report("rex-run-hosts-job") do
66
+ x.report('rex-run-hosts-job') do
67
67
  tester.run_action(job_invocation)
68
68
  end
69
69
  end
@@ -1,4 +1,4 @@
1
- require "benchmark/benchmark_helper"
1
+ require 'benchmark/benchmark_helper'
2
2
  require 'dynflow/testing'
3
3
 
4
4
  # Add plugin to FactoryGirl's paths
@@ -23,7 +23,7 @@ foreman_benchmark do
23
23
  Benchmark.ips do |x|
24
24
  x.config(:time => 10, :warmup => 0)
25
25
 
26
- x.report("rex-targeting-resolve-hosts") do
26
+ x.report('rex-targeting-resolve-hosts') do
27
27
  targeting = FactoryGirl.create(:targeting, :search_query => "comment = benchmark-#{Foreman.uuid}", :user => User.current)
28
28
  targeting.resolve_hosts!
29
29
  end
@@ -5,8 +5,8 @@ FactoryGirl.define do
5
5
  sequence(:job_category) { |n| "job name #{n}" }
6
6
  f.template 'id'
7
7
  f.provider_type 'SSH'
8
- organizations { [Organization.find_by_name('Organization 1')] } if SETTINGS[:organizations_enabled]
9
- locations { [Location.find_by_name('Location 1')] } if SETTINGS[:locations_enabled]
8
+ organizations { [Organization.find_by(name: 'Organization 1')] } if SETTINGS[:organizations_enabled]
9
+ locations { [Location.find_by(name: 'Location 1')] } if SETTINGS[:locations_enabled]
10
10
 
11
11
 
12
12
  trait :with_input do
@@ -47,6 +47,13 @@ FactoryGirl.define do
47
47
  end
48
48
 
49
49
  end
50
+
51
+ trait :with_task do
52
+ after(:build) do |invocation, _evaluator|
53
+ invocation.template_invocations << FactoryGirl.build(:template_invocation, :with_task, :with_host)
54
+ invocation.task = FactoryGirl.build(:some_task)
55
+ end
56
+ end
50
57
  end
51
58
 
52
59
  factory :remote_execution_provider do |f|
@@ -56,6 +63,24 @@ FactoryGirl.define do
56
63
  factory :template_invocation do |f|
57
64
  job_invocation
58
65
  association :template, :factory => :job_template
66
+
67
+ trait :with_task do
68
+ after(:build) do |template, _evaluator|
69
+ template.run_host_job_task = FactoryGirl.build(:some_task)
70
+ end
71
+ end
72
+
73
+ trait :with_failed_task do
74
+ after(:build) do |template, _evaluator|
75
+ template.run_host_job_task = FactoryGirl.build(:some_task, :result => 'error')
76
+ end
77
+ end
78
+
79
+ trait :with_host do
80
+ after(:build) do |template, _evaluator|
81
+ template.host = FactoryGirl.build(:host)
82
+ end
83
+ end
59
84
  end
60
85
 
61
86
  factory :template_invocation_input_value do |f|