inferno_core 0.3.4 → 0.3.7

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/web/controllers/test_runs/create.rb +8 -4
  3. data/lib/inferno/apps/web/controllers/test_sessions/create.rb +6 -3
  4. data/lib/inferno/apps/web/router.rb +5 -0
  5. data/lib/inferno/apps/web/serializers/input.rb +6 -2
  6. data/lib/inferno/apps/web/serializers/suite_option.rb +13 -0
  7. data/lib/inferno/apps/web/serializers/test.rb +4 -1
  8. data/lib/inferno/apps/web/serializers/test_group.rb +12 -3
  9. data/lib/inferno/apps/web/serializers/test_session.rb +5 -3
  10. data/lib/inferno/apps/web/serializers/test_suite.rb +10 -2
  11. data/lib/inferno/config/boot/presets.rb +1 -1
  12. data/lib/inferno/db/migrations/007_add_suite_options.rb +5 -0
  13. data/lib/inferno/db/schema.rb +1 -0
  14. data/lib/inferno/dsl/http_client.rb +14 -4
  15. data/lib/inferno/dsl/http_client_builder.rb +6 -1
  16. data/lib/inferno/dsl/input_output_handling.rb +55 -41
  17. data/lib/inferno/dsl/runnable.rb +12 -6
  18. data/lib/inferno/dsl/suite_option.rb +40 -0
  19. data/lib/inferno/entities/input.rb +2 -1
  20. data/lib/inferno/entities/test.rb +3 -1
  21. data/lib/inferno/entities/test_group.rb +4 -4
  22. data/lib/inferno/entities/test_session.rb +28 -0
  23. data/lib/inferno/entities/test_suite.rb +11 -4
  24. data/lib/inferno/public/72a5cd989e6aea904540824ec865a0f8.png +0 -0
  25. data/lib/inferno/public/bundle.js +15 -15
  26. data/lib/inferno/public/e09b16f5cb645eb05f90c8f38f3409fb.png +0 -0
  27. data/lib/inferno/repositories/presets.rb +10 -1
  28. data/lib/inferno/repositories/test_sessions.rb +24 -0
  29. data/lib/inferno/test_runner.rb +1 -1
  30. data/lib/inferno/version.rb +1 -1
  31. metadata +38 -7
  32. data/lib/inferno/public/bg-header-1920x170.png +0 -0
  33. data/lib/inferno/public/healthit.gov.logo.png +0 -0
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  require_relative 'in_memory_repository'
2
4
  require_relative '../entities/preset'
3
5
 
@@ -6,7 +8,14 @@ module Inferno
6
8
  # Repository that deals with persistence for the `Preset` entity.
7
9
  class Presets < InMemoryRepository
8
10
  def insert_from_file(path)
9
- preset_hash = JSON.parse(File.read(path))
11
+ case path
12
+ when /\.json$/
13
+ preset_hash = JSON.parse(File.read(path))
14
+ when /\.erb$/
15
+ templated = ERB.new(File.read(path)).result
16
+ preset_hash = JSON.parse(templated)
17
+ end
18
+
10
19
  preset_hash.deep_symbolize_keys!
11
20
  preset_hash[:id] ||= SecureRandom.uuid
12
21
  preset = Entities::Preset.new(preset_hash)
@@ -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
 
@@ -67,7 +67,7 @@ module Inferno
67
67
  inputs: inputs,
68
68
  test_session_id: test_session.id,
69
69
  scratch: scratch,
70
- suite_options: test_session.suite_options
70
+ suite_options: test_session.suite_options_hash
71
71
  )
72
72
 
73
73
  result = begin
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '0.3.4'.freeze
3
+ VERSION = '0.3.7'.freeze
4
4
  end
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.4
4
+ version: 0.3.7
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-06-30 00:00:00.000000000 Z
13
+ date: 2022-08-08 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
@@ -96,6 +110,20 @@ dependencies:
96
110
  - - "~>"
97
111
  - !ruby/object:Gem::Version
98
112
  version: '1.2'
113
+ - !ruby/object:Gem::Dependency
114
+ name: faraday_middleware
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '1.2'
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - "~>"
125
+ - !ruby/object:Gem::Version
126
+ version: '1.2'
99
127
  - !ruby/object:Gem::Dependency
100
128
  name: fhir_client
101
129
  requirement: !ruby/object:Gem::Requirement
@@ -492,6 +520,7 @@ files:
492
520
  - lib/inferno/apps/web/serializers/result.rb
493
521
  - lib/inferno/apps/web/serializers/serializer.rb
494
522
  - lib/inferno/apps/web/serializers/session_data.rb
523
+ - lib/inferno/apps/web/serializers/suite_option.rb
495
524
  - lib/inferno/apps/web/serializers/test.rb
496
525
  - lib/inferno/apps/web/serializers/test_group.rb
497
526
  - lib/inferno/apps/web/serializers/test_run.rb
@@ -511,6 +540,7 @@ files:
511
540
  - lib/inferno/db/migrations/004_add_request_results_table.rb
512
541
  - lib/inferno/db/migrations/005_add_updated_at_index_to_results.rb
513
542
  - lib/inferno/db/migrations/006_remove_unused_tables.rb
543
+ - lib/inferno/db/migrations/007_add_suite_options.rb
514
544
  - lib/inferno/db/schema.rb
515
545
  - lib/inferno/dsl.rb
516
546
  - lib/inferno/dsl/assertions.rb
@@ -526,6 +556,7 @@ files:
526
556
  - lib/inferno/dsl/results.rb
527
557
  - lib/inferno/dsl/resume_test_route.rb
528
558
  - lib/inferno/dsl/runnable.rb
559
+ - lib/inferno/dsl/suite_option.rb
529
560
  - lib/inferno/dsl/tcp_exception_handler.rb
530
561
  - lib/inferno/entities.rb
531
562
  - lib/inferno/entities/attributes.rb
@@ -551,13 +582,13 @@ files:
551
582
  - lib/inferno/jobs/resume_test_run.rb
552
583
  - lib/inferno/public/0e0b993fd6ff351f435ff1c2938daf2d.png
553
584
  - lib/inferno/public/217.bundle.js
585
+ - lib/inferno/public/72a5cd989e6aea904540824ec865a0f8.png
554
586
  - lib/inferno/public/a5cd39450ab0336db73c5e57228b649d.png
555
587
  - lib/inferno/public/assets.json
556
- - lib/inferno/public/bg-header-1920x170.png
557
588
  - lib/inferno/public/bundle.js
558
589
  - lib/inferno/public/bundle.js.LICENSE.txt
590
+ - lib/inferno/public/e09b16f5cb645eb05f90c8f38f3409fb.png
559
591
  - lib/inferno/public/favicon.ico
560
- - lib/inferno/public/healthit.gov.logo.png
561
592
  - lib/inferno/public/logo192.png
562
593
  - lib/inferno/repositories.rb
563
594
  - lib/inferno/repositories/headers.rb
@@ -599,7 +630,7 @@ metadata:
599
630
  homepage_uri: https://github.com/inferno-framework/inferno-core
600
631
  source_code_uri: https://github.com/inferno-framework/inferno-core
601
632
  changelog_uri: https://github.com/inferno-framework/inferno-core/blob/main/CHANGELOG.md
602
- post_install_message:
633
+ post_install_message:
603
634
  rdoc_options: []
604
635
  require_paths:
605
636
  - lib
@@ -616,7 +647,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
616
647
  version: '0'
617
648
  requirements: []
618
649
  rubygems_version: 3.1.6
619
- signing_key:
650
+ signing_key:
620
651
  specification_version: 4
621
652
  summary: Inferno Core is an open source tool for testing data exchanges enabled by
622
653
  the FHIR standand