This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inferno's JSON API
Overview
A RESTful JSON API was created for Inferno to allow for automated testing and an option for a new front end.
Sections
FHIR API
The first prototype API created was FHIR conformant, and its conformance was tested using Crucible. By conforming to the FHIR standard, the API concepts differed from Inferno’s usual user interface because of the different mappings. Inferno’s sequences were chosen to be represented by the FHIR resource TestScript, and Inferno’s test results were represented by the FHIR resource TestReport. This caused the FHIR API to not work well with Inferno, so this design was left and a new one was created.
Files:
fhir.rb
: Request endpointsfhir_definitions.rb
: Builds JSONs for APIfhir_api_test
: Unit testsDocumentation:
The FHIR API can probably be discarded and then these files will no longer be needed.
RESTful API
The API’s mappings were designed be as close to Inferno concepts as possible in order to allow Inferno to be fully functional as an API. To my knowledge, except for the restrictions mentioned, the API has all of Inferno's capabilities.
Files:
api.rb
: Request endpointsapi_helper.rb
: Helper functions for requests that get information from Infernoapi_json.rb
: Builds JSONs for APIapi_test.rb
: Unit testsRestrictions
Next Steps
Documentation
There is documentation written for the RESTful API in the
API Documentation
folder. The code is also commented with some more specific details than the topics covered in this document.Files:
api.yaml
: Documentation in the OpenAPI formatAPI_README.md
: Explains the current state of the APITesting
Testing with Postman
Inferno API.postman_collection.json.zip
Inferno Unit Tests
api_test.rb
Sample Front End
api.js
: JavaScript for APIlanding.erb
: HTML for page using APIcan-ndjson-stream.js
: Module used for streaming inapi.js
Front End Preview:
Other Notes
Other files that were edited:
.rubocop_todo.yml
: Updated to pass rubocop tests for length issuesendpoint.rb
: Added references to the FHIR and regular API filessequence_base.rb
: Saves the results during the start function to make sure that all the counts are updated and saved in the database (ex. count of tests passed) after a sequence is run.codeclimate.yml
: Updated to ignore imported JS files, but not the ones we wroteThoughts from Team Meeting (8/8/19)