inferno_core 1.5.0 → 1.6.0

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.
@@ -15,21 +15,26 @@ module Inferno
15
15
  messages = params.delete(:messages) || []
16
16
  requests = params.delete(:requests) || []
17
17
  super(params).tap do |result|
18
- result_model = self.class::Model.find(id: result.id)
19
18
  messages.each { |message| messages_repo.create(message.merge(result_id: result.id)) }
20
19
  requests.each do |request|
21
- request_id =
22
- if request.id.present?
23
- request.id
24
- else
25
- requests_repo.create(request.to_hash.merge(result_id: result.id)).id
26
- end
27
- request_model = requests_repo.class::Model.find(id: request_id)
28
- result_model.add_request(request_model)
20
+ request_id = request.id.presence || requests_repo.create(request.to_hash.merge(result_id: result.id)).id
21
+ add_request(result.id, request_id)
29
22
  end
30
23
  end
31
24
  end
32
25
 
26
+ # Associate an already persisted request with a result so that it is
27
+ # displayed with that result, e.g., an incoming request received while a
28
+ # test is waiting.
29
+ # @private
30
+ def add_request(result_id, request_id)
31
+ result_model = self.class::Model.find(id: result_id)
32
+ request_model = requests_repo.class::Model.find(id: request_id)
33
+ return if result_model.nil? || request_model.nil?
34
+
35
+ result_model.add_request(request_model)
36
+ end
37
+
33
38
  # Get the current result for a particular test/group
34
39
  # @private
35
40
  # @example
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '1.5.0'.freeze
3
+ VERSION = '1.6.0'.freeze
4
4
  end
@@ -60,8 +60,8 @@ RSpec.shared_examples 'platform_deployable_test_kit' do
60
60
  expect(test_kit.description).to include('<!-- break -->'), error_message
61
61
  end
62
62
 
63
- it 'has a maturity of "Low", "Medium", or "High"' do
64
- expect(['Low', 'Medium', 'High']).to include(test_kit.maturity) # rubocop:disable RSpec/ExpectActual
63
+ it 'has a maturity of "Low", "Medium", "High", or "Certification"' do
64
+ expect(['Low', 'Medium', 'High', 'Certification']).to include(test_kit.maturity) # rubocop:disable RSpec/ExpectActual
65
65
  end
66
66
 
67
67
  it 'uses the correct ruby version in its Dockerfile' do
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: 1.5.0
4
+ version: 1.6.0
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: 2026-10-21 00:00:00.000000000 Z
13
+ date: 2026-10-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport