Script that ingests ``*.robot` files and either outputs the json to the screen or uploads the data to the JAMA API
- Create an API Token, Click Username in GUI -> Set API Credentils -> Create API Credentials (or use an existing credential)
- set the following ENVS:
* JAMA_CLIENT_ID (created above)
* JAMA_CLIENT_SECRET (created above)
* JAMA_PROJECT_ID (derived from URL when viewing a project in the gui)
- https://guardanthealth.jamacloud.com/perspective.req#/projects/45/dashboard * JAMA_PARENT_ID (id of the folder to upload all tests to, also derived from url)
- navigating in the GUI to Subsystems -> Software -> Verifications Test Cases -> insert-tests which give you the id
19187
https://guardanthealth.jamacloud.com/perspective.req#/containers/19187?projectId=45
- Pass a robot file to script to convert to json (enable --dryrun to only output json):
./normalize_robot.py --dryrun cnv_pipeline.robot
- Pass a directory to script to automatically convert all files ending in .robot to json
./normalize_robot.py --dryrun ./
- Run and upload to JAMA API:
./normalize_robot.py ./cnv_pipeline.robot
- Enable verbosity to display info logs:
./normalize_robot.py -v ./
- Enable verbosity to display debug logs:
./normalize_robot.py -vv ./
Tests of the same name will not be re-added to the insert-tests
folder, unless the test plan name differs in the robot text. The test plan name is extracted from the Defualt Tag:
line in the robot text under settings.
ex. output with verbosity enabled:
checking for new test cases...
2018-01-03T11:37:10 Test case already exists: TC_CNV_1: Verify CNV run successfully
2018-01-03T11:37:10 Test case already exists: TC_CNV_2: Verify CNV load to GHDB successfully
2018-01-03T11:37:10 Test case already exists: TC_CNV_3:Verify output files generated by CNV pipeline
2018-01-03T11:37:10 Test case already exists: TC_CNV_4:Verify content in ghcnv_gene table in GHDB from CNV pipeline result
2018-01-03T11:37:10 Test case already exists: TC_CNV_5: Verify content in ghcnv_probe table in GHDB from CNV pipeline result
2018-01-03T11:37:10 Test case already exists: TC_CNV_6: Verify content in ghcnv_qc table in GHDB from CNV pipeline result
2018-01-03T11:37:10 New Test Items IDs to Add to Test Plan: []
Tests in robot file will get updated if fields like prerequesites and summary change in the robot output but don't match in JAMA.
./normalize_robot.py test/panel.robot --update -vv
Tests that are removed from the robot file can be deleted from JAMA:
./normalize_robot.py test/panel.robot -vv --delete
This checks if the test exists in the test plan tied to the robot file, if the test exists in JAMA but not in the robot file it will delete the test. The test however can still be referenced in other test plans and will have to be removed manually. ( this can be fixed in the future but can be very dangerous as we would have to list all tests plans, traverse all tests, match by name and remove)
If you rename a test in the robot file it will be treated as a new test, as there is no way to know that it was a previously existing test, everything is matched by name. A new test will be created and the old test will look like it was an existing test that needs to be deleted using the --delete
flag
check xml_normalizer folder README.md
➜ pytest normalize_robot.py -vv
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 2.7.10, pytest-3.3.1, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python
cachedir: .cache
rootdir: /Users/feelobot/src/guardant, inifile:
collected 7 items
normalize_robot.py::test_titles_first_matches PASSED [ 14%]
normalize_robot.py::test_tittles_all_found PASSED [ 28%]
normalize_robot.py::test_documentation_summary PASSED [ 42%]
normalize_robot.py::test_documentation_summary_all_found PASSED [ 57%]
normalize_robot.py::test_documentation_summary_all_prereqs_found PASSED [ 71%]
normalize_robot.py::test_documentation_all_steps_found PASSED [ 85%]
normalize_robot.py::test_generateJSON PASSED [100%]
========================================================================================= 7 passed in 0.29 seconds =========================================================================================
## Workflow