@@ -19,41 +19,61 @@ pip install git+https://github.com/antmicro/protoplaster.git
1919## Usage
2020
2121```
22- usage: protoplaster [-h] [-t TEST_FILE] [-g GROUP] [--list-groups] [-o OUTPUT] [--csv CSV] [--csv-columns CSV_COLUMNS] [--generate-docs] [-c CUSTOM_TESTS]
22+ usage: protoplaster [-h] [-d TEST_DIR] [-r REPORTS_DIR] [-a ARTIFACTS_DIR]
23+ [-t TEST_FILE] [-g GROUP] [-s TEST_SUITE] [--list-groups]
24+ [--list-test-suites] [--list-tests] [-o OUTPUT]
25+ [--csv CSV] [--csv-columns CSV_COLUMNS] [--generate-docs]
26+ [-c CUSTOM_TESTS] [--report-output REPORT_OUTPUT]
27+ [--system-report-config SYSTEM_REPORT_CONFIG] [--sudo]
28+ [--server]
2329
2430options:
2531 -h, --help show this help message and exit
26- -t TEST_FILE, --test-file TEST_FILE
27- Path to the test yaml description
28- -g GROUP, --group GROUP
29- Group to execute
30- --list-groups List possible groups to execute
31- -o OUTPUT, --output OUTPUT
32- A junit-xml style report of the tests results
32+ -d, --test-dir TEST_DIR
33+ Path to the test directory
34+ -r, --reports-dir REPORTS_DIR
35+ Path to the reports directory
36+ -a, --artifacts-dir ARTIFACTS_DIR
37+ Path to the test artifacts directory
38+ -t, --test-file TEST_FILE
39+ Path to the yaml test description in the test
40+ directory
41+ -g, --group GROUP Group to execute [deprecated]
42+ -s, --test-suite TEST_SUITE
43+ Test suite to execute
44+ --list-groups List possible groups to execute [deprecated]
45+ --list-test-suites List possible test suites to execute
46+ --list-tests List all defined tests
47+ -o, --output OUTPUT A junit-xml style report of the tests results
3348 --csv CSV Generate a CSV report of the tests results
3449 --csv-columns CSV_COLUMNS
35- Comma-separated list of columns to be included in generated CSV
50+ Comma-separated list of columns to be included in
51+ generated CSV
3652 --generate-docs Generate documentation
37- -c CUSTOM_TESTS , --custom-tests CUSTOM_TESTS
53+ -c, --custom-tests CUSTOM_TESTS
3854 Path to the custom tests sources
3955 --report-output REPORT_OUTPUT
4056 Proplaster report archive
4157 --system-report-config SYSTEM_REPORT_CONFIG
4258 Path to the system report yaml config file
4359 --sudo Run as sudo
60+ --server Run in server mode
4461```
4562
4663Protoplaster expects a yaml file describing tests as an input. The yaml file should have a structure specified as follows:
4764
4865<!-- name="example" -->
4966``` yaml
67+ includes :
68+ - addition.yml # Import additional definitions from external file
69+
5070tests :
51- base : # A group specifier
52- i2c : # A module specifier
53- - bus : 0 # An interface specifier
54- devices : # Multiple instances of devices can be defined in one module
71+ base : # Test name
72+ i2c : # A module specifier
73+ - bus : 0 # An interface specifier
74+ devices : # Multiple instances of devices can be defined in one module
5575 - name : " Sensor name"
56- address : 0x3c # The given device parameters determine which tests will be run for the module
76+ address : 0x3c # The given device parameters determine which tests will be run for the module
5777 - bus : 0
5878 devices :
5979 - name : " I2C-bus multiplexer"
@@ -70,14 +90,31 @@ tests:
7090 gpio :
7191 - number : 20
7292 value : 1
93+
94+ metadata : # Additional metadata to be generated on tested device
95+ uname : # Metadata name
96+ run : uname -r # Command to run
97+
98+ test-suites :
99+ basic : # Test suite name
100+ tests : # Tests to include
101+ - base
102+ full :
103+ tests :
104+ - basic # Test suites can include other test suites
105+ - additional
106+ metadata : # Metadata to generate for this test
107+ - uname
73108` ` `
74109
75- ### Groups
76- In the YAML file, you can define different groups of tests to run them for different use cases.
77- In the YAML file example, there are two groups defined: base and additional.
78- Protoplaster, when run without a defined group, will execute every test in each group.
79- When the group is specified with the parameter ` -g` or `--group`, only the tests in the specified group are going to be run.
80- You can also list existing groups in the YAML file, simply run `protoplaster --list-groups test.yaml`.
110+ ### Test suites
111+ In the YAML file, you can define different groups of tests in the ` test-suites` section
112+ to run them for different use cases.
113+ In the YAML file example, there are two suites defined : ` basic` and `full`.
114+ Protoplaster, when run without a defined test suite, will execute all tests defined in given file.
115+ When the test suite is specified with the parameter `-s` or `--test-suite`,
116+ only the tests in the specified suite are going to be run.
117+ You can also list existing groups in the YAML file, simply run `protoplaster --list-test-suites test.yaml`.
81118
82119# # Base modules parameters
83120Each base module requires parameters for test initialization.
@@ -135,6 +172,7 @@ An example of an extended module test:
135172` ` ` python
136173from protoplaster.conf.module import ModuleName
137174
175+
138176@ModuleName("additional_camera")
139177class TestAdditionalCamera:
140178 """
0 commit comments