rocketjob_mission_control 3.0.3 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +4 -0
- data/app/assets/fonts/webfonts/fa-brands-400.eot +0 -0
- data/app/assets/fonts/webfonts/fa-brands-400.woff +0 -0
- data/app/assets/fonts/webfonts/fa-brands-400.woff2 +0 -0
- data/app/assets/fonts/webfonts/fa-regular-400.eot +0 -0
- data/app/assets/fonts/webfonts/fa-regular-400.woff +0 -0
- data/app/assets/fonts/webfonts/fa-regular-400.woff2 +0 -0
- data/app/assets/fonts/webfonts/fa-solid-900.eot +0 -0
- data/app/assets/fonts/webfonts/fa-solid-900.woff +0 -0
- data/app/assets/fonts/webfonts/fa-solid-900.woff2 +0 -0
- data/app/assets/images/rocket_job_mission_control/android-chrome-192x192.png +0 -0
- data/app/assets/images/rocket_job_mission_control/android-chrome-512x512.png +0 -0
- data/app/assets/images/rocket_job_mission_control/apple-touch-icon.png +0 -0
- data/app/assets/images/rocket_job_mission_control/favicon-16x16.png +0 -0
- data/app/assets/images/rocket_job_mission_control/favicon-32x32.png +0 -0
- data/app/assets/images/rocket_job_mission_control/favicon.ico +0 -0
- data/app/assets/images/rocket_job_mission_control/favicon.png +0 -0
- data/app/assets/images/rocket_job_mission_control/mstile-150x150.png +0 -0
- data/app/assets/images/rocket_job_mission_control/safari-pinned-tab.svg +188 -0
- data/app/assets/javascripts/rocket_job_mission_control/datatable.js +2 -1
- data/app/assets/stylesheets/rocket_job_mission_control/application.scss +5 -4
- data/app/assets/stylesheets/rocket_job_mission_control/base.scss +39 -65
- data/app/assets/stylesheets/rocket_job_mission_control/callout.scss +14 -2
- data/app/datatables/rocket_job_mission_control/active_workers_datatable.rb +1 -1
- data/app/datatables/rocket_job_mission_control/dirmon_entries_datatable.rb +1 -1
- data/app/datatables/rocket_job_mission_control/jobs_datatable.rb +21 -16
- data/app/datatables/rocket_job_mission_control/servers_datatable.rb +1 -1
- data/app/helpers/rocket_job_mission_control/application_helper.rb +18 -16
- data/app/helpers/rocket_job_mission_control/jobs_helper.rb +11 -6
- data/app/views/layouts/rocket_job_mission_control/application.html.erb +30 -28
- data/app/views/layouts/rocket_job_mission_control/partials/_flash.html.erb +5 -4
- data/app/views/layouts/rocket_job_mission_control/partials/_header.html.erb +23 -19
- data/app/views/layouts/rocket_job_mission_control/partials/_sidebar.html.erb +5 -4
- data/app/views/rocket_job_mission_control/active_workers/index.html.erb +13 -8
- data/app/views/rocket_job_mission_control/dirmon_entries/_form.html.erb +31 -21
- data/app/views/rocket_job_mission_control/dirmon_entries/_sidebar.html.erb +12 -9
- data/app/views/rocket_job_mission_control/dirmon_entries/_status.html.erb +5 -2
- data/app/views/rocket_job_mission_control/dirmon_entries/edit.html.erb +4 -3
- data/app/views/rocket_job_mission_control/dirmon_entries/index.html.erb +16 -14
- data/app/views/rocket_job_mission_control/dirmon_entries/new.html.erb +5 -4
- data/app/views/rocket_job_mission_control/dirmon_entries/show.html.erb +19 -14
- data/app/views/rocket_job_mission_control/jobs/_pagination.html.erb +9 -5
- data/app/views/rocket_job_mission_control/jobs/_sidebar.html.erb +9 -8
- data/app/views/rocket_job_mission_control/jobs/_status.html.erb +18 -10
- data/app/views/rocket_job_mission_control/jobs/edit.html.erb +22 -15
- data/app/views/rocket_job_mission_control/jobs/exception.html.erb +14 -10
- data/app/views/rocket_job_mission_control/jobs/exceptions.html.erb +27 -25
- data/app/views/rocket_job_mission_control/jobs/index.html.erb +16 -13
- data/app/views/rocket_job_mission_control/jobs/show.html.erb +25 -20
- data/app/views/rocket_job_mission_control/servers/_sidebar.html.erb +8 -6
- data/app/views/rocket_job_mission_control/servers/index.html.erb +18 -14
- data/config/initializers/assets.rb +13 -0
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/test/controllers/rocket_job_mission_control/dirmon_entries_controller_test.rb +4 -6
- data/test/controllers/rocket_job_mission_control/jobs_controller_test.rb +18 -15
- data/test/helpers/rocket_job_mission_control/jobs_helper_test.rb +12 -6
- data/test/helpers/rocket_job_mission_control/servers_helper_test.rb +3 -4
- data/vendor/assets/stylesheets/fontawesome-all.min.css +5 -0
- data/vendor/assets/stylesheets/{selectize.default.css → selectize.bootstrap3.css} +134 -113
- metadata +39 -13
@@ -1,17 +1,21 @@
|
|
1
|
-
<div class=
|
2
|
-
<div class=
|
3
|
-
<div class=
|
4
|
-
<div class=
|
5
|
-
<div class=
|
6
|
-
|
1
|
+
<div class='row'>
|
2
|
+
<div class='col-md-8'>
|
3
|
+
<div class='job-status'>
|
4
|
+
<div class='failures'>
|
5
|
+
<div class='lead'><%= link_to(@job.class.name, job_path(@job)) %>: <%= @failure_exception.class_name %></div>
|
6
|
+
|
7
|
+
<div class='pagination-buttons pull-right'>
|
7
8
|
<%= render partial: 'pagination', locals: {error_type: @failure_exception.class_name, pagination: @pagination} %>
|
8
9
|
</div>
|
9
|
-
|
10
|
-
<div class=
|
10
|
+
|
11
|
+
<div class='clearfix'></div>
|
12
|
+
|
13
|
+
<div class='message'>
|
11
14
|
<pre><code><%= @failure_exception.message %></code></pre>
|
12
15
|
</div>
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
<div class='error'>
|
18
|
+
<pre class='small'><%= @failure_exception.backtrace.join("\n") %></pre>
|
15
19
|
</div>
|
16
20
|
</div>
|
17
21
|
</div>
|
@@ -1,39 +1,41 @@
|
|
1
|
-
<div class=
|
2
|
-
<div class=
|
3
|
-
<div class=
|
4
|
-
<div class=
|
1
|
+
<div class='job-list'>
|
2
|
+
<div class='list'>
|
3
|
+
<div class='row'>
|
4
|
+
<div class='col-sm-10'>
|
5
5
|
<h2>Exceptions for <%= @job.class.name %></h2>
|
6
6
|
<%= link_to(@job.class.name, job_path(@job)) %>
|
7
7
|
<%= h(@job.description) %>
|
8
8
|
</div>
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
|
10
|
+
<div class='col-sm-2'>
|
11
|
+
<div class='btn btn-default pull-right dt-reload' data-behavior='reload'>
|
12
|
+
<i class='fas fa-sync'></i>
|
12
13
|
</div>
|
13
14
|
</div>
|
14
15
|
</div>
|
16
|
+
|
15
17
|
<table class='table datatable jobs-datatable' data-source='<%= jobs_url(format: 'json') %>' style='width: 100%'>
|
16
18
|
<thead>
|
17
|
-
<tr>
|
18
|
-
<th>Count</th>
|
19
|
-
<th>Exception Class</th>
|
20
|
-
<th>Exception Messages</th>
|
21
|
-
</tr>
|
22
|
-
</thead>
|
23
|
-
<tbody>
|
24
|
-
<% @exceptions.each do |exception| %>
|
25
19
|
<tr>
|
26
|
-
<th
|
27
|
-
<th>
|
28
|
-
|
29
|
-
</th>
|
30
|
-
<th>
|
31
|
-
<% exception.messages.each do |message| %>
|
32
|
-
<div><%= message %></div>
|
33
|
-
<% end %>
|
34
|
-
</th>
|
20
|
+
<th>Count</th>
|
21
|
+
<th>Exception Class</th>
|
22
|
+
<th>Exception Messages</th>
|
35
23
|
</tr>
|
36
|
-
|
24
|
+
</thead>
|
25
|
+
|
26
|
+
<tbody>
|
27
|
+
<% @exceptions.each do |exception| %>
|
28
|
+
<tr>
|
29
|
+
<th><%= exception.count %></th>
|
30
|
+
<th><%= link_to(exception.class_name, exception_job_path(@job, error_type: exception.class_name), class: "card callout") %></th>
|
31
|
+
|
32
|
+
<th>
|
33
|
+
<% exception.messages.each do |message| %>
|
34
|
+
<div><%= message %></div>
|
35
|
+
<% end %>
|
36
|
+
</th>
|
37
|
+
</tr>
|
38
|
+
<% end %>
|
37
39
|
</tbody>
|
38
40
|
</table>
|
39
41
|
</div>
|
@@ -1,23 +1,26 @@
|
|
1
|
-
<div class=
|
2
|
-
<div class=
|
3
|
-
<div class=
|
4
|
-
<div class=
|
1
|
+
<div class='job-list'>
|
2
|
+
<div class='list'>
|
3
|
+
<div class='row'>
|
4
|
+
<div class='col-sm-10'>
|
5
5
|
<h2><%= @description %> Jobs</h2>
|
6
6
|
</div>
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
|
8
|
+
<div class='col-sm-2'>
|
9
|
+
<div class='btn btn-default pull-right dt-reload' data-behavior='reload'>
|
10
|
+
<i class='fas fa-sync'></i>
|
10
11
|
</div>
|
11
12
|
</div>
|
12
13
|
</div>
|
14
|
+
|
13
15
|
<table class='table datatable jobs-datatable' data-source='<%= @data_table_url %>' style='width: 100%'>
|
14
16
|
<thead>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
<tr>
|
18
|
+
<% @columns.each do |column| %>
|
19
|
+
<th><%= column[:display] %></th>
|
20
|
+
<% end %>
|
21
|
+
</tr>
|
20
22
|
</thead>
|
23
|
+
|
21
24
|
<tbody></tbody>
|
22
25
|
</table>
|
23
26
|
</div>
|
@@ -26,7 +29,7 @@
|
|
26
29
|
<script>
|
27
30
|
jQuery(function () {
|
28
31
|
new RjmcDatatable(
|
29
|
-
$(
|
32
|
+
$('.jobs-datatable'),
|
30
33
|
<%= @table_layout.to_json.html_safe %>
|
31
34
|
);
|
32
35
|
});
|
@@ -1,34 +1,36 @@
|
|
1
|
-
<div class=
|
2
|
-
<div class=
|
3
|
-
<div id=
|
4
|
-
<div class=
|
5
|
-
|
6
|
-
|
7
|
-
<div class=
|
1
|
+
<div class='row'>
|
2
|
+
<div class='col-md-12 job-status'>
|
3
|
+
<div id='job'>
|
4
|
+
<div class='lead'><%= @job.class.name %></div>
|
5
|
+
|
6
|
+
<div class='job-state inline-block'>
|
7
|
+
<div class='left'>State</div>
|
8
|
+
<div class="<%= job_state(@job) %> right"><%= job_state(@job) %></div>
|
8
9
|
</div>
|
9
10
|
|
10
11
|
<% if sub_state = @job['sub_state'] %>
|
11
|
-
<div class=
|
12
|
-
<div class=
|
13
|
-
<div class=
|
12
|
+
<div class='job-state inline-block'>
|
13
|
+
<div class='left'>Batch</div>
|
14
|
+
<div class='running right'><%= @job.sub_state %></div>
|
14
15
|
</div>
|
15
16
|
<% end %>
|
16
17
|
|
17
|
-
<div class=
|
18
|
+
<div class='btn-toolbar job-actions pull-right'>
|
18
19
|
<% if @job.respond_to?(:input) && @job.input.failed.count > 0 %>
|
19
|
-
<div class=
|
20
|
+
<div class='btn-group'>
|
20
21
|
<%= link_to('Show Exceptions', exceptions_job_path(@job), class: 'btn btn-default') %>
|
21
22
|
</div>
|
22
23
|
<% end %>
|
23
24
|
|
24
25
|
<% if @job.scheduled? %>
|
25
|
-
<div class=
|
26
|
+
<div class='btn-group'>
|
26
27
|
<%= job_action_link('Run', rocket_job_mission_control.run_now_job_path(@job), :patch) %>
|
27
28
|
</div>
|
28
29
|
<% end %>
|
29
30
|
|
30
|
-
<div class=
|
31
|
+
<div class='btn-group'>
|
31
32
|
<% valid_events = @job.aasm.events.collect { |e| e.name } %>
|
33
|
+
|
32
34
|
<% if valid_events.include?(:pause) %>
|
33
35
|
<%= job_action_link('Pause', rocket_job_mission_control.pause_job_path(@job), :patch) %>
|
34
36
|
<% end %>
|
@@ -42,7 +44,7 @@
|
|
42
44
|
<% end %>
|
43
45
|
</div>
|
44
46
|
|
45
|
-
<div class=
|
47
|
+
<div class='btn-group'>
|
46
48
|
<% if valid_events.include?(:fail) %>
|
47
49
|
<%= job_action_link('Fail', rocket_job_mission_control.fail_job_path(@job), :patch) %>
|
48
50
|
<% end %>
|
@@ -55,14 +57,17 @@
|
|
55
57
|
</div>
|
56
58
|
|
57
59
|
<% unless @job.completed? || @job.aborted? %>
|
58
|
-
<div class=
|
59
|
-
<%= link_to
|
60
|
+
<div class='btn-group'>
|
61
|
+
<%= link_to 'Edit', edit_job_path(@job), class: 'btn btn-default' %>
|
60
62
|
</div>
|
61
63
|
<% end %>
|
62
64
|
</div>
|
63
|
-
<div class="col-md-12">
|
64
|
-
<%= render partial: 'status', locals: {job: @job} %>
|
65
|
-
</div>
|
66
65
|
</div>
|
67
66
|
</div>
|
68
67
|
</div>
|
68
|
+
|
69
|
+
<div class='row'>
|
70
|
+
<div class='col-md-12'>
|
71
|
+
<%= render partial: 'status', locals: { job: @job } %>
|
72
|
+
</div>
|
73
|
+
</div>
|
@@ -1,13 +1,14 @@
|
|
1
|
-
<ul class=
|
1
|
+
<ul class='nav hidden-xs' id='lg-menu'>
|
2
2
|
<li>
|
3
3
|
<%= link_to(servers_path) do %>
|
4
|
-
<i class=
|
4
|
+
<i class='fas fa-list'></i> All
|
5
5
|
<% end %>
|
6
6
|
</li>
|
7
|
+
|
7
8
|
<% @states.each do |state| %>
|
8
9
|
<li class="#{state}">
|
9
10
|
<%= link_to("#{state}_servers".to_sym) do %>
|
10
|
-
<i class="
|
11
|
+
<i class="fas <%= state_icon(state) %>"></i> <%= state.capitalize%> (<%= server_counts_by_state(state)%>)
|
11
12
|
<% end %>
|
12
13
|
</li>
|
13
14
|
<% end %>
|
@@ -15,16 +16,17 @@
|
|
15
16
|
|
16
17
|
<!-- tiny only nav -->
|
17
18
|
|
18
|
-
<ul class=
|
19
|
+
<ul class='nav visible-xs' id='xs-menu'>
|
19
20
|
<li>
|
20
21
|
<%= link_to(servers_path) do %>
|
21
|
-
<i class=
|
22
|
+
<i class='fa fa-list'></i>
|
22
23
|
<% end %>
|
23
24
|
</li>
|
25
|
+
|
24
26
|
<% @states.each do |state| %>
|
25
27
|
<li class="#{state}">
|
26
28
|
<%= link_to("#{state}_servers".to_sym) do %>
|
27
|
-
<i class="
|
29
|
+
<i class="fas <%= state_icon(state) %>"></i>
|
28
30
|
<% end %>
|
29
31
|
</li>
|
30
32
|
<% end %>
|
@@ -5,6 +5,7 @@
|
|
5
5
|
<div class='col-md-6'>
|
6
6
|
<h2><%= @description %> Servers</h2>
|
7
7
|
</div>
|
8
|
+
|
8
9
|
<div class='col-md-6'>
|
9
10
|
<div class='col-sm-10'>
|
10
11
|
<div class='server-collection-actions'>
|
@@ -12,34 +13,37 @@
|
|
12
13
|
<div class='btn-group'>
|
13
14
|
<% Array(@actions).each do |action| %>
|
14
15
|
<%= link_to(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
%>
|
16
|
+
"#{action.to_s.humanize.capitalize}",
|
17
|
+
rocket_job_mission_control.update_all_servers_path(server_action: action),
|
18
|
+
method: :patch,
|
19
|
+
data: { confirm: t(:confirm, scope: [:server, :update_all], action: action.to_s.singularize.humanize.downcase) },
|
20
|
+
class: 'btn btn-default'
|
21
|
+
)%>
|
21
22
|
<% end %>
|
22
23
|
</div>
|
23
24
|
</ol>
|
24
25
|
</div>
|
25
26
|
</div>
|
27
|
+
|
26
28
|
<div class='col-sm-2 pull-right'>
|
27
29
|
<div class='btn btn-default pull-right dt-reload' data-behavior='reload'>
|
28
|
-
<i class='
|
30
|
+
<i class='fas fa-sync'></i>
|
29
31
|
</div>
|
30
32
|
</div>
|
31
33
|
</div>
|
32
34
|
</div>
|
35
|
+
|
33
36
|
<table class='table datatable servers-datatable' data-source='<%= @data_table_url %>' style='width: 100%'>
|
34
37
|
<thead>
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
<tr>
|
39
|
+
<th>Hostname : PID</th>
|
40
|
+
<th>Workers (Current/Max)</th>
|
41
|
+
<th>Started</th>
|
42
|
+
<th>Heartbeat</th>
|
43
|
+
<th>Actions</th>
|
44
|
+
</tr>
|
42
45
|
</thead>
|
46
|
+
|
43
47
|
<tbody></tbody>
|
44
48
|
</table>
|
45
49
|
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Rails.application.config.assets.precompile << Proc.new { |path|
|
2
|
+
if path =~ /\.(eot|svg|ttf|woff)\z/
|
3
|
+
true
|
4
|
+
end
|
5
|
+
}
|
6
|
+
|
7
|
+
Rails.application.config.assets.precompile += %w(
|
8
|
+
rocket_job_mission_control/favicon.png
|
9
|
+
rocket_job_mission_control/safari-pinned-tab.svg
|
10
|
+
rocket_job_mission_control/favicon-16x16.png
|
11
|
+
rocket_job_mission_control/favicon-32x32.png
|
12
|
+
rocket_job_mission_control/apple-touch-icon.png
|
13
|
+
)
|
@@ -3,7 +3,6 @@ require_relative '../../compare_hashes'
|
|
3
3
|
|
4
4
|
module RocketJobMissionControl
|
5
5
|
class DirmonEntriesControllerTest < ActionController::TestCase
|
6
|
-
|
7
6
|
describe DirmonEntriesController do
|
8
7
|
before do
|
9
8
|
RocketJob::DirmonEntry.delete_all
|
@@ -396,25 +395,25 @@ module RocketJobMissionControl
|
|
396
395
|
json = JSON.parse(response.body)
|
397
396
|
expected_data = {
|
398
397
|
pending: {
|
399
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.pending.first.id}\">\n <i class=\"
|
398
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.pending.first.id}\">\n <i class=\"fas fa-inbox pending\" style=\"font-size: 75%\" title=\"pending\"></i>\n Test\n </a>\n",
|
400
399
|
"1" => "RocketJob::Jobs::SimpleJob",
|
401
400
|
"2" => "the_path",
|
402
401
|
"DT_RowClass" => "card callout callout-pending"
|
403
402
|
},
|
404
403
|
enabled: {
|
405
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.enabled.first.id}\">\n <i class=\"
|
404
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.enabled.first.id}\">\n <i class=\"fas fa-check enabled\" style=\"font-size: 75%\" title=\"enabled\"></i>\n Test\n </a>\n",
|
406
405
|
"1" => "RocketJob::Jobs::SimpleJob",
|
407
406
|
"2" => "the_path",
|
408
407
|
"DT_RowClass" => "card callout callout-enabled"
|
409
408
|
},
|
410
409
|
failed: {
|
411
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.failed.first.id}\">\n <i class=\"
|
410
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.failed.first.id}\">\n <i class=\"fas fa-exclamation-triangle failed\" style=\"font-size: 75%\" title=\"failed\"></i>\n Test\n </a>\n",
|
412
411
|
"1" => "RocketJob::Jobs::SimpleJob",
|
413
412
|
"2" => "the_path",
|
414
413
|
"DT_RowClass" => "card callout callout-failed"
|
415
414
|
},
|
416
415
|
disabled: {
|
417
|
-
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.disabled.first.id}\">\n <i class=\"
|
416
|
+
"0" => " <a href=\"/dirmon_entries/#{RocketJob::DirmonEntry.disabled.first.id}\">\n <i class=\"fas fa-stop disabled\" style=\"font-size: 75%\" title=\"disabled\"></i>\n Test\n </a>\n",
|
418
417
|
"1" => "RocketJob::Jobs::SimpleJob",
|
419
418
|
"2" => "the_path",
|
420
419
|
"DT_RowClass" => "card callout callout-disabled"
|
@@ -435,7 +434,6 @@ module RocketJobMissionControl
|
|
435
434
|
end
|
436
435
|
end
|
437
436
|
end
|
438
|
-
|
439
437
|
end
|
440
438
|
end
|
441
439
|
end
|
@@ -26,30 +26,33 @@ module RocketJobMissionControl
|
|
26
26
|
end
|
27
27
|
|
28
28
|
let :failed_job do
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
if defined?(RocketJobPro)
|
30
|
+
job = KaboomBatchJob.new(slice_size: 1)
|
31
|
+
job.upload do |stream|
|
32
|
+
stream << 'first record'
|
33
|
+
stream << 'second record'
|
34
|
+
stream << 'third record'
|
35
|
+
end
|
36
|
+
job.save!
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
# Run all 3 slices now to get exceptions for each.
|
39
|
+
3.times do
|
40
|
+
begin
|
41
|
+
job.perform_now
|
42
|
+
rescue ArgumentError, RuntimeError
|
43
|
+
end
|
42
44
|
end
|
45
|
+
job
|
46
|
+
else
|
47
|
+
RocketJob::Job::SimpleJob.new.fail!('Oh no', 'bad_worker')
|
43
48
|
end
|
44
|
-
|
45
|
-
job
|
46
49
|
end
|
47
50
|
|
48
51
|
job_states = RocketJob::Job.aasm.states.collect(&:name)
|
49
52
|
|
50
53
|
let :one_job_for_every_state do
|
51
54
|
job_states.collect do |state|
|
52
|
-
RocketJob::Jobs::SimpleJob.create!(state: state)
|
55
|
+
RocketJob::Jobs::SimpleJob.create!(state: state, worker_name: 'worker')
|
53
56
|
end
|
54
57
|
end
|
55
58
|
|
@@ -2,8 +2,8 @@ require_relative '../../test_helper'
|
|
2
2
|
|
3
3
|
module RocketJobMissionControl
|
4
4
|
JobsHelper.include(RocketJobMissionControl::ApplicationHelper)
|
5
|
-
class JobsHelperTest < ActionView::TestCase
|
6
5
|
|
6
|
+
class JobsHelperTest < ActionView::TestCase
|
7
7
|
describe JobsHelper do
|
8
8
|
describe '#jobs_icon' do
|
9
9
|
let :job do
|
@@ -11,29 +11,35 @@ module RocketJobMissionControl
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'shows queued' do
|
14
|
-
assert_equal 'fa-inbox queued', job_icon(job)
|
14
|
+
assert_equal 'fas fa-inbox queued', job_icon(job)
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'shows running' do
|
18
18
|
job.start
|
19
|
-
|
19
|
+
job.worker_name = 'test_worker'
|
20
|
+
assert_equal 'fas fa-play running', job_icon(job)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'shows sleeping' do
|
24
|
+
job.start
|
25
|
+
assert_equal 'fas fa-hourglass sleeping', job_icon(job)
|
20
26
|
end
|
21
27
|
|
22
28
|
it 'shows failed' do
|
23
29
|
job.start
|
24
30
|
job.fail
|
25
|
-
assert_equal 'fa-exclamation-triangle failed', job_icon(job)
|
31
|
+
assert_equal 'fas fa-exclamation-triangle failed', job_icon(job)
|
26
32
|
end
|
27
33
|
|
28
34
|
it 'shows aborted' do
|
29
35
|
job.start
|
30
36
|
job.abort
|
31
|
-
assert_equal 'fa-stop aborted', job_icon(job)
|
37
|
+
assert_equal 'fas fa-stop aborted', job_icon(job)
|
32
38
|
end
|
33
39
|
|
34
40
|
it 'handles scheduled special case' do
|
35
41
|
job.run_at = 1.day.from_now
|
36
|
-
assert_equal 'fa-clock
|
42
|
+
assert_equal 'fas fa-clock scheduled', job_icon(job)
|
37
43
|
end
|
38
44
|
end
|
39
45
|
|