Skip to content

Commit

Permalink
run cartesio on core matrix, add versions
Browse files Browse the repository at this point in the history
  • Loading branch information
emiltin committed Sep 19, 2024
1 parent d7ad79f commit 49f0397
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/semaforica_cartesio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: [ self-hosted, Linux, X64, cartesio ]
strategy:
matrix:
core: ['3.2.2']
core: ['3.1.2', '3.1.3', '3.1.4', '3.1.5', '3.2', '3.2.1', '3.2.2']
fail-fast: false

steps:
Expand Down
5 changes: 3 additions & 2 deletions config/gem_tlc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Config for testing a site running on localhost (e.g. from the rsmp gem)
# The settings are used for starting a local supervisor listening for the site tested
core_version: 3.2.0
sxl: tlc
sxl_version: 1.2.0
port: 13111
intervals:
timer: 0.1
Expand Down Expand Up @@ -46,8 +49,6 @@ alarms:
A0302:
activation_input: 7
component: DL1
restrict_testing:
sxl_version: 1.2.1
log:
watchdogs: false
acknowledgements: false
7 changes: 3 additions & 4 deletions docs/pages/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ All settings except `components` and `items` can be left out, in which case the
```yaml
port: 13111 # port to listen on
ips: all # allowed ip addresses. either 'all' or a list. defaults to 'all' if left out
rsmp_versions: all # allowed core version(s). either 'all' or a list. defaults to 'all' if left out
core_version: 3.2.2 # allowed core version. defaults to the latest core version
sxl: tlc # sxl of the connecting site, options are 'core' or 'tlc'
intervals:
timer: 1 # main timer interval (resolution), in seconds
Expand Down Expand Up @@ -90,7 +90,6 @@ items: # other configurations that should be tested
force_input: 5 # what input to force when testing input forcing
startup_sequence: 'efg' # expected startup sequence
restrict_testing: # restrict what tests are run, default is to run all
core_version: 3.2.2 # skip unless relevant for core 3.2.2
sxl_version: 1.2.1 # skip unless relevant for sxl 1.2.1
secrets: # place secrets or in a separate file, see below
security_codes: # RSMP security codes. there are no defaults for these
Expand All @@ -102,7 +101,7 @@ alarm_activation: # how to trigger alarms by forcing inputs
component: DL1 # and will active on component DL1
```

The following settings will be copied into a configuration for the local supervisor: `port`, `sxl`, `intervals`, `timeouts`, `components`, `rsmp_versions`.
The following settings will be copied into a configuration for the local supervisor: `port`, `sxl`, `intervals`, `timeouts`, `components`, `core_version`.

The supervisor config will also have `max_sites: 1` and `ips: all` meaning it will allow connections from any ip and with any RSMP site id, but will only allow one site to be connected at a time. Multiple connections will be flagged as an error.

Expand All @@ -119,6 +118,7 @@ site_id: RN+SI0001 # site id of local site
supervisors: # what supervisor the local site should connect to
- ip: 127.0.0.1 # ip
port: 13111 # port
core_version: 3.2.2 # allowed core version. defaults to the latest core version
sxl: tlc # sxl to use, options are 'core' or 'tlc'
sxl_version: 1.1 # sxl version to use
components: # components of local site, organized by type and name
Expand Down Expand Up @@ -146,7 +146,6 @@ timeouts: # timeouts
watchdog: 0.2 # max time between receiving watchdogs, in seconds
acknowledgement: 0.2 # max time unless a message we send is acknowledged, in seconds
restrict_testing: # restrict what tests are run, default is to run all
core_version: 3.2.2 # skip unless relevant for core 3.2.2
sxl_version: 1.2.1 # skip unless relevant for sxl 1.2.1
secrets: # place secrets or in a separate file, see below
security_codes: # RSMP security codes. there are no defaults for these
Expand Down
2 changes: 1 addition & 1 deletion spec/supervisor/connect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def get_connection_message core_version, length
got = nil
Validator::Supervisor.isolated(
'rsmp_versions' => [core_version],
'core_version' => core_version,
'collect' => {
timeout: Validator.get_config('timeouts','ready'),
num: length,
Expand Down
2 changes: 1 addition & 1 deletion spec/support/handshake_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_connection_message core_version, length
Validator::Site.isolated(
'collect' => {timeout: timeout, num: length, ingoing: true, outgoing: true},
'guest' => {
'rsmp_versions' => [core_version],
'core_version' => core_version,
}
) do |task,supervisor,site|
expect(site.ready?).to be true
Expand Down
2 changes: 1 addition & 1 deletion spec/support/test_site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def stop
def parse_config
# build rsmp supervisor config by
# picking elements from the config
want = ['sxl','intervals','timeouts','components','rsmp_versions','core_version','skip_validation']
want = ['sxl','intervals','timeouts','components','core_version','skip_validation']
guest_settings = config.select { |key| want.include? key }
@supervisor_config = {
'port' => config['port'],
Expand Down
27 changes: 12 additions & 15 deletions spec/support/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,25 +288,22 @@ def self.setup_filters rspec_config
# enable filtering by rsmp core version tags like '>=3.1.2'
# Gem::Requirement and Gem::Version classed are used to do the version matching,
# but this otherwise has nothing to do with Gems
core_version = Validator.config.dig('core_version')
if core_version
core_version = Gem::Version.new core_version
core_filter = -> (v) {
!Gem::Requirement.new(v).satisfied_by?(core_version)
}
# redefine the inspect method on our proc object,
# so we get more useful display of the filter option when we
# run rspec on the command line
def core_filter.inspect
"[unless relevant for #{Validator.config.dig('core_version')}]"
end
rspec_config.filter_run_excluding core: core_filter
core_version = Gem::Version.new Validator.config['core_version']
core_filter = -> (v) {
!Gem::Requirement.new(v).satisfied_by?(core_version)
}
# redefine the inspect method on our proc object,
# so we get more useful display of the filter option when we
# run rspec on the command line
def core_filter.inspect
"[tests not relevant for #{Validator.config['core_version']}]"
end
rspec_config.filter_run_excluding core: core_filter

# enable filtering by sxl version tags like '>=1.0.7'
# Gem::Requirement and Gem::Version classed are used to do the version matching,
# but this otherwise has nothing to do with Gems
sxl_version = Validator.config.dig('restrict_testing','sxl_version')
sxl_version = Validator.config['sxl_version']
if sxl_version
sxl_version = Gem::Version.new sxl_version
sxl_filter = -> (v) {
Expand All @@ -316,7 +313,7 @@ def core_filter.inspect
# so we get more useful display of the filter option when we
# run rspec on the command line
def sxl_filter.inspect
"[unless relevant for #{Validator.config.dig('restrict_testing','sxl_version')}]"
"[tests not relevant for #{Validator.config['sxl_version']}]"
end
rspec_config.filter_run_excluding sxl: sxl_filter
end
Expand Down

0 comments on commit 49f0397

Please sign in to comment.