Skip to content

Commit

Permalink
display validated resource count
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammjammjamm committed Feb 20, 2023
1 parent 7feb167 commit ab93676
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 34 deletions.
60 changes: 30 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.7)
activesupport (6.1.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -20,7 +20,7 @@ GEM
blueprinter (0.25.2)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.0)
connection_pool (2.3.0)
crack (0.4.5)
rexml
Expand All @@ -29,8 +29,8 @@ GEM
database_cleaner (~> 1.99.0)
sequel
date_time_precision (0.8.1)
debug (1.6.3)
irb (>= 1.3.6)
debug (1.7.1)
irb (>= 1.5.0)
reline (>= 0.3.1)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
Expand Down Expand Up @@ -70,7 +70,7 @@ GEM
dry-core (~> 0.5, >= 0.5)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
factory_bot (6.2.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
Expand Down Expand Up @@ -166,8 +166,8 @@ GEM
sqlite3 (~> 1.4)
thor (~> 1.2.1)
tty-markdown (~> 0.7.1)
io-console (0.5.11)
irb (1.4.2)
io-console (0.6.0)
irb (1.6.2)
reline (>= 0.3.0)
jwt (2.7.0)
kramdown (2.4.0)
Expand All @@ -177,7 +177,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mini_portile2 (2.8.1)
minitest (5.16.3)
minitest (5.17.0)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
Expand All @@ -188,14 +188,14 @@ GEM
mustermann (= 1.1.2)
netrc (0.11.0)
nio4r (2.5.8)
nokogiri (1.14.1)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.14.1-arm64-darwin)
nokogiri (1.14.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.1-x86_64-darwin)
nokogiri (1.14.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.1-x86_64-linux)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -212,14 +212,14 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.0)
public_suffix (5.0.1)
puma (5.6.5)
nio4r (~> 2.0)
racc (1.6.2)
rack (2.2.6.2)
rake (13.0.6)
redis (4.8.0)
reline (0.3.1)
redis (4.8.1)
reline (0.3.2)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
Expand All @@ -228,19 +228,19 @@ GEM
netrc (~> 0.8)
rexml (3.2.5)
rouge (3.30.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
ruby2_keywords (0.0.5)
sequel (5.42.0)
sidekiq (6.5.8)
Expand All @@ -258,7 +258,7 @@ GEM
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
thor (1.2.1)
tilt (2.0.11)
tilt (2.1.0)
tty-color (0.6.0)
tty-markdown (0.7.1)
kramdown (>= 1.16.2, < 3.0)
Expand All @@ -268,18 +268,18 @@ GEM
tty-color (~> 0.5)
tty-screen (~> 0.8)
tty-screen (0.8.1)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode_utils (1.4.0)
webmock (3.14.0)
webmock (3.18.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.6)
zeitwerk (2.6.7)

PLATFORMS
arm64-darwin-21
Expand Down
25 changes: 21 additions & 4 deletions lib/smart_scheduling_links_test_kit/resource_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def max_lines
def validate_response(url, profile_url)
previous_chunk = String.new

@valid_resource_count ||= 0

line_count = 0

process_body = lambda do |new_chunk, _|
Expand All @@ -22,7 +24,7 @@ def validate_response(url, profile_url)
assert_valid_json(line)

resource = FHIR.from_contents(line)
resource_is_valid?(resource:, profile_url:)
@valid_resource_count += 1 if resource_is_valid?(resource:, profile_url:)

line_count += 1
end
Expand Down Expand Up @@ -77,10 +79,15 @@ class ResourceGroup < Inferno::TestGroup

end

assert(messages.none? { |message| message[:type] == 'error' })
assert(
messages.none? { |message| message[:type] == 'error' },
"Succesfully validated #{@valid_resource_count} resources. Test stops after first invalid resource"
)
end

assert vtrcks_pin_found, "No Locations included a VTrckS PIN."

pass "Successfully validated #{@valid_resource_count} resources."
end
end

Expand All @@ -104,8 +111,13 @@ class ResourceGroup < Inferno::TestGroup
slot_urls.each do |slot_url|
validate_response(slot_url, profile_url)

assert(messages.none? { |message| message[:type] == 'error' })
assert(
messages.none? { |message| message[:type] == 'error' },
"Succesfully validated #{@valid_resource_count} resources. Test stops after first invalid resource"
)
end

pass "Successfully validated #{@valid_resource_count} resources."
end
end

Expand All @@ -129,8 +141,13 @@ class ResourceGroup < Inferno::TestGroup
schedule_urls.each do |schedule_url|
validate_response(schedule_url, profile_url)

assert(messages.none? { |message| message[:type] == 'error' })
assert(
messages.none? { |message| message[:type] == 'error' },
"Succesfully validated #{@valid_resource_count} resources. Test stops after first invalid resource"
)
end

pass "Successfully validated #{@valid_resource_count} resources."
end
end
end
Expand Down

0 comments on commit ab93676

Please sign in to comment.