Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub test execution and output updates #79

Merged
merged 33 commits into from
Dec 29, 2022
Merged

Sub test execution and output updates #79

merged 33 commits into from
Dec 29, 2022

Conversation

karlnaden
Copy link
Contributor

@karlnaden karlnaden commented Dec 27, 2022

Summary

  • Add extensions to support subtest execution from within a TestScript
  • Improve the feedback mechanism for profile validation errors specifically, but also executions in general

New behavior

Output stuff

  • validate profile id success and failure messages include validation errors and warnings
  • skip logic fixed to match TestScript spec
  • TestReports exported to run-specific folder
  • test inputs included in outputs

Subtest stuff

  • reports no longer indexed by script name, just a list, to allow the same script to be executed multiple times
  • moved all dynamic details outside of the TestScript (e.g., dynamic variables) to support easier copying of runnables
  • added extension indicating subtest execution

Code changes

Generally minor tweaks to support cloning of runnables such that they can be executed within the context of another test

Testing guidance

  • output updates: bundle exec bin/testscript_engine execute --config config-multipleMCODE.yml
    expected results: not all will succeed
  • subtest: bundle exec bin/testscript_engine execute --config config-mCODESubtest.yml
    expected results (failures expected with internal FHIR path, should succeed with external FHIRPath support)
   SUMMARY OF EXECUTION RESULTS: 
      Execution of [UsMCODECancerPatientReadProfile] with inputs 'targetResourceIdCancerPatient=cancer-patient-jenny-m' failed with score: [75.0].
      Execution of [UsMcodeProfileSearchFromPatientSubTest] with inputs 'cancerPatientId=cancer-patient-jenny-m' failed with score: [60.0].

  • subtest each: bundle exec ruby bin/testscript_engine execute --config spec/examples/subtest/config-subtest.yml
    expected results (these failures are expected):
   SUMMARY OF EXECUTION RESULTS: 
      Execution of [SubtestToExecuteExample] with inputs 'checkValue=Chalmers' passed.
      Execution of [SubtestToExecuteExample] with inputs 'checkValue=Chalmers' passed.
      Execution of [SubtestToExecuteExample] with inputs 'checkValue=Chalmers' passed.

      Execution of [SubtestToExecuteExample] with inputs 'checkValue=Windsor' failed with score: [0.0].
      Execution of [SubtestToExecuteExample] with inputs 'checkValue=Windsor' failed with score: [0.0].
      Execution of [SubtestExecutionExample] with inputs 'directExecuteInput=Chalmers' failed with score: [67.0].

karlnaden and others added 16 commits December 27, 2022 14:18
* add fhirpath_service

* Initial commit

* Add testscript for internal fhirpath testing

* Add external validator test case

* Add mCODE testscripts

* Minor change

* Handle only equals operator

* Handle only String value based on the FHIR spec

* check for multiple values in assertion logic

* Update README.md

Co-authored-by: Jack Fraser <[email protected]>
Co-authored-by: Jaehoon Lee <[email protected]>
Co-authored-by: Jaehoon Lee <[email protected]>
Co-authored-by: Karl Naden <[email protected]>
move display to write_reports
add testscript.name to testreport reference
remove TestScript variable extension
add subtest config file
@karlnaden
Copy link
Contributor Author

bundle exec bin/testscript_engine execute --config config-mCODESubtest.yml should now execute subtests. Had to adjust to get to work with HAPI FHIRPath. Should result in

   SUMMARY OF EXECUTION RESULTS: 
      Execution of [UsMCODEComorbiditiesReadProfile] with inputs 'targetResourceIdComorbidities=cancer-related-comorbidities-jenny-m' passed.

      Execution of [UsMCODECancerPatientReadProfile] with inputs 'targetResourceIdCancerPatient=cancer-patient-jenny-m' failed with score: [75.0].
      Execution of [UsMcodeProfileSearchFromPatientSubTest] with inputs 'cancerPatientId=cancer-patient-jenny-m' failed with score: [71.0].

@@ -103,7 +107,7 @@ def make_runnables
end

def run(*args)
print_out messages(:begin_runnable_execution, script.id)
print_out messages(:begin_runnable_execution, script.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that use of name instead of is good idea.

self.get_fixture_block = block
self.options = options
self.client_util = FHIR::Client.new('')
self.available_profiles = available_profiles
self.engine = engine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think by having engine object part of runnable initialization has pros and cons and we may make it a bit clearer or simpler as to what information the engine handles vs the runnable handles. But that is out of the scope in the last hour of this project. For now I'm okay to this change if you'd prefer that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed - this was a quick solution that could be handled better in another way. Main need is to pass the report back to the engine, which could be done in another way.

@@ -77,16 +79,16 @@ def preprocess

def setup
return info(:no_setup) unless script.setup
handle_actions(script.setup.action, true)
handle_actions(script.setup.action, :setup)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good way to detail the configuration of fail on error in different phases of testing

Copy link
Contributor

@jhlee-mitre jhlee-mitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No concerns and approved

@karlnaden karlnaden merged commit becf09f into main Dec 29, 2022
@karlnaden karlnaden deleted the SubTestExecution branch December 29, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants