inferno_core 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/inferno/apps/cli/requirements.rb +2 -2
- data/lib/inferno/apps/cli/requirements_coverage_checker.rb +1 -1
- data/lib/inferno/apps/cli/requirements_exporter.rb +2 -2
- data/lib/inferno/apps/web/serializers/requirement.rb +3 -1
- data/lib/inferno/config/boot/requirements.rb +9 -4
- data/lib/inferno/dsl/must_support_assessment.rb +23 -0
- data/lib/inferno/entities/requirement.rb +24 -10
- data/lib/inferno/repositories/requirements.rb +12 -4
- data/lib/inferno/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b6ca0be7f115ec7578f07efdb81f51301ffc58011257839439325a0f232f3dd
|
4
|
+
data.tar.gz: 79c99071c6d89aafea8234c9fea372efbbaf4835f39da46bad226a8b12a317b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb251b81e0232761cdddd83603a00d7d16844c61a8c80315b4a239a2f3ff1a6305700bd9c7f352d8c179773ecc45e5d5f824d08f3c00438f4cf460069cb0ae16
|
7
|
+
data.tar.gz: f01952a5cd0cd31c5e6f35901409581cd047d7b6bd099865efa9bebfe40450d115c299266b1c700a7fd7cceb7b20b15a0e8635e6ff482e27193af81030d7b400
|
@@ -43,7 +43,7 @@ module Inferno
|
|
43
43
|
RequirementsCoverageChecker.new(test_suite_id).run
|
44
44
|
else
|
45
45
|
Inferno::Repositories::TestSuites.all.each do |test_suite|
|
46
|
-
if Object.const_source_location(test_suite.to_s).first.start_with? Dir.pwd
|
46
|
+
if Object.const_source_location(test_suite.to_s).first.start_with? File.join(Dir.pwd, 'lib')
|
47
47
|
RequirementsCoverageChecker.new(test_suite.id).run
|
48
48
|
end
|
49
49
|
end
|
@@ -66,7 +66,7 @@ module Inferno
|
|
66
66
|
RequirementsCoverageChecker.new(test_suite_id).run_check
|
67
67
|
else
|
68
68
|
Inferno::Repositories::TestSuites.all.each do |test_suite|
|
69
|
-
if Object.const_source_location(test_suite.to_s).first.start_with?
|
69
|
+
if Object.const_source_location(test_suite.to_s).first.start_with?(Dir.pwd, 'lib')
|
70
70
|
RequirementsCoverageChecker.new(test_suite.id).run_check
|
71
71
|
end
|
72
72
|
end
|
@@ -10,7 +10,7 @@ module Inferno
|
|
10
10
|
'URL*',
|
11
11
|
'Requirement*',
|
12
12
|
'Conformance*',
|
13
|
-
'
|
13
|
+
'Actors*',
|
14
14
|
'Sub-Requirement(s)',
|
15
15
|
'Conditionality',
|
16
16
|
'Verifiable?',
|
@@ -25,7 +25,7 @@ module Inferno
|
|
25
25
|
'URL',
|
26
26
|
'Requirement',
|
27
27
|
'Conformance',
|
28
|
-
'
|
28
|
+
'Actors',
|
29
29
|
'Sub-Requirement(s)',
|
30
30
|
'Conditionality',
|
31
31
|
'Not Tested Reason',
|
@@ -8,10 +8,12 @@ module Inferno
|
|
8
8
|
|
9
9
|
field :requirement
|
10
10
|
field :conformance
|
11
|
-
field :
|
11
|
+
field :actors
|
12
12
|
field :sub_requirements
|
13
13
|
field :conditionality
|
14
14
|
field :url, if: :field_present?
|
15
|
+
field :not_tested_reason, if: :field_present?
|
16
|
+
field :not_tested_details, if: :field_present?
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
@@ -12,19 +12,24 @@ Inferno::Application.register_provider(:requirements) do
|
|
12
12
|
.specs
|
13
13
|
.select { |spec| spec.metadata.fetch('inferno_test_kit', 'false').casecmp? 'true' }
|
14
14
|
|
15
|
-
files_to_load = Dir.glob(['lib
|
15
|
+
files_to_load = Dir.glob(['lib/*/requirements/*.csv'])
|
16
16
|
|
17
17
|
if ENV['LOAD_DEV_SUITES'].present?
|
18
18
|
ENV['LOAD_DEV_SUITES'].split(',').map(&:strip).reject(&:empty?).each do |suite|
|
19
|
-
files_to_load.concat
|
20
|
-
|
19
|
+
files_to_load.concat(
|
20
|
+
Dir.glob(
|
21
|
+
File.join(
|
22
|
+
Inferno::Application.root, 'dev_suites', suite, 'requirements', '*.csv'
|
23
|
+
)
|
24
|
+
)
|
25
|
+
)
|
21
26
|
end
|
22
27
|
end
|
23
28
|
|
24
29
|
files_to_load +=
|
25
30
|
test_kit_gems.flat_map do |gem|
|
26
31
|
[
|
27
|
-
Dir.glob([File.join(gem.full_gem_path, 'lib', '*
|
32
|
+
Dir.glob([File.join(gem.full_gem_path, 'lib', '*', 'requirements', '*.csv')])
|
28
33
|
].flatten
|
29
34
|
end
|
30
35
|
|
@@ -234,6 +234,10 @@ module Inferno
|
|
234
234
|
|
235
235
|
def resource_populates_element?(resource, element_definition)
|
236
236
|
path = element_definition[:path]
|
237
|
+
|
238
|
+
# handle MustSupport element under extension: Ex: extension:supporting-info.value[x]
|
239
|
+
resource, path = process_must_support_element_in_extension(resource, path) if path.start_with?('extension:')
|
240
|
+
|
237
241
|
ms_extension_urls = must_support_extensions.select { |ex| ex[:path] == "#{path}.extension" }
|
238
242
|
.map { |ex| ex[:url] }
|
239
243
|
|
@@ -245,6 +249,25 @@ module Inferno
|
|
245
249
|
value_found.present? || value_found == false
|
246
250
|
end
|
247
251
|
|
252
|
+
def process_must_support_element_in_extension(resource, path)
|
253
|
+
return [resource, path] unless path.start_with?('extension:')
|
254
|
+
|
255
|
+
path_without_prefix = path.delete_prefix('extension:')
|
256
|
+
extension_split = path_without_prefix.split('.')
|
257
|
+
extension_name = extension_split.first
|
258
|
+
extension_path = extension_split.last
|
259
|
+
|
260
|
+
found_extension_url = must_support_extensions.find { |ex| ex[:id].include?(extension_name) }[:url]
|
261
|
+
ms_element_extension = resource.extension.find { |ex| ex.url == found_extension_url }
|
262
|
+
|
263
|
+
if ms_element_extension.present?
|
264
|
+
resource = ms_element_extension
|
265
|
+
path = extension_path
|
266
|
+
end
|
267
|
+
|
268
|
+
[resource, path]
|
269
|
+
end
|
270
|
+
|
248
271
|
def matching_without_extensions?(value, ms_extension_urls, fixed_value)
|
249
272
|
if value.instance_of?(Inferno::DSL::PrimitiveType)
|
250
273
|
urls = value.extension&.map(&:url)
|
@@ -11,7 +11,7 @@ module Inferno
|
|
11
11
|
:url,
|
12
12
|
:requirement,
|
13
13
|
:conformance,
|
14
|
-
:
|
14
|
+
:actors,
|
15
15
|
:sub_requirements,
|
16
16
|
:conditionality,
|
17
17
|
:not_tested_reason,
|
@@ -23,7 +23,9 @@ module Inferno
|
|
23
23
|
def initialize(params)
|
24
24
|
super(params, ATTRIBUTES)
|
25
25
|
|
26
|
-
|
26
|
+
return unless requirement_set.blank? && (id&.include?('@') || id&.include?('#'))
|
27
|
+
|
28
|
+
self.requirement_set = id.split(/[@#]/).first
|
27
29
|
end
|
28
30
|
|
29
31
|
# Expand a comma-delimited list of requirement id references into an Array
|
@@ -35,12 +37,14 @@ module Inferno
|
|
35
37
|
# used if none is included in the `requirement_id_string`
|
36
38
|
#
|
37
39
|
# @example
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
40
|
+
# expand_requirement_ids('example-ig@1,3,5-7')
|
41
|
+
# # => ['example-ig@1','example-ig@3','example-ig@5','example-ig@6','example-ig@7']
|
42
|
+
# expand_requirement_ids('example-ig')
|
43
|
+
# # => []
|
44
|
+
# expand_requirement_ids('1,3,5-7', 'example-ig')
|
45
|
+
# # => ['example-ig@1','example-ig@3','example-ig@5','example-ig@6','example-ig@7']
|
46
|
+
# expand_requirement_ids('example-ig#actor1')
|
47
|
+
# # => [all requirements for actor1 from example-ig]
|
44
48
|
def self.expand_requirement_ids(requirement_id_string, default_set = nil) # rubocop:disable Metrics/CyclomaticComplexity
|
45
49
|
return [] if requirement_id_string.blank?
|
46
50
|
|
@@ -49,10 +53,16 @@ module Inferno
|
|
49
53
|
.split(',')
|
50
54
|
.map(&:strip)
|
51
55
|
.flat_map do |requirement_string|
|
52
|
-
|
56
|
+
if requirement_string.include? '@'
|
57
|
+
current_set, requirement_string = requirement_string.split('@')
|
58
|
+
elsif requirement_string.include? '#'
|
59
|
+
current_set, actor = requirement_string.split('#')
|
60
|
+
end
|
53
61
|
|
54
62
|
requirement_ids =
|
55
|
-
if
|
63
|
+
if actor.present?
|
64
|
+
return Repositories::Requirements.new.requirements_for_actor(current_set, actor).map(&:id)
|
65
|
+
elsif requirement_string.include? '-'
|
56
66
|
start_id, end_id = requirement_string.split('-')
|
57
67
|
if start_id.match?(/^\d+$/) && end_id.match?(/^\d+$/)
|
58
68
|
(start_id..end_id).to_a
|
@@ -67,6 +77,10 @@ module Inferno
|
|
67
77
|
end
|
68
78
|
end
|
69
79
|
|
80
|
+
def actor?(actor_to_check)
|
81
|
+
actors.any? { |actor| actor.casecmp? actor_to_check }
|
82
|
+
end
|
83
|
+
|
70
84
|
def tested?
|
71
85
|
not_tested_reason.blank?
|
72
86
|
end
|
@@ -10,6 +10,8 @@ module Inferno
|
|
10
10
|
result = []
|
11
11
|
|
12
12
|
CSV.foreach(path, headers: true, header_converters: :symbol) do |row|
|
13
|
+
next if row[:conformance].casecmp? 'deprecated'
|
14
|
+
|
13
15
|
req_set = row[:req_set]
|
14
16
|
id = row[:id]
|
15
17
|
sub_requirements_field = row[:subrequirements]
|
@@ -25,12 +27,14 @@ module Inferno
|
|
25
27
|
url: row[:url],
|
26
28
|
requirement: row[:requirement],
|
27
29
|
conformance: row[:conformance],
|
28
|
-
|
30
|
+
actors: row[:actors].split(',').map(&:strip),
|
29
31
|
sub_requirements: sub_requirements,
|
30
32
|
conditionality: row[:conditionality]&.downcase,
|
31
33
|
not_tested_reason: row[:not_tested_reason],
|
32
34
|
not_tested_details: row[:not_tested_details]
|
33
35
|
}
|
36
|
+
rescue StandardError => e
|
37
|
+
Application[:logger].error("Unable to load requirement: #{combined_id}:\n#{e.full_message.lines.first}")
|
34
38
|
end
|
35
39
|
|
36
40
|
result.each do |raw_req|
|
@@ -40,6 +44,10 @@ module Inferno
|
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
47
|
+
def requirements_for_actor(requirement_set, actor)
|
48
|
+
all.select { |requirement| requirement.requirement_set == requirement_set && requirement.actor?(actor) }
|
49
|
+
end
|
50
|
+
|
43
51
|
def filter_requirements_by_ids(ids)
|
44
52
|
all.select { |requirement| ids.include?(requirement.id) }
|
45
53
|
end
|
@@ -74,7 +82,7 @@ module Inferno
|
|
74
82
|
.flat_map do |requirement_set|
|
75
83
|
all.select do |requirement|
|
76
84
|
requirement.requirement_set == requirement_set.identifier &&
|
77
|
-
requirement.actor
|
85
|
+
requirement.actor?(requirement_set.actor)
|
78
86
|
end
|
79
87
|
end
|
80
88
|
end
|
@@ -85,7 +93,7 @@ module Inferno
|
|
85
93
|
requirement_set
|
86
94
|
.expand_requirement_ids
|
87
95
|
.map { |requirement_id| find(requirement_id) }
|
88
|
-
.select { |requirement| requirement.actor
|
96
|
+
.select { |requirement| requirement.actor?(requirement_set.actor) }
|
89
97
|
end
|
90
98
|
end
|
91
99
|
|
@@ -103,7 +111,7 @@ module Inferno
|
|
103
111
|
.flat_map(&:sub_requirements)
|
104
112
|
.select do |requirement_id|
|
105
113
|
referenced_requirement_sets.any? do |set|
|
106
|
-
requirement_id.start_with?("#{set.identifier}@") &&
|
114
|
+
requirement_id.start_with?("#{set.identifier}@") && find(requirement_id)&.actor?(set.actor)
|
107
115
|
end
|
108
116
|
end
|
109
117
|
|
data/lib/inferno/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inferno_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-06-
|
13
|
+
date: 2025-06-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|