inferno_core 1.4.2 → 1.4.3

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.
@@ -1,5 +1,3 @@
1
- /*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */
2
-
3
1
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
4
2
 
5
3
  /**
@@ -59,51 +59,66 @@ module Inferno
59
59
  end
60
60
 
61
61
  def run_test(test, scratch)
62
- inputs = load_inputs(test)
63
- input_json_string = inputs_as_json(test, inputs)
64
-
65
- test_instance =
66
- test.new(
67
- inputs:,
68
- test_session_id: test_session.id,
69
- scratch:,
70
- suite_options: test_session.suite_options_hash
71
- )
72
-
73
- result = evaluate_runnable_result(test, test_instance, inputs)
74
-
75
- outputs = save_outputs(test_instance)
76
- output_json_string = JSON.generate(outputs)
77
-
78
- result_params = {
79
- messages: test_instance.messages,
80
- requests: test_instance.requests,
81
- result:,
82
- result_message: test_instance.result_message,
83
- input_json: input_json_string,
84
- output_json: output_json_string
85
- }.merge(test.reference_hash)
86
-
87
- test_result =
88
- if result == 'wait'
89
- # The waiting status and the wait result must become visible to
90
- # readers atomically, so that pollers never see the run waiting
91
- # without the waiting test's result being present.
92
- Inferno::Application['db.connection'].transaction do
93
- test_runs_repo.mark_as_waiting(test_run.id, test_instance.identifier, test_instance.wait_timeout)
62
+ around_test(test) do
63
+ inputs = load_inputs(test)
64
+ input_json_string = inputs_as_json(test, inputs)
65
+
66
+ test_instance =
67
+ test.new(
68
+ inputs:,
69
+ test_session_id: test_session.id,
70
+ scratch:,
71
+ suite_options: test_session.suite_options_hash
72
+ )
73
+
74
+ result = evaluate_runnable_result(test, test_instance, inputs)
75
+
76
+ outputs = save_outputs(test_instance)
77
+ output_json_string = JSON.generate(outputs)
78
+
79
+ result_params = {
80
+ messages: test_instance.messages,
81
+ requests: test_instance.requests,
82
+ result:,
83
+ result_message: test_instance.result_message,
84
+ input_json: input_json_string,
85
+ output_json: output_json_string
86
+ }.merge(test.reference_hash)
87
+
88
+ test_result =
89
+ if result == 'wait'
90
+ # The waiting status and the wait result must become visible to
91
+ # readers atomically, so that pollers never see the run waiting
92
+ # without the waiting test's result being present.
93
+ Inferno::Application['db.connection'].transaction do
94
+ test_runs_repo.mark_as_waiting(test_run.id, test_instance.identifier, test_instance.wait_timeout)
95
+ persist_result(result_params)
96
+ end
97
+ else
94
98
  persist_result(result_params)
95
99
  end
96
- else
97
- persist_result(result_params)
98
- end
99
100
 
100
- # If running a single test, update its parents' results. If running a
101
- # group or suite, #run_group handles updating the parents.
102
- return test_result if test_run.test_id.blank?
101
+ # If running a single test, update its parents' results. If running a
102
+ # group or suite, #run_group handles updating the parents.
103
+ update_parent_result(test.parent) if test_run.test_id.present?
103
104
 
104
- update_parent_result(test.parent)
105
+ test_result
106
+ end
107
+ end
105
108
 
106
- test_result
109
+ # Wraps the execution of a single test. Prepend a module overriding this method
110
+ # to run instrumentation around each test, for example to emit a distinct trace,
111
+ # span, or timing metric per test instead of one that spans the whole run.
112
+ #
113
+ # An override must call `super` exactly once and return its value unchanged:
114
+ # it is the test's result, and parent results are rolled up from it. An
115
+ # override that does not call `super` silently skips the test.
116
+ #
117
+ # @param test [Class] the test being run (an Inferno::Entities::Test subclass)
118
+ # @yield executes the test and returns its result
119
+ # @return the value returned by the block
120
+ def around_test(_test)
121
+ yield
107
122
  end
108
123
 
109
124
  def check_inputs(test, _test_instance, inputs)
@@ -1,4 +1,4 @@
1
1
  module Inferno
2
2
  # Standard patterns for gem versions: https://guides.rubygems.org/patterns/
3
- VERSION = '1.4.2'.freeze
3
+ VERSION = '1.4.3'.freeze
4
4
  end
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.4.2
4
+ version: 1.4.3
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-07-27 00:00:00.000000000 Z
13
+ date: 2026-08-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -678,6 +678,7 @@ files:
678
678
  - lib/inferno/dsl/must_support_metadata_extractor.rb
679
679
  - lib/inferno/dsl/oauth_credentials.rb
680
680
  - lib/inferno/dsl/primitive_type.rb
681
+ - lib/inferno/dsl/profile_metadata.rb
681
682
  - lib/inferno/dsl/request_storage.rb
682
683
  - lib/inferno/dsl/requirement_set.rb
683
684
  - lib/inferno/dsl/result_collection.rb