inferno_core 0.3.2 → 0.3.5

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/web/controllers/test_sessions/create.rb +7 -3
  3. data/lib/inferno/apps/web/index.html.erb +6 -1
  4. data/lib/inferno/apps/web/router.rb +9 -2
  5. data/lib/inferno/apps/web/serializers/suite_option.rb +13 -0
  6. data/lib/inferno/apps/web/serializers/test_group.rb +6 -2
  7. data/lib/inferno/apps/web/serializers/test_session.rb +5 -3
  8. data/lib/inferno/apps/web/serializers/test_suite.rb +4 -1
  9. data/lib/inferno/config/boot/db.rb +1 -1
  10. data/lib/inferno/config/boot.rb +1 -1
  11. data/lib/inferno/db/migrations/007_add_suite_options.rb +5 -0
  12. data/lib/inferno/db/schema.rb +1 -0
  13. data/lib/inferno/dsl/configurable.rb +1 -1
  14. data/lib/inferno/dsl/fhir_client.rb +22 -10
  15. data/lib/inferno/dsl/fhir_validation.rb +35 -12
  16. data/lib/inferno/dsl/http_client.rb +47 -35
  17. data/lib/inferno/dsl/input_output_handling.rb +22 -2
  18. data/lib/inferno/dsl/runnable.rb +36 -10
  19. data/lib/inferno/dsl/suite_option.rb +40 -0
  20. data/lib/inferno/dsl/tcp_exception_handler.rb +11 -0
  21. data/lib/inferno/entities/test.rb +7 -3
  22. data/lib/inferno/entities/test_group.rb +4 -4
  23. data/lib/inferno/entities/test_session.rb +40 -1
  24. data/lib/inferno/entities/test_suite.rb +12 -14
  25. data/lib/inferno/public/bundle.js +15 -15
  26. data/lib/inferno/repositories/test_sessions.rb +24 -0
  27. data/lib/inferno/test_runner.rb +9 -3
  28. data/lib/inferno/version.rb +1 -1
  29. data/spec/support/factory_bot.rb +6 -0
  30. metadata +23 -7
  31. data/lib/inferno/public/bg-header-1920x170.png +0 -0
  32. data/lib/inferno/public/healthit.gov.logo.png +0 -0
@@ -19,6 +19,18 @@ module Inferno
19
19
  }
20
20
  end
21
21
 
22
+ def create(params)
23
+ raw_suite_options = params[:suite_options]
24
+ suite_options =
25
+ if raw_suite_options.blank?
26
+ '[]'
27
+ else
28
+ JSON.generate(raw_suite_options.map(&:to_hash))
29
+ end
30
+
31
+ super(params.merge(suite_options: suite_options))
32
+ end
33
+
22
34
  def results_for_test_session(test_session_id)
23
35
  test_session_hash =
24
36
  self.class::Model
@@ -37,6 +49,18 @@ module Inferno
37
49
  end
38
50
  end
39
51
 
52
+ def build_entity(params)
53
+ suite_options = JSON.parse(params[:suite_options] || '[]').map do |suite_option_hash|
54
+ suite_option_hash.deep_symbolize_keys!
55
+ suite_option_hash[:id] = suite_option_hash[:id].to_sym
56
+ DSL::SuiteOption.new(suite_option_hash)
57
+ end
58
+
59
+ final_params = params.merge(suite_options: suite_options)
60
+ add_non_db_entities(final_params)
61
+ entity_class.new(final_params)
62
+ end
63
+
40
64
  class Model < Sequel::Model(db)
41
65
  include Import[test_suites_repo: 'repositories.test_suites']
42
66
 
@@ -62,7 +62,13 @@ module Inferno
62
62
  inputs = load_inputs(test)
63
63
  input_json_string = inputs_as_json(test, inputs)
64
64
 
65
- test_instance = test.new(inputs: inputs, test_session_id: test_session.id, scratch: scratch)
65
+ test_instance =
66
+ test.new(
67
+ inputs: inputs,
68
+ test_session_id: test_session.id,
69
+ scratch: scratch,
70
+ suite_options: test_session.suite_options_hash
71
+ )
66
72
 
67
73
  result = begin
68
74
  raise Exceptions::CancelException, 'Test cancelled by user' if test_run_is_cancelling
@@ -118,7 +124,7 @@ module Inferno
118
124
  end
119
125
 
120
126
  results = []
121
- group.children.each do |child|
127
+ group.children(test_session.suite_options).each do |child|
122
128
  result = run(child, scratch)
123
129
  results << result
124
130
  break if results.last.waiting?
@@ -137,7 +143,7 @@ module Inferno
137
143
  def update_parent_result(parent)
138
144
  return if parent.nil?
139
145
 
140
- children = parent.children
146
+ children = parent.children(test_session.suite_options)
141
147
  child_results = results_repo.current_results_for_test_session_and_runnables(test_session.id, children)
142
148
  required_children = children.select(&:required?)
143
149
  required_results = child_results.select(&:required?)
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.3.2'.freeze
3
+ VERSION = '0.3.5'.freeze
4
4
  end
@@ -16,6 +16,12 @@ class CreateStrategy
16
16
 
17
17
  result
18
18
  end
19
+
20
+ # breaking change in factory_bot 6.2.1
21
+ # https://github.com/thoughtbot/factory_bot/issues/1536
22
+ def to_sym
23
+ :repo_create
24
+ end
19
25
  end
20
26
 
21
27
  FactoryBot.register_strategy(:repo_create, CreateStrategy)
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inferno_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  - Robert Scanlon
9
9
  - Chase Zhou
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-05-09 00:00:00.000000000 Z
13
+ date: 2022-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -68,6 +68,20 @@ dependencies:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
70
  version: 0.12.0
71
+ - !ruby/object:Gem::Dependency
72
+ name: dry-container
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '='
76
+ - !ruby/object:Gem::Version
77
+ version: 0.8.0
78
+ type: :runtime
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '='
83
+ - !ruby/object:Gem::Version
84
+ version: 0.8.0
71
85
  - !ruby/object:Gem::Dependency
72
86
  name: dry-system
73
87
  requirement: !ruby/object:Gem::Requirement
@@ -492,6 +506,7 @@ files:
492
506
  - lib/inferno/apps/web/serializers/result.rb
493
507
  - lib/inferno/apps/web/serializers/serializer.rb
494
508
  - lib/inferno/apps/web/serializers/session_data.rb
509
+ - lib/inferno/apps/web/serializers/suite_option.rb
495
510
  - lib/inferno/apps/web/serializers/test.rb
496
511
  - lib/inferno/apps/web/serializers/test_group.rb
497
512
  - lib/inferno/apps/web/serializers/test_run.rb
@@ -511,6 +526,7 @@ files:
511
526
  - lib/inferno/db/migrations/004_add_request_results_table.rb
512
527
  - lib/inferno/db/migrations/005_add_updated_at_index_to_results.rb
513
528
  - lib/inferno/db/migrations/006_remove_unused_tables.rb
529
+ - lib/inferno/db/migrations/007_add_suite_options.rb
514
530
  - lib/inferno/db/schema.rb
515
531
  - lib/inferno/dsl.rb
516
532
  - lib/inferno/dsl/assertions.rb
@@ -526,6 +542,8 @@ files:
526
542
  - lib/inferno/dsl/results.rb
527
543
  - lib/inferno/dsl/resume_test_route.rb
528
544
  - lib/inferno/dsl/runnable.rb
545
+ - lib/inferno/dsl/suite_option.rb
546
+ - lib/inferno/dsl/tcp_exception_handler.rb
529
547
  - lib/inferno/entities.rb
530
548
  - lib/inferno/entities/attributes.rb
531
549
  - lib/inferno/entities/entity.rb
@@ -552,11 +570,9 @@ files:
552
570
  - lib/inferno/public/217.bundle.js
553
571
  - lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
554
572
  - lib/inferno/public/assets.json
555
- - lib/inferno/public/bg-header-1920x170.png
556
573
  - lib/inferno/public/bundle.js
557
574
  - lib/inferno/public/bundle.js.LICENSE.txt
558
575
  - lib/inferno/public/favicon.ico
559
- - lib/inferno/public/healthit.gov.logo.png
560
576
  - lib/inferno/public/logo192.png
561
577
  - lib/inferno/repositories.rb
562
578
  - lib/inferno/repositories/headers.rb
@@ -598,7 +614,7 @@ metadata:
598
614
  homepage_uri: https://github.com/inferno-framework/inferno-core
599
615
  source_code_uri: https://github.com/inferno-framework/inferno-core
600
616
  changelog_uri: https://github.com/inferno-framework/inferno-core/blob/main/CHANGELOG.md
601
- post_install_message:
617
+ post_install_message:
602
618
  rdoc_options: []
603
619
  require_paths:
604
620
  - lib
@@ -615,7 +631,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
615
631
  version: '0'
616
632
  requirements: []
617
633
  rubygems_version: 3.1.6
618
- signing_key:
634
+ signing_key:
619
635
  specification_version: 4
620
636
  summary: Inferno Core is an open source tool for testing data exchanges enabled by
621
637
  the FHIR standand