inferno_core 0.0.6 → 0.0.8

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/bin/inferno +7 -0
  3. data/lib/inferno/apps/cli/console.rb +12 -0
  4. data/lib/inferno/apps/cli/main.rb +18 -0
  5. data/lib/inferno/apps/cli/migration.rb +14 -0
  6. data/lib/inferno/apps/cli.rb +8 -0
  7. data/lib/inferno/apps/web/index.html.erb +1 -0
  8. data/lib/inferno/config/application.rb +3 -0
  9. data/lib/inferno/config/boot/db.rb +1 -9
  10. data/lib/inferno/config/boot/logging.rb +2 -0
  11. data/lib/inferno/db/migrations/001_create_initial_structure.rb +1 -1
  12. data/lib/inferno/db/schema.rb +1 -1
  13. data/lib/inferno/dsl/assertions.rb +66 -1
  14. data/lib/inferno/dsl/configurable.rb +1 -1
  15. data/lib/inferno/dsl/fhir_client.rb +22 -18
  16. data/lib/inferno/dsl/fhir_client_builder.rb +3 -3
  17. data/lib/inferno/dsl/fhir_validation.rb +105 -1
  18. data/lib/inferno/dsl/http_client.rb +4 -4
  19. data/lib/inferno/dsl/http_client_builder.rb +3 -3
  20. data/lib/inferno/dsl/request_storage.rb +8 -8
  21. data/lib/inferno/dsl/results.rb +1 -1
  22. data/lib/inferno/dsl/resume_test_route.rb +9 -9
  23. data/lib/inferno/dsl/runnable.rb +36 -18
  24. data/lib/inferno/entities/header.rb +14 -7
  25. data/lib/inferno/entities/message.rb +16 -8
  26. data/lib/inferno/entities/request.rb +32 -19
  27. data/lib/inferno/entities/result.rb +36 -29
  28. data/lib/inferno/entities/session_data.rb +12 -6
  29. data/lib/inferno/entities/test.rb +13 -0
  30. data/lib/inferno/entities/test_run.rb +29 -6
  31. data/lib/inferno/entities/test_session.rb +16 -10
  32. data/lib/inferno/public/217.bundle.js +1 -1
  33. data/lib/inferno/public/bundle.js +154 -1
  34. data/lib/inferno/public/bundle.js.LICENSE.txt +15 -0
  35. data/lib/inferno/repositories/in_memory_repository.rb +1 -1
  36. data/lib/inferno/repositories/results.rb +1 -1
  37. data/lib/inferno/spec_support.rb +1 -1
  38. data/lib/inferno/test_runner.rb +1 -1
  39. data/lib/inferno/utils/markdown_formatter.rb +1 -1
  40. data/lib/inferno/utils/middleware/request_logger.rb +9 -3
  41. data/lib/inferno/utils/migration.rb +17 -0
  42. data/lib/inferno/version.rb +1 -1
  43. data/lib/inferno.rb +0 -4
  44. metadata +41 -8
  45. data/bin/inferno-console +0 -8
@@ -19,6 +19,12 @@ object-assign
19
19
  * @license MIT
20
20
  */
21
21
 
22
+ /** @license MUI v5.2.0
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */
27
+
22
28
  /** @license React v0.20.2
23
29
  * scheduler.production.min.js
24
30
  *
@@ -55,6 +61,15 @@ object-assign
55
61
  * LICENSE file in the root directory of this source tree.
56
62
  */
57
63
 
64
+ /** @license React v17.0.2
65
+ * react-jsx-runtime.production.min.js
66
+ *
67
+ * Copyright (c) Facebook, Inc. and its affiliates.
68
+ *
69
+ * This source code is licensed under the MIT license found in the
70
+ * LICENSE file in the root directory of this source tree.
71
+ */
72
+
58
73
  /** @license React v17.0.2
59
74
  * react.production.min.js
60
75
  *
@@ -24,7 +24,7 @@ module Inferno
24
24
  @all ||= []
25
25
  end
26
26
 
27
- # @api private
27
+ # @private
28
28
  def all_by_id
29
29
  @all_by_id ||= {}
30
30
  @all_by_id.length == all.length ? @all_by_id : index_by_id
@@ -31,7 +31,7 @@ module Inferno
31
31
  end
32
32
 
33
33
  # Get the current result for a particular test/group
34
- # @api private
34
+ # @private
35
35
  # @example
36
36
  # repo.current_result_for_test_session(
37
37
  # test_session_id,
@@ -1,5 +1,5 @@
1
1
  module Inferno
2
- # @api private
2
+ # @private
3
3
  # This module provides constants so that unit tests in suite repositories can
4
4
  # load the factories defined in inferno.
5
5
  module SpecSupport
@@ -1,7 +1,7 @@
1
1
  require_relative './utils/markdown_formatter'
2
2
 
3
3
  module Inferno
4
- # @api private
4
+ # @private
5
5
  class TestRunner
6
6
  include Inferno::Utils::MarkdownFormatter
7
7
  attr_reader :test_session, :test_run, :resuming
@@ -1,6 +1,6 @@
1
1
  module Inferno
2
2
  module Utils
3
- # @api private
3
+ # @private
4
4
  module MarkdownFormatter
5
5
  def format_markdown(markdown) # rubocop:disable Metrics/CyclomaticComplexity
6
6
  lines = markdown.lines
@@ -1,6 +1,6 @@
1
1
  module Inferno
2
2
  module Utils
3
- # @api private
3
+ # @private
4
4
  module Middleware
5
5
  class RequestLogger
6
6
  attr_reader :app
@@ -9,6 +9,10 @@ module Inferno
9
9
  @app = app
10
10
  end
11
11
 
12
+ def verbose_logging?
13
+ @verbose_logging ||= ENV['VERBOSE_REQUEST_LOGGING']&.downcase == true
14
+ end
15
+
12
16
  def logger
13
17
  @logger ||= Application['logger']
14
18
  end
@@ -35,7 +39,9 @@ module Inferno
35
39
  logger.info("#{status} in #{elapsed.in_milliseconds} ms")
36
40
  return unless body.present?
37
41
 
38
- if body.length > 100
42
+ body = body.is_a?(Array) ? body.join : body
43
+
44
+ if body.length > 100 && !verbose_logging?
39
45
  logger.info("#{body[0..100]}...")
40
46
  else
41
47
  logger.info(body)
@@ -56,7 +62,7 @@ module Inferno
56
62
 
57
63
  return unless body.present?
58
64
 
59
- if body.length > 100
65
+ if body.length > 100 && !verbose_logging?
60
66
  logger.info("#{body[0..100]}...")
61
67
  else
62
68
  logger.info(body)
@@ -0,0 +1,17 @@
1
+ module Inferno
2
+ module Utils
3
+ class Migration
4
+ def run
5
+ db = Inferno::Application['db.connection']
6
+ migration_path = File.join(Inferno::Application.root, 'lib', 'inferno', 'db', 'migrations')
7
+ Sequel::Migrator.run(db, migration_path)
8
+
9
+ if ENV['APP_ENV'] == 'development' # rubocop:disable Style/GuardClause
10
+ schema_path = File.join(Inferno::Application.root, 'lib', 'inferno', 'db', 'schema.rb')
11
+ db.extension :schema_dumper
12
+ File.open(schema_path, 'w') { |f| f.print(db.dump_schema_migration) }
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Inferno
2
- VERSION = '0.0.6'.freeze
2
+ VERSION = '0.0.8'.freeze
3
3
  end
data/lib/inferno.rb CHANGED
@@ -1,7 +1,3 @@
1
- require 'active_support/all'
2
- require 'dotenv'
3
- require 'dry/system/container'
4
- require 'sequel'
5
1
  require_relative 'inferno/config/application'
6
2
  require_relative 'inferno/dsl'
7
3
  require_relative 'inferno/entities'
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.0.6
4
+ version: 0.0.8
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: 2021-10-19 00:00:00.000000000 Z
13
+ date: 2021-12-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -54,6 +54,20 @@ dependencies:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: '2.7'
57
+ - !ruby/object:Gem::Dependency
58
+ name: dry-configurable
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '='
62
+ - !ruby/object:Gem::Version
63
+ version: 0.12.0
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '='
69
+ - !ruby/object:Gem::Version
70
+ version: 0.12.0
57
71
  - !ruby/object:Gem::Dependency
58
72
  name: dry-system
59
73
  requirement: !ruby/object:Gem::Requirement
@@ -86,16 +100,16 @@ dependencies:
86
100
  name: fhir_client
87
101
  requirement: !ruby/object:Gem::Requirement
88
102
  requirements:
89
- - - "~>"
103
+ - - ">="
90
104
  - !ruby/object:Gem::Version
91
- version: '4.0'
105
+ version: 5.0.3
92
106
  type: :runtime
93
107
  prerelease: false
94
108
  version_requirements: !ruby/object:Gem::Requirement
95
109
  requirements:
96
- - - "~>"
110
+ - - ">="
97
111
  - !ruby/object:Gem::Version
98
- version: '4.0'
112
+ version: 5.0.3
99
113
  - !ruby/object:Gem::Dependency
100
114
  name: fhir_models
101
115
  requirement: !ruby/object:Gem::Requirement
@@ -250,6 +264,20 @@ dependencies:
250
264
  - - "~>"
251
265
  - !ruby/object:Gem::Version
252
266
  version: '1.4'
267
+ - !ruby/object:Gem::Dependency
268
+ name: thor
269
+ requirement: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - "~>"
272
+ - !ruby/object:Gem::Version
273
+ version: 1.1.0
274
+ type: :runtime
275
+ prerelease: false
276
+ version_requirements: !ruby/object:Gem::Requirement
277
+ requirements:
278
+ - - "~>"
279
+ - !ruby/object:Gem::Version
280
+ version: 1.1.0
253
281
  - !ruby/object:Gem::Dependency
254
282
  name: codecov
255
283
  requirement: !ruby/object:Gem::Requirement
@@ -423,13 +451,17 @@ description: Inferno Core is an open source tool for testing data exchanges enab
423
451
  email:
424
452
  - inferno@groups.mitre.org
425
453
  executables:
426
- - inferno-console
454
+ - inferno
427
455
  extensions: []
428
456
  extra_rdoc_files: []
429
457
  files:
430
458
  - LICENSE
431
- - bin/inferno-console
459
+ - bin/inferno
432
460
  - lib/inferno.rb
461
+ - lib/inferno/apps/cli.rb
462
+ - lib/inferno/apps/cli/console.rb
463
+ - lib/inferno/apps/cli/main.rb
464
+ - lib/inferno/apps/cli/migration.rb
433
465
  - lib/inferno/apps/web/application.rb
434
466
  - lib/inferno/apps/web/controllers/controller.rb
435
467
  - lib/inferno/apps/web/controllers/requests/show.rb
@@ -526,6 +558,7 @@ files:
526
558
  - lib/inferno/test_runner.rb
527
559
  - lib/inferno/utils/markdown_formatter.rb
528
560
  - lib/inferno/utils/middleware/request_logger.rb
561
+ - lib/inferno/utils/migration.rb
529
562
  - lib/inferno/version.rb
530
563
  - spec/factories/header.rb
531
564
  - spec/factories/message.rb
data/bin/inferno-console DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'pry'
4
- require_relative '../lib/inferno'
5
-
6
- Inferno::Application.finalize!
7
-
8
- Pry.start