qa_server 7.5.0 → 7.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_fixme.yml +3 -2
- data/.travis.yml +1 -1
- data/CHANGELOG.md +30 -0
- data/app/assets/stylesheets/qa_server/_check-status.scss +4 -0
- data/app/controllers/qa_server/monitor_status_controller.rb +31 -9
- data/app/models/qa_server/scenario_run_history.rb +12 -3
- data/app/models/qa_server/search_scenario.rb +6 -0
- data/app/presenters/qa_server/check_status_presenter.rb +1 -1
- data/app/presenters/qa_server/monitor_status/current_status_presenter.rb +9 -8
- data/app/presenters/qa_server/monitor_status/history_presenter.rb +55 -4
- data/app/views/qa_server/check_status/index.html.erb +7 -6
- data/app/views/qa_server/monitor_status/_test_summary.html.erb +1 -1
- data/config/i18n-tasks.yml +133 -0
- data/config/locales/qa_server.en.yml +22 -7
- data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_tgn_ld4l_cache.json +24 -14
- data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_ulan_ld4l_cache.json +104 -8
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo2_ld4l_cache.json +4 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo3_ld4l_cache.json +4 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo_ld4l_cache.json +4 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locvocabs_ld4l_cache.json +1 -1
- data/lib/generators/qa_server/templates/config/authorities/linked_data/mesh_nlm_ld4l_cache.json +1 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_direct.json +4 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_ld4l_cache.json +1 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/cerl_ld4l_cache_validation.yml +3 -3
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/geonames_ld4l_cache_validation.yml +2 -5
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_aat_ld4l_cache_validation.yml +0 -3
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_tgn_ld4l_cache_validation.yml +3 -7
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_ulan_ld4l_cache_validation.yml +5 -5
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locdemographics_ld4l_cache_validation.yml +0 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locgenres_ld4l_cache_validation.yml +0 -9
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_ld4l_cache_validation.yml +1 -7
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_rwo2_ld4l_cache_validation.yml +78 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_rwo3_ld4l_cache_validation.yml +73 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_rwo_ld4l_cache_validation.yml +11 -11
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locsubjects_ld4l_cache_validation.yml +1 -3
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locvocabs_ld4l_cache_validation.yml +246 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/mesh_nlm_ld4l_cache_validation.yml +8 -5
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_direct_validation.yml +13 -7
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_ld4l_cache_validation.yml +19 -3
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/rda_registry_ld4l_cache_validation.yml +0 -3
- data/lib/qa_server/version.rb +1 -1
- data/qa_server.gemspec +6 -5
- data/spec/feature/accuracy_spec.rb +1 -1
- data/spec/i18n_spec.rb +35 -0
- data/spec/presenters/qa_server/monitor_status/history_presenter_spec.rb +81 -0
- metadata +51 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 794b6a1df8268f9b316ba8626f45ace1241f5208538c2dab2965c36077ce8ad3
|
4
|
+
data.tar.gz: ad7b9425e8f9d4fcdca98dfa0f6ae31ac0fa6a0fe5d4b6b8207d648db023edfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2efb90f8b0d3409fc7058557497820476791b642db776ef406855c3e4c5d3bd581e0661662b8eeb74dec146f59ae7e9a5a5a1aad36c297524ab6a88ee07e6505
|
7
|
+
data.tar.gz: 5f32bb54311cbd6cc58c4f6cf4017c7dff1d64047672af9b303cb57a3dae7010e8d64353a49666d1e5378ab2ddb3f1f8108e48a7114926b49badda60a6f425bf
|
data/.rubocop_fixme.yml
CHANGED
data/.travis.yml
CHANGED
@@ -26,7 +26,7 @@ env:
|
|
26
26
|
# It should be sufficient to test only the latest of the patch versions for a minor version, they
|
27
27
|
# should be compatible across patch versions (only bug fixes are released in patch versions).
|
28
28
|
matrix:
|
29
|
-
- "RAILS_VERSION=5.2.
|
29
|
+
- "RAILS_VERSION=5.2.5"
|
30
30
|
|
31
31
|
services:
|
32
32
|
- redis-server
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
### 7.8.0 (2021-04-14)
|
2
|
+
|
3
|
+
* add geographic subauth for Mesh-NLM
|
4
|
+
* dogear expected and actual cells when accuracy test is pending
|
5
|
+
|
6
|
+
### 7.7.1 (2021-04-14)
|
7
|
+
|
8
|
+
* fix background colors in historical uptime table
|
9
|
+
|
10
|
+
### 7.7.0 (2021-04-13)
|
11
|
+
|
12
|
+
* remove unused translations
|
13
|
+
* show notification when refreshing starts on monitor status page
|
14
|
+
* hide data in Authority Connection History for non-active authorities
|
15
|
+
* loosen threshold for caution in historical uptime table
|
16
|
+
* minor tweaks missed in original sync
|
17
|
+
|
18
|
+
### 7.6.0 (2021-04-12)
|
19
|
+
|
20
|
+
* update authority configs and test scenarios to use the new cache indexing with results stored as blobs in the index
|
21
|
+
* update to Rails 5.2.5
|
22
|
+
* update dependencies
|
23
|
+
* fix exception when first time running monitor status
|
24
|
+
|
25
|
+
### 7.5.1 (2020-12-08)
|
26
|
+
|
27
|
+
* define missing i18n translations
|
28
|
+
* add i18n-tasks gem for managing translations
|
29
|
+
* add spec test to check for missing translations
|
30
|
+
|
1
31
|
### 7.5.0 (2020-12-07)
|
2
32
|
|
3
33
|
* UI improvements of check_status page
|
@@ -88,6 +88,10 @@ td.bold-left-border {
|
|
88
88
|
border-left: 2px solid black;
|
89
89
|
}
|
90
90
|
|
91
|
+
.status-dogear {
|
92
|
+
background: linear-gradient(135deg, #333 0%, #333 10%, transparent 10%, transparent 100%);
|
93
|
+
}
|
94
|
+
|
91
95
|
.status-good {
|
92
96
|
text-align: center;
|
93
97
|
background-color: #ccffcc;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# Controller for Monitor Status header menu item
|
3
3
|
module QaServer
|
4
|
-
class MonitorStatusController < ApplicationController
|
4
|
+
class MonitorStatusController < ApplicationController # rubocop:disable Metrics/ClassLength
|
5
5
|
layout 'qa_server'
|
6
6
|
|
7
7
|
include QaServer::AuthorityValidationBehavior
|
@@ -21,7 +21,7 @@ module QaServer
|
|
21
21
|
historical_summary_data: historical_data,
|
22
22
|
performance_data: performance_table_data)
|
23
23
|
QaServer.config.monitor_logger.debug("~~~~~~~~ DONE rendering monitor status")
|
24
|
-
render 'index', status: :internal_server_error if latest_summary
|
24
|
+
render 'index', status: :internal_server_error if latest_summary&.failing_authority_count&.positive?
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
@@ -43,13 +43,13 @@ module QaServer
|
|
43
43
|
|
44
44
|
# @returns [QaServer::ScenarioRunSummary] summary statistics on the latest run
|
45
45
|
def latest_summary
|
46
|
-
QaServer::ScenarioRunSummaryCache.summary_for_run(run: latest_test_run)
|
46
|
+
latest_test_run ? QaServer::ScenarioRunSummaryCache.summary_for_run(run: latest_test_run) : nil
|
47
47
|
end
|
48
48
|
|
49
49
|
# @returns [Array<Hash>] scenario details for any failing scenarios in the latest run
|
50
50
|
# @see QaServer::ScenarioRunHistory#run_failures for structure of output
|
51
51
|
def latest_failures
|
52
|
-
QaServer::ScenarioRunFailuresCache.failures_for_run(run: latest_test_run)
|
52
|
+
latest_test_run ? QaServer::ScenarioRunFailuresCache.failures_for_run(run: latest_test_run) : nil
|
53
53
|
end
|
54
54
|
|
55
55
|
# Get a summary level of historical data
|
@@ -77,7 +77,8 @@ module QaServer
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def refresh?
|
80
|
-
|
80
|
+
return @refresh unless @refresh.nil?
|
81
|
+
@refresh ||= params.key?(:refresh) && validate_auth_reload_token("refresh status")
|
81
82
|
end
|
82
83
|
|
83
84
|
def refresh_all?
|
@@ -86,15 +87,36 @@ module QaServer
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def refresh_tests?
|
89
|
-
|
90
|
+
return @refresh_tests unless @refresh_tests.nil?
|
91
|
+
@refresh_tests = refresh? && (refresh_all? || params[:refresh].casecmp?('tests'))
|
92
|
+
if @refresh_tests
|
93
|
+
msg = I18n.t('qa_server.monitor_status.refreshing_tests')
|
94
|
+
logger.info msg
|
95
|
+
flash.now[:success] = msg
|
96
|
+
end
|
97
|
+
@refresh_tests
|
90
98
|
end
|
91
99
|
|
92
100
|
def refresh_history?
|
93
|
-
|
101
|
+
return @refresh_history unless @refresh_history.nil?
|
102
|
+
@refresh_history = refresh? && (refresh_all? || params[:refresh].casecmp?('history'))
|
103
|
+
if @refresh_history
|
104
|
+
msg = I18n.t('qa_server.monitor_status.refreshing_history')
|
105
|
+
logger.info msg
|
106
|
+
flash.now[:success] = msg
|
107
|
+
end
|
108
|
+
@refresh_history
|
94
109
|
end
|
95
110
|
|
96
111
|
def refresh_performance?
|
97
|
-
|
112
|
+
return @refresh_performance unless @refresh_performance.nil?
|
113
|
+
@refresh_performance = refresh? && (refresh_all? || params[:refresh].casecmp?('performance'))
|
114
|
+
if @refresh_performance
|
115
|
+
msg = I18n.t('qa_server.monitor_status.refreshing_performance')
|
116
|
+
logger.info msg
|
117
|
+
flash.now[:success] = msg
|
118
|
+
end
|
119
|
+
@refresh_performance
|
98
120
|
end
|
99
121
|
|
100
122
|
def refresh_performance_table?
|
@@ -117,7 +139,7 @@ module QaServer
|
|
117
139
|
token = params.key?(:auth_token) ? params[:auth_token] : nil
|
118
140
|
valid = Qa.config.valid_authority_reload_token?(token)
|
119
141
|
return true if valid
|
120
|
-
msg =
|
142
|
+
msg = I18n.t('qa_server.monitor_status.permission_denied', action: action)
|
121
143
|
logger.warn msg
|
122
144
|
flash.now[:error] = msg
|
123
145
|
false
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# Provide access to the scenario_run_history database table which tracks scenario runs over time.
|
3
3
|
module QaServer
|
4
|
-
class ScenarioRunHistory < ApplicationRecord
|
4
|
+
class ScenarioRunHistory < ApplicationRecord # rubocop:disable Metrics/ClassLength
|
5
5
|
self.table_name = 'scenario_run_history'
|
6
6
|
belongs_to :scenario_run_registry
|
7
7
|
enum scenario_type: { connection: 0, accuracy: 1, performance: 2 }, _suffix: :type
|
@@ -11,9 +11,9 @@ module QaServer
|
|
11
11
|
BAD_MARKER = 'X'
|
12
12
|
UNKNOWN_MARKER = '?'
|
13
13
|
|
14
|
-
class_attribute :summary_class
|
15
|
-
|
14
|
+
class_attribute :summary_class, :authority_lister_class
|
16
15
|
self.summary_class = QaServer::ScenarioRunSummary
|
16
|
+
self.authority_lister_class = QaServer::AuthorityListerService
|
17
17
|
|
18
18
|
class << self
|
19
19
|
# Save a scenario result
|
@@ -92,12 +92,21 @@ module QaServer
|
|
92
92
|
days_unknown = count_days(:unknown)
|
93
93
|
keys = (days_good.keys + days_bad.keys + days_unknown.keys).uniq.sort
|
94
94
|
keys.each_with_object({}) do |auth, hash|
|
95
|
+
next unless active_authority? auth
|
95
96
|
hash[auth] = { good: day_count(auth, days_good), bad: day_count(auth, days_bad) + day_count(auth, days_unknown) }
|
96
97
|
end
|
97
98
|
end
|
98
99
|
|
99
100
|
private
|
100
101
|
|
102
|
+
def active_authority?(auth)
|
103
|
+
active_authorities.include? auth.to_sym
|
104
|
+
end
|
105
|
+
|
106
|
+
def active_authorities
|
107
|
+
@active_authorities = authority_lister_class.authorities_list
|
108
|
+
end
|
109
|
+
|
101
110
|
def day_count(auth, days)
|
102
111
|
days&.key?(auth) ? days[auth] : 0
|
103
112
|
end
|
@@ -81,7 +81,7 @@ module QaServer
|
|
81
81
|
|
82
82
|
# @return [String] the name of the css style class to use for the status cell based on the status of the scenario test.
|
83
83
|
def status_style_class(status)
|
84
|
-
"status-#{status}"
|
84
|
+
status[:pending] ? "status-dogear status-#{status[:status]}" : "status-#{status[:status]}"
|
85
85
|
end
|
86
86
|
|
87
87
|
# @return [String] the name of the css style class to use for the status cell based on the status of the scenario test.
|
@@ -13,12 +13,13 @@ module QaServer::MonitorStatus
|
|
13
13
|
|
14
14
|
# @return [ActiveSupport::TimeWithZone] date time stamp of last test run
|
15
15
|
def last_updated_dt
|
16
|
-
@current_summary.run_dt_stamp
|
16
|
+
@current_summary ? @current_summary.run_dt_stamp : QaServer::TimeService.current_time
|
17
17
|
end
|
18
18
|
|
19
19
|
# @return [String] date with time of last test run
|
20
20
|
def last_updated
|
21
|
-
|
21
|
+
return I18n.t('qa_server.monitor_status.summary.no_data') if @current_summary.blank?
|
22
|
+
I18n.t('qa_server.monitor_status.summary.last_updated', date: QaServer::TimeService.pretty_time(last_updated_dt))
|
22
23
|
end
|
23
24
|
|
24
25
|
# @return [ActiveSupport::TimeWithZone] date time stamp of first recorded test run
|
@@ -33,12 +34,12 @@ module QaServer::MonitorStatus
|
|
33
34
|
|
34
35
|
# @return [Integer] number of loaded authorities
|
35
36
|
def authorities_count
|
36
|
-
@current_summary.authority_count
|
37
|
+
@current_summary ? @current_summary.authority_count : "N/A"
|
37
38
|
end
|
38
39
|
|
39
40
|
# @return [Integer] number of authorities with failing tests in the latest test run
|
40
41
|
def failing_authorities_count
|
41
|
-
@current_failure_data.map { |f| f[:authority_name] }.uniq.count
|
42
|
+
@current_failure_data ? @current_failure_data.map { |f| f[:authority_name] }.uniq.count : "N/A"
|
42
43
|
end
|
43
44
|
|
44
45
|
# @return [String] css style class representing whether all tests passed or any failed
|
@@ -48,17 +49,17 @@ module QaServer::MonitorStatus
|
|
48
49
|
|
49
50
|
# @return [Integer] number of tests in the latest test run
|
50
51
|
def tests_count
|
51
|
-
@current_summary.total_scenario_count
|
52
|
+
@current_summary ? @current_summary.total_scenario_count : 0
|
52
53
|
end
|
53
54
|
|
54
55
|
# @return [Integer] number of passing tests in the latest test run
|
55
56
|
def passing_tests_count
|
56
|
-
@current_summary.passing_scenario_count
|
57
|
+
@current_summary ? @current_summary.passing_scenario_count : 0
|
57
58
|
end
|
58
59
|
|
59
60
|
# @return [Integer] number of failing tests in the latest test run
|
60
61
|
def failing_tests_count
|
61
|
-
@current_summary.failing_scenario_count
|
62
|
+
@current_summary ? @current_summary.failing_scenario_count : 0
|
62
63
|
end
|
63
64
|
|
64
65
|
# @return [String] css style class representing whether all tests passed or any failed
|
@@ -77,7 +78,7 @@ module QaServer::MonitorStatus
|
|
77
78
|
# url: '/qa/search/linked_data/locnames_ld4l_cache/person?q=mark twain&maxRecords=4',
|
78
79
|
# err_message: 'Exception: Something went wrong.' }, ... ]
|
79
80
|
def failures
|
80
|
-
@current_failure_data
|
81
|
+
@current_failure_data ? @current_failure_data : []
|
81
82
|
end
|
82
83
|
|
83
84
|
# @return [Boolean] true if failure data exists for the latest test run; otherwise false
|
@@ -2,8 +2,16 @@
|
|
2
2
|
# This presenter class provides historical testing data needed by the view that monitors status of authorities.
|
3
3
|
module QaServer::MonitorStatus
|
4
4
|
class HistoryPresenter
|
5
|
+
CAUTION_THRESHOLD = 0.05
|
6
|
+
WARNING_THRESHOLD = 0.1
|
7
|
+
|
5
8
|
# @param parent [QaServer::MonitorStatusPresenter] parent presenter
|
6
9
|
# @param historical_summary_data [Array<Hash>] summary of past failuring runs per authority to drive chart
|
10
|
+
# @example historical_summary_data
|
11
|
+
# {
|
12
|
+
# "AGROVOC_DIRECT"=>{:good=>4, :bad=>0},
|
13
|
+
# "AGROVOC_LD4L_CACHE"=>{:good=>4, :bad=>0}
|
14
|
+
# }
|
7
15
|
def initialize(parent:, historical_summary_data:)
|
8
16
|
@parent = parent
|
9
17
|
@historical_summary_data = historical_summary_data
|
@@ -11,8 +19,10 @@ module QaServer::MonitorStatus
|
|
11
19
|
|
12
20
|
# @return [Array<Hash>] historical test data to be displayed (authname, failing, passing)
|
13
21
|
# @example
|
14
|
-
#
|
15
|
-
#
|
22
|
+
# {
|
23
|
+
# "AGROVOC_DIRECT"=>{:good=>4, :bad=>0},
|
24
|
+
# "AGROVOC_LD4L_CACHE"=>{:good=>4, :bad=>0}
|
25
|
+
# }
|
16
26
|
def historical_summary
|
17
27
|
@historical_summary_data
|
18
28
|
end
|
@@ -69,47 +79,88 @@ module QaServer::MonitorStatus
|
|
69
79
|
end
|
70
80
|
end
|
71
81
|
|
82
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
83
|
+
# @return [String] name of the authority (e.g. 'AUTH_NAME')
|
84
|
+
# @example historical_entry
|
85
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
72
86
|
def historical_data_authority_name(historical_entry)
|
73
87
|
historical_entry[0]
|
74
88
|
end
|
75
89
|
|
90
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
91
|
+
# @return [Integer] number of days with passing tests (e.g. 949)
|
92
|
+
# @example historical_entry
|
93
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
76
94
|
def days_authority_passing(historical_entry)
|
77
95
|
historical_entry[1][:good]
|
78
96
|
end
|
79
97
|
|
98
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
99
|
+
# @return [Integer] number of days with failing tests (e.g. 51)
|
100
|
+
# @example historical_entry
|
101
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
80
102
|
def days_authority_failing(historical_entry)
|
81
103
|
historical_entry[1][:bad]
|
82
104
|
end
|
83
105
|
|
106
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
107
|
+
# @return [Integer] number of days tested (e.g. 1000)
|
108
|
+
# @example historical_entry
|
109
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
84
110
|
def days_authority_tested(historical_entry)
|
85
111
|
days_authority_passing(historical_entry) + days_authority_failing(historical_entry)
|
86
112
|
end
|
87
113
|
|
114
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
115
|
+
# @return [Float] percent of failing to passing tests (e.g. 0.05374 )
|
116
|
+
# @example historical_entry
|
117
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
88
118
|
def percent_authority_failing(historical_entry)
|
89
119
|
days_authority_failing(historical_entry).to_f / days_authority_tested(historical_entry)
|
90
120
|
end
|
91
121
|
|
122
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
123
|
+
# @return [String] percent of failing to passing tests (e.g. '5.4%')
|
124
|
+
# @example historical_entry
|
125
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
92
126
|
def percent_authority_failing_str(historical_entry)
|
93
127
|
ActiveSupport::NumberHelper.number_to_percentage(percent_authority_failing(historical_entry) * 100, precision: 1)
|
94
128
|
end
|
95
129
|
|
130
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
131
|
+
# @return [String] css class for background in Days Failing and Percent Failing columns (e.g. 'status-neutral', 'status-unknown', 'status-bad')
|
132
|
+
# @example historical_entry
|
133
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
96
134
|
def failure_style_class(historical_entry)
|
97
|
-
|
98
|
-
|
135
|
+
case percent_authority_failing(historical_entry)
|
136
|
+
when 0.0...CAUTION_THRESHOLD
|
137
|
+
"status-neutral"
|
138
|
+
when CAUTION_THRESHOLD...WARNING_THRESHOLD
|
139
|
+
"status-unknown"
|
140
|
+
else
|
141
|
+
"status-bad"
|
142
|
+
end
|
99
143
|
end
|
100
144
|
|
145
|
+
# @param historical_entry [Array<String,Hash>] data for a single authority including name, # passing tests (good), # failing tests (bad)
|
146
|
+
# @return [String] css class for background in Days Passing column (e.g. 'status-good', 'status-bad')
|
147
|
+
# @example historical_entry
|
148
|
+
# [ 'AUTH_NAME', { good: 949, bad: 51 } ]
|
101
149
|
def passing_style_class(historical_entry)
|
102
150
|
days_authority_passing(historical_entry) <= 0 ? "status-bad" : "status-good"
|
103
151
|
end
|
104
152
|
|
153
|
+
# @return [Boolean] true if historical section should be visible; otherwise false
|
105
154
|
def display_history_details?
|
106
155
|
display_historical_graph? || display_historical_datatable?
|
107
156
|
end
|
108
157
|
|
158
|
+
# @return [Boolean] true if historical graph should be visible; otherwise false
|
109
159
|
def display_historical_graph?
|
110
160
|
QaServer.config.display_historical_graph? && QaServer::HistoryGraphingService.history_graph_image_exists?
|
111
161
|
end
|
112
162
|
|
163
|
+
# @return [Boolean] true if historical datatable should be visible; otherwise false
|
113
164
|
def display_historical_datatable?
|
114
165
|
QaServer.config.display_historical_datatable?
|
115
166
|
end
|
@@ -44,8 +44,6 @@
|
|
44
44
|
<select name="authority" id="authority" class="string optional form-control form-control" value="" aria-labelledby="authority" onchange="hide_data()">
|
45
45
|
<option value=""><%= t('qa_server.check_status.select_authority') %></option>
|
46
46
|
<option disabled>──────────</option>
|
47
|
-
<option value="<%= @presenter.value_all_collections %>"><%= t('qa_server.check_status.show_all') %></option>
|
48
|
-
<option disabled>──────────</option>
|
49
47
|
<% @authorities_list.each do |auth_name| %>
|
50
48
|
<option value="<%= auth_name %>"<%= " selected" if auth_name == selected_authority %>><%= auth_name.upcase %></option>
|
51
49
|
<% end %>
|
@@ -77,7 +75,10 @@
|
|
77
75
|
<% end %>
|
78
76
|
|
79
77
|
|
80
|
-
<div id="status-loading-message" class="wait-message"
|
78
|
+
<div id="status-loading-message" class="wait-message">
|
79
|
+
<%= t('qa_server.check_status.wait_message_ln1') %><br>
|
80
|
+
<%= t('qa_server.check_status.wait_message_ln2') %>
|
81
|
+
</div>
|
81
82
|
|
82
83
|
<% if @presenter.connection_status_data? %>
|
83
84
|
<div id="connection-status-section" class="status-section">
|
@@ -100,7 +101,7 @@
|
|
100
101
|
</tr>
|
101
102
|
<% end %>
|
102
103
|
<tr>
|
103
|
-
<td class="<%= @presenter.status_style_class(status
|
104
|
+
<td class="<%= @presenter.status_style_class(status) %>"><%= @presenter.status_label(status[:status]) %></td>
|
104
105
|
<td><%= status[:subauthority_name] %></td>
|
105
106
|
<td><%= status[:service] %></td>
|
106
107
|
<td><%= status[:action] %></td>
|
@@ -137,8 +138,8 @@
|
|
137
138
|
</tr>
|
138
139
|
<% end %>
|
139
140
|
<tr>
|
140
|
-
<td class="position <%= @presenter.status_style_class(status
|
141
|
-
<td class="position <%= @presenter.status_style_class(status
|
141
|
+
<td class="position <%= @presenter.status_style_class(status) %>"><%= status[:expected] %></td>
|
142
|
+
<td class="position <%= @presenter.status_style_class(status) %>"><%= status[:actual] %></td>
|
142
143
|
<td><%= status[:request_data] %></td>
|
143
144
|
<td><a href="<%= status[:target] %>"><%= status[:target] %></a></td>
|
144
145
|
<td><%= status[:authority_name] %></td>
|