|
| 1 | +## Overview |
| 2 | + |
| 3 | +In the Ocre testing framework, the Ocre execution is comprised of test groups, test suites, and test cases. |
| 4 | + |
| 5 | +Test groups represent a group of test suites which have the same environmental prerequisites, and require a |
| 6 | +common setup and teardown process, e.g. the Flash Validation test group requires that the DUT board has been |
| 7 | +flashed with the Ocre runtime. Test groups will block each other on failure, meaning that if a test group |
| 8 | +fails, all subsequent test groups will be skipped. |
| 9 | + |
| 10 | +Test suites act as a way to logically split up test cases. For instance, in a test group for container workloads, |
| 11 | +Test suite A might contain testcases for single container workloads, and test suite B might contain testcases for |
| 12 | +multi-container workloads. Test suites are non blocking on one another on failure. |
| 13 | + |
| 14 | +Test cases are the individual tests, and are literally a python or bash script (or any other language) which runs |
| 15 | +some arbitrary code according to the test plan, and then exits / returns an exit code of 0 on success and 1 on |
| 16 | +failure. |
| 17 | + |
| 18 | +## Adding Test Groups, Test Suites, and Test Cases. |
| 19 | + |
| 20 | +To add a test group, you must create a new directory under the /tests/ dir, named after the new test group. Then, |
| 21 | +add a config.json file in the directory according to the format given below. Finally, add a step to the |
| 22 | +/.github/workflows/tests.yml file which runs the beginTests.sh against your new test group. |
| 23 | + |
| 24 | +To add a new testcase, the only requirement is that the testcase script file be placed under a testgroup dir, and |
| 25 | +that it exits with 0 on success and 1 on failure. |
| 26 | + |
| 27 | + |
| 28 | +```json |
| 29 | +{ |
| 30 | + "name": "Name of test group", |
| 31 | + "description": "Helpful description of the test group", |
| 32 | + "setup": [ |
| 33 | + { |
| 34 | + "name": "Name of script", |
| 35 | + "exec": "execution command" |
| 36 | + } |
| 37 | + ], |
| 38 | + "test_suites": [ |
| 39 | + { |
| 40 | + "name": "Name of test suite", |
| 41 | + "description": "Quick description", |
| 42 | + "test_cases": [ |
| 43 | + { |
| 44 | + "name": "Name of test case", |
| 45 | + "description": "Quick description", |
| 46 | + "exec": "execution command" |
| 47 | + } |
| 48 | + ] |
| 49 | + } |
| 50 | + ], |
| 51 | + "cleanup": [ |
| 52 | + { |
| 53 | + "name": "Name of script", |
| 54 | + "exec": "execution command" |
| 55 | + } |
| 56 | + ] |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +Execution commands are run with `bash -c "execution command"`. |
0 commit comments