rocketjob_mission_control 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rocket_job_mission_control/dirmon_entries.js.coffee +2 -3
- data/app/controllers/rocket_job_mission_control/dirmon_entries_controller.rb +5 -6
- data/app/views/layouts/rocket_job_mission_control/partials/_header.html.haml +1 -1
- data/app/views/rocket_job_mission_control/jobs/running.html.haml +2 -2
- data/app/views/rocket_job_mission_control/jobs/show.html.haml +1 -1
- data/lib/rocket_job_mission_control/version.rb +1 -1
- data/spec/controllers/dirmon_entries_controller_spec.rb +23 -11
- data/spec/dummy/log/development.log +0 -4
- data/spec/dummy/log/test.log +14782 -72473
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3f175879f9c5c41ad2605e8eb0aadf7b8d421f
|
4
|
+
data.tar.gz: b174ffaaea347559f3861637f8d12a0f8f036e67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d3b9d611da368ba9cf1ae20d8f88dcf75bc6ca81e436d53a7de164e7ea7b893bf7d58f11d9c1920b5fd8fe1678481251ba8b811eebfd80e60cc24a5a91ad71a
|
7
|
+
data.tar.gz: 8162e76e4b9c41833cc848d68496156ad7128587754acbdb0eb778d6df7cb5532f221d1914fbbfa3aa747942e724d8fd566e34ecd239ef00578f8ba281cd4fae
|
@@ -8,8 +8,7 @@ $(document).on 'ready', ->
|
|
8
8
|
|
9
9
|
if $('#properties').length
|
10
10
|
$('#properties').on 'click', ->
|
11
|
-
|
12
|
-
|
13
|
-
new_dirmon_path = $('#properties').data('url') + "?job_class_name=#{job_class_name}&perform_method=#{perform_method}"
|
11
|
+
params = $('#new_rocket_job_dirmon_entry').serialize()
|
12
|
+
new_dirmon_path = $('#properties').data('url') + "?#{params}"
|
14
13
|
window.location = new_dirmon_path
|
15
14
|
|
@@ -12,12 +12,11 @@ module RocketJobMissionControl
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def new
|
15
|
-
|
16
|
-
|
17
|
-
@dirmon_entry = RocketJob::DirmonEntry.new(arguments: nil, job_class_name: job_class_name, perform: perform_method)
|
15
|
+
dirmon_params.reverse_merge!(perform_method: :perform)
|
16
|
+
@dirmon_entry = RocketJob::DirmonEntry.new(dirmon_params)
|
18
17
|
@previous_job_class_names = RocketJob::DirmonEntry.distinct(:job_class_name)
|
19
18
|
|
20
|
-
if job_class_name && !@dirmon_entry.job_class
|
19
|
+
if dirmon_params[:job_class_name] && !@dirmon_entry.job_class
|
21
20
|
@dirmon_entry.errors.add(:job_class_name, 'Invalid Job Class')
|
22
21
|
end
|
23
22
|
end
|
@@ -163,9 +162,9 @@ module RocketJobMissionControl
|
|
163
162
|
|
164
163
|
def dirmon_params
|
165
164
|
params
|
166
|
-
.
|
165
|
+
.fetch(:rocket_job_dirmon_entry, {})
|
167
166
|
.permit(:name, :archive_directory, :pattern, :job_class_name, :perform_method).tap do |whitelist|
|
168
|
-
whitelist[:properties] = params[:rocket_job_dirmon_entry][:properties] if params
|
167
|
+
whitelist[:properties] = params[:rocket_job_dirmon_entry][:properties] if params.fetch(:rocket_job_dirmon_entry, {})[:properties]
|
169
168
|
end
|
170
169
|
end
|
171
170
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
.info
|
15
15
|
.progress
|
16
16
|
.progress-bar{ style: "width: #{job.percent_complete}%; min-width: 1em;", title: "#{job.percent_complete}% percent complete."}
|
17
|
-
- if job.kind_of?(RocketJob::SlicedJob)
|
17
|
+
- if defined?(RocketJob::SlicedJob) && job.kind_of?(RocketJob::SlicedJob)
|
18
18
|
.slice_count
|
19
19
|
%label Slices Running:
|
20
20
|
= job.input.find_all { |s| s.state == :running }.count
|
@@ -24,7 +24,7 @@
|
|
24
24
|
= job.worker_name
|
25
25
|
|
26
26
|
= render partial: 'status', locals: { job: job }
|
27
|
-
- if job.kind_of?(RocketJob::SlicedJob)
|
27
|
+
- if defined?(RocketJob::SlicedJob) && job.kind_of?(RocketJob::SlicedJob)
|
28
28
|
%table.table
|
29
29
|
%tr
|
30
30
|
%th worker
|
@@ -46,7 +46,7 @@
|
|
46
46
|
- if valid_events.include?(:retry)
|
47
47
|
= job_action_link('retry', rocket_job_mission_control.retry_job_path(@job), :patch)
|
48
48
|
|
49
|
-
- if @job.failed? && @job.kind_of?(RocketJob::SlicedJob) && @job.input.failed_count > 0
|
49
|
+
- if @job.failed? && defined?(RocketJob::SlicedJob) && @job.kind_of?(RocketJob::SlicedJob) && @job.input.failed_count > 0
|
50
50
|
= link_to("view errors", job_failures_path(@job), class: 'btn btn-default')
|
51
51
|
|
52
52
|
.clearfix
|
@@ -108,27 +108,39 @@ module RocketJobMissionControl
|
|
108
108
|
expect(assigns(:dirmon_entry)).to_not be_persisted
|
109
109
|
end
|
110
110
|
|
111
|
-
context 'with
|
112
|
-
let(:entry_params) { {
|
111
|
+
context 'with form params' do
|
112
|
+
let(:entry_params) { { rocket_job_dirmon_entry: { name: 'new entry' } } }
|
113
113
|
|
114
114
|
it { expect(response.status).to eq(200) }
|
115
115
|
|
116
|
-
it 'assigns the
|
116
|
+
it 'assigns the params to new entry' do
|
117
117
|
expect(assigns(:dirmon_entry)).to be_present
|
118
|
-
expect(assigns(:dirmon_entry).
|
118
|
+
expect(assigns(:dirmon_entry).name).to eq('new entry')
|
119
119
|
end
|
120
|
-
end
|
121
120
|
|
122
|
-
|
123
|
-
|
121
|
+
context 'with a valid job_class_name' do
|
122
|
+
let(:entry_params) { { rocket_job_dirmon_entry: { job_class_name: 'FakeButGoodJob' } } }
|
124
123
|
|
125
|
-
|
124
|
+
it { expect(response.status).to eq(200) }
|
126
125
|
|
127
|
-
|
128
|
-
|
129
|
-
|
126
|
+
it 'assigns the job class' do
|
127
|
+
expect(assigns(:dirmon_entry)).to be_present
|
128
|
+
expect(assigns(:dirmon_entry).job_class).to eq(FakeButGoodJob)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context 'with an invalid job_class_name' do
|
133
|
+
let(:entry_params) { { rocket_job_dirmon_entry: { job_class_name: 'BadJob' } } }
|
134
|
+
|
135
|
+
it { expect(response.status).to eq(200) }
|
136
|
+
|
137
|
+
it 'adds an error' do
|
138
|
+
expect(assigns(:dirmon_entry)).to be_present
|
139
|
+
expect(assigns(:dirmon_entry).errors[:job_class_name]).to be_present
|
140
|
+
end
|
130
141
|
end
|
131
142
|
end
|
143
|
+
|
132
144
|
end
|
133
145
|
|
134
146
|
describe 'PATCH #update' do
|
@@ -1,4 +0,0 @@
|
|
1
|
-
MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
|
2
|
-
MONGODB (0.5ms) admin['$cmd'].find({:isMaster=>1}).limit(-1)
|
3
|
-
MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
|
4
|
-
MONGODB (0.4ms) admin['$cmd'].find({:isMaster=>1}).limit(-1)
|