Skip to content

Commit 513af1f

Browse files
authored
FI-3678: Update runnable context to support use when describing non-runnables (#607)
* update runnable context to support use when describing non-runnables * fix input names * fix checking for #parent
1 parent 9e06950 commit 513af1f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spec/runnable_context.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@
55
let(:test_session) { repo_create(:test_session, test_suite_id: suite_id) }
66

77
before do
8-
allow(described_class).to receive(:suite).and_return(suite) if described_class.parent.nil?
8+
if described_class.respond_to?(:parent) && described_class.parent.nil?
9+
allow(described_class).to receive(:suite).and_return(suite)
10+
end
911
rescue NameError
1012
raise StandardError, "No suite id defined. Add `let(:suite_id) { 'your_suite_id' }` to the spec"
1113
end
1214

1315
def run(runnable, inputs = {})
1416
test_run_params = { test_session_id: test_session.id }.merge(runnable.reference_hash)
1517
test_run = Inferno::Repositories::TestRuns.new.create(test_run_params)
16-
inputs.each do |name, value|
18+
inputs.each do |original_name, value|
19+
name = runnable.config.input_name(original_name).presence || original_name
1720
session_data_repo.save(
1821
test_session_id: test_session.id,
1922
name:,
2023
value:,
21-
type: runnable.config.input_type(name)
24+
type: runnable.available_inputs[name.to_sym]&.type
2225
)
2326
end
2427

0 commit comments

Comments
 (0)