Megatest Web App
-
See runs
-
Manage jobs
-
Debug
Example Abstract
The Megatest Web App aims to make as much of the power of the dashboard available to the web based user.
1. Common
This is an example endpoint. You will need to use your own cgi server to serve out your megatest runs.
Endpoint: http://kiatoa.com/cgi-bin/megatest
1.1. Error format response
All API errors are returned in the following format:
{ "error" : "Error message" }
1.2. Get List of Runs
URL: <base>/runs
Method: GET
Filter Params: target, testpatt, offset, limit
Megatest Cmd: megatest -start-dir <path to megatest area> -list-runs % -target % -dumpmode json -fields runs:runname,id+tests:state,status:id
Response:
[ { "run_id" : "1", "name" : "runname1", "target" : "target1", "tests" : [ "test": [ {"id": 1, "name":test1, "item_path": "", "shortdir": "/temp/foo/bar/target1/runname1/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS#"} {"id": 2, "name":test2, "item_path": "", "shortdir": "/temp/foo/bar/target1/runname1/test2", "final_logf": "megatest-rollup-test2.html", "status": "PASS"} {"id": 3, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target1/runname1/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ] }, { "run_id" : "2", "name" : "runname2", "target" : "target2", "tests" : [ "test: [ {"id": 4, "name":[blue]test1, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"} {"id": 5, "name":[blue]test2, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test2", "final_logf": "megatest-rollup-test2.html", "status": "FAIL"} {"id": 6, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ] } ]
1.3. Trigger a new Run
URL: <base>/runs
Method: POST
Megatest Cmd: megatest -runtests % -target <target> :runname <run_name> -run
Request Params:
{"target": "target_value", "runname" : "runname", "test_pattern": "optional test pattern"}
Response:
If Error
{ "error" : "Error message" }
If Success returns the results of the run
[ { "run_id" : "2", "name" : "runname2", "target" : "target2", "tests" : [ "test: [ {"id": 4, "name":[blue]test1, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"} {"id": 5, "name":[blue]test2, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test2", "final_logf": "megatest-rollup-test2.html", "status": "FAIL"} {"id": 6, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ] } ]
1.4. Get perticular Run
URL: <base>/runs/:id
Method: GET
Filter Params: testpatt
Megatest Cmd: megatest -start-dir <path to megatest area> -list-runs <runname> -target % -dumpmode json -fields runs:runname,id+tests:state,status:id
Response:
[ { "run_id" : "2", "name" : "runname2", "target" : "target2", "tests" : [ "test": [ {"id": 4, "name":[blue]test1, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"} {"id": 5, "name":[blue]test2, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test2", "final_logf": "megatest-rollup-test2.html", "status": "FAIL"} {"id": 6, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ] } ]
1.5. Re-execute a run
URL: <base>/runs/:id
Method: PUT/PATCH
Request Params: {"testpatt" : "pattern"}
Response:
[ { "run_id" : "2", "name" : "runname2", "target" : "target2", "tests" : [ "test": [ {"id": 4, "name":[blue]test1, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"} {"id": 5, "name":[blue]test2, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test2", "final_logf": "megatest-rollup-test2.html", "status": "FAIL"} {"id": 6, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ] } ]
1.6. Get List of tests within a run
URL: <base>/runs/:id/tests
Method: GET
Megatest Cmd: megatest -start-dir <path to megatest area> -list-runs <runname> -target % -dumpmode json -fields runs:runname,id+tests:state,status:id
Response:
[ "tests" : [ {"id": 4, "name":[blue]test1, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"} {"id": 5, "name":[blue]test2, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test2", "final_logf": "megatest-rollup-test2.html", "status": "FAIL"} {"id": 6, "name":test3, "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test3", "final_logf": "megatest-rollup-test3.html", "status": "PASS"} ] ]
1.7. Re-execute a test within a run
URL: <base>/runs/:id/tests/:id
Method: PUT/PATCH
Response:
{"id": "4", "name":"test1", "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"}
1.8. Get perticular test that belongs to a Runs
URL: <base>/runs/:id/tests/:id
Method: GET
Megatest Cmd: megatest -start-dir <path to megatest area> -list-runs <runname> -target % -testpattern <pattern> -dumpmode json -fields runs:runname,id+tests:state,status:id
Response:
{"id": "4", "name":"test1", "item_path": "", "shortdir": "/temp/foo/bar/target2/runname2/test1", "final_logf": "megatest-rollup-test1.html", "status": "PASS"}
2. Notes
Misc …
-
blah
-
baz