Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing whitespace in many places #331

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions config/dynniq_ec2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ secrets:
2: 2503
restrict_testing:
core_version: 3.1.2
sxl_version: 1.0.7

sxl_version: 1.0.7
4 changes: 2 additions & 2 deletions config/swarco_itc2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ secrets:
2: testcode2
restrict_testing:
core_version: 3.1.2
sxl_version: 1.0.7
sxl_version: 1.0.7
alarms:
A0302:
A0302:
component: KK+AG9998=001DL001
activation_input: 152
2 changes: 1 addition & 1 deletion spec/site/core/aggregated_status_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Verify that the controller responds to an aggregated status request.
#
# 1. Given the site is connected
# 2. Request aggregated status
# 2. Request aggregated status
# 3. Expect aggregated status response before timeout
it 'can be requested', core: '>=3.1.5' do |example|
Validator::Site.connected do |task,supervisor,site|
Expand Down
2 changes: 1 addition & 1 deletion spec/site/site_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Tests for RSMP sites (as opposed to supervisors), like traffic light controllers.
# Tests for RSMP sites (as opposed to supervisors), like traffic light controllers.
RSpec.describe 'Site' do
end
5 changes: 2 additions & 3 deletions spec/site/tlc/alarm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# because validator is meant for automated testing.

describe 'Alarm' do

# Validate that a detector logic fault A0302 is raises and cleared.
#
# The test requires that the device is programmed so that the alarm
Expand Down Expand Up @@ -81,7 +80,7 @@ def verify_timestamp alarm, duration=1.minute
#
# 1. Given the site is connected
# 2. When we trigger an alarm
# 2. Then we should receive an unacknowledged alarm issue
# 2. Then we should receive an unacknowledged alarm issue
# 4. When we acknowledge the alarm
# 5. Then we should recieve an acknowledged alarm issue

Expand Down Expand Up @@ -184,7 +183,7 @@ def verify_timestamp alarm, duration=1.minute
# clean up by resuming alarm
resume.attributes['mId'] = RSMP::Message.make_m_id # generate a message id, that can be used to listen for responses
collect_task = task.async do
RSMP::AlarmCollector.new(site,
RSMP::AlarmCollector.new(site,
m_id: resume.m_id,
num: 1,
query: {'aCI'=>alarm_code_id,'aSp'=>'Suspend','sS'=>'notSuspended'},
Expand Down
8 changes: 4 additions & 4 deletions spec/site/tlc/clock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
)

max_diff =
Validator.config['timeouts']['command_response'] +
Validator.config['timeouts']['command_response'] +
Validator.config['timeouts']['status_response']

diff = received - CLOCK
diff = diff.round
expect(diff.abs).to be <= max_diff,
expect(diff.abs).to be <= max_diff,
"Clock reported by S0096 is off by #{diff}s, should be within #{max_diff}s"
end
end
Expand Down Expand Up @@ -116,7 +116,7 @@

max_diff = Validator.config['timeouts']['command_response'] + Validator.config['timeouts']['status_response']
diff = Time.parse(collector.messages.first.attributes['sTs']) - CLOCK
diff = diff.round
diff = diff.round
expect(diff.abs).to be <= max_diff,
"Timestamp of S0096 is off by #{diff}s, should be within #{max_diff}s"
end
Expand Down Expand Up @@ -241,4 +241,4 @@
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/site/tlc/detector_logics_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

Expand Down
5 changes: 2 additions & 3 deletions spec/site/tlc/emergency_routes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

describe "Emergency Route" do
# 1. Verify connection
# 2. Verify that there is a Validator.config['validator'] with a emergency_route
# 3. Send control command to switch emergency_route
# 4. Wait for status "emergency_route" = requested
# 4. Wait for status "emergency_route" = requested
it 'can be activated with M0005', sxl: '>=1.0.7' do |example|
emergency_routes = Validator.config['items']['emergency_routes']
skip("No emergency routes configured") if emergency_routes.nil? || emergency_routes.empty?
Expand All @@ -15,6 +15,5 @@
emergency_routes.each { |emergency_route| switch_emergency_route emergency_route.to_s }
end
end

end
end
12 changes: 6 additions & 6 deletions spec/site/tlc/io_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

Expand All @@ -20,7 +20,7 @@

# 1. Verify connection
# 2. Send control command to set force input
# 3. Wait for status = true
# 3. Wait for status = true
specify 'forcing is set with M0019', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|

Expand Down Expand Up @@ -76,12 +76,12 @@
)

end
end
end

# 1. Verify connection
# 2. Verify that there is a Validator.config['validator'] with a input
# 3. Send control command to switch input
# 4. Wait for status "input" = requested
# 4. Wait for status "input" = requested
it 'is activated with M0006', sxl: '>=1.0.7' do |example|
inputs = Validator.config['items']['inputs']
skip("No inputs configured") if inputs.nil? || inputs.empty?
Expand All @@ -93,7 +93,7 @@

# 1. Verify connection
# 2. Send control command to set a serie of input
# 3. Wait for status = true
# 3. Wait for status = true
specify 'series is activated with M0013', sxl: '>=1.0.8' do |example|
Validator::Site.connected do |task,supervisor,site|
status = "3,4143,65;12,1,4"
Expand All @@ -104,7 +104,7 @@

# 1. Verify connection
# 2. Send control command to set trigger level
# 3. Wait for status = true
# 3. Wait for status = true
specify 'sensitivity is set with M0021', sxl: '>=1.0.15' do |example|
Validator::Site.connected do |task,supervisor,site|
prepare task, site
Expand Down
2 changes: 1 addition & 1 deletion spec/site/tlc/modes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
status_list = { S0012: [:status,:intersection,:source] }
else
status_list = { S0012: [:status,:intersection] }
end
end
request_status_and_confirm site, "all-red status", status_list
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/site/tlc/signal_groups_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

Expand All @@ -7,7 +7,7 @@
#
# 1. Verify connection
# 2. Send control command to start signalgrup, set_signal_start= true, include security_code
# 3. Wait for status = true
# 3. Wait for status = true
it 'is ordered to green with M0010', :important, sxl: '>=1.0.8' do |example|
Validator::Site.connected do |task,supervisor,site|
prepare task, site
Expand All @@ -17,7 +17,7 @@

# 1. Verify connection
# 2. Send control command to stop signalgrup, set_signal_start= false, include security_code
# 3. Wait for status = true
# 3. Wait for status = true
it 'is ordered to red with M0011', :important, sxl: '>=1.0.8' do |example|
Validator::Site.connected do |task,supervisor,site|
prepare task, site
Expand Down Expand Up @@ -60,7 +60,7 @@

# 1. Verify connection
# 2. Send control command to start or stop a serie of signalgroups
# 3. Wait for status = true
# 3. Wait for status = true
specify 'series can be started/stopped with M0012', :important, sxl: '>=1.0.8' do |example|
Validator::Site.connected do |task,supervisor,site|
prepare task, site
Expand Down
10 changes: 5 additions & 5 deletions spec/site/tlc/signal_plans_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

# 1. Verify connection
# 2. Send control command to set week_table
# 3. Wait for status = true
# 3. Wait for status = true
specify 'week table is set with M0016', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = "0-1,6-2"
Expand All @@ -96,7 +96,7 @@

# 1. Verify connection
# 2. Send control command to set time_table
# 3. Wait for status = true
# 3. Wait for status = true
specify 'day table is set with M0017', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = "12-1-12-59,1-0-23-12"
Expand All @@ -119,7 +119,7 @@

# 1. Verify connection
# 2. Send control command to set cycle time
# 3. Wait for status = true
# 3. Wait for status = true
it 'M0018 set cycle time', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = 5
Expand Down Expand Up @@ -210,7 +210,7 @@

# 1. Verify connection
# 2. Send control command to set dynamic_bands
# 3. Wait for status = true
# 3. Wait for status = true
specify 'offset is set with M0015', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
plan = 1
Expand All @@ -234,7 +234,7 @@

# 1. Verify connection
# 2. Send control command to set cycle time
# 3. Wait for status = true
# 3. Wait for status = true
specify 'cycle time is set with M0018', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = 5
Expand Down
2 changes: 1 addition & 1 deletion spec/site/tlc/signal_priority_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def send_priority_request log, id:nil, site:, component:
site.send_command component, command_list
end

send_priority_request "Send an unrelated signal priority request before",
send_priority_request "Send an unrelated signal priority request before",
site: site, component: component
send_priority_request "Send our signal priority request",
site: site, component: component, id: request_id
Expand Down
2 changes: 1 addition & 1 deletion spec/site/tlc/system_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

Expand Down
6 changes: 3 additions & 3 deletions spec/site/tlc/tlc_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RSpec.describe 'Site' do
# Tests for Traffic Light Controllers.
describe 'Traffic Light Controller' do
end
# Tests for Traffic Light Controllers.
describe 'Traffic Light Controller' do
end
end
2 changes: 1 addition & 1 deletion spec/site/tlc/traffic_situations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RSpec.describe 'Site::Traffic Light Controller' do
RSpec.describe 'Site::Traffic Light Controller' do
include Validator::CommandHelpers
include Validator::StatusHelpers

Expand Down
4 changes: 2 additions & 2 deletions spec/supervisor/aggregated_status_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe 'Supervisor' do

# Validate behaviour related to aggregated status messages
# Validate behaviour related to aggregated status messages
describe 'Aggregated Status' do

# Validate that the supervisor responds correctly when we send an aggregated status message
Expand All @@ -17,4 +17,4 @@
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/support/command_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def set_security_code level
end

def require_security_codes
unless Validator.config.dig 'secrets', 'security_codes'
unless Validator.config.dig 'secrets', 'security_codes'
skip "Security codes are not configured"
end
end
Expand Down Expand Up @@ -448,7 +448,7 @@ def wrong_security_code
component = Validator.config['components']['detector_logic'].keys[0]
result = @site.send_command component, command_list, collect!: {
timeout: Validator.config['timeouts']['command_response']
}
}
end

def wait_normal_control timeout: Validator.config['timeouts']['startup_sequence']
Expand Down
4 changes: 2 additions & 2 deletions spec/support/formatters/brief.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def example_passed notification
@output << colorize("#{indent}#{notification.example.description}\n",:success)
end

def example_failed notification
def example_failed notification
@output << colorize("#{indent}#{notification.example.description}",:failure)

# expect { }.not_to raise_error might raise an RSpec::Expectations::ExpectationNotMetError,
Expand All @@ -44,4 +44,4 @@ def example_pending notification
def dump_failures notification
end
end
end
end
4 changes: 2 additions & 2 deletions spec/support/formatters/details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def example_passed notification # ExampleNotification
@output << colorize(" Passed\n\n",:success)
end

def example_failed notification
def example_failed notification
# RSpec::Core::Formatters::ExceptionPresenter is a private class which
# should not really be used by us, but the snippet extraction and backtrace
# processing seems rather cumbersome to reimplement
Expand All @@ -56,4 +56,4 @@ def dump_pending notification
super notification
end
end
end
end
4 changes: 2 additions & 2 deletions spec/support/formatters/formatter_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def dump_pending notification

def dump_sentinel_warnings
warnings = Validator::Testee.sentinel_errors
if warnings.any?
if warnings.any?
@output << "\n\nSentinel warnings:\n\n"
warnings.each.with_index(1) do |warning,i|
@output << colorize("#{i.to_s.rjust(4)}) #{warning.class}\n",:yellow)
Expand Down Expand Up @@ -67,4 +67,4 @@ def close notification
@output << "\n"
end
end
end
end
4 changes: 2 additions & 2 deletions spec/support/formatters/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def example_passed notification # ExampleNotification
@output << colorize("#{notification.example.full_description}\n",:success)
end

def example_failed notification
def example_failed notification
@output << colorize("#{notification.example.full_description}\n",:failure)
end
end
end
end
Loading