fhir-crucible / testscript-engine

Ruby FHIR TestScript execution engine
Apache License 2.0
5 stars 2 forks source link

Remote fixture #72

Closed jhlee-mitre closed 1 year ago

jhlee-mitre commented 1 year ago

Summary

Handle remote fixture

New behavior

If a fixture is located remotely (typically in web servers), the engine makes a http request to retrieve the fixture. Once retrieved, it may be stored into the engine to be used by whenever TestScripts need it.

Code changes

Modified get_fixture_from_ref(reference) under TestScriptRunnable

Testing guidance

Sample testscript testscript_fixture_test.json is added

Run command bundle exec testscript_engine execute --testscript_name testscript-example-fixture-test --testscript_path /spec/examples/testscript_unittest

Expected message on console:

   STARTING TO MAKE RUNNABLE(S)
      Creating runnable: [testscript_dynamic_variable].
      Creating runnable: [testscript-example-fixture-test].
I, [2022-12-13T19:12:04.453484 #34248]  INFO -- : Initializing client with
I, [2022-12-13T19:12:04.454256 #34248]  INFO -- : Configuring the client to use no authentication.
I, [2022-12-13T19:12:04.455843 #34248]  INFO -- : GETTING: http://hl7.org/fhir/patient-example.json
      Added remote fixture: [http://hl7.org/fhir/patient-example.json].
   FINISHED MAKING RUNNABLE(S).