Skip to content

Commit d9e85c8

Browse files
committed
feat(hardware): tests subcommand
Retrieve tests for a compatible list. It supports the same parameters as results tests. Signed-off-by: Camila Alvarez <cam.alvarez.i@gmail.com>
1 parent ac1a36c commit d9e85c8

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

docs/results.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Example:
4848
kci-dev results boots --giturl 'https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git' --branch master --latest
4949
```
5050

51-
### tests
51+
### <a id="result-tests"></a>tests
5252

5353
List test results.
5454

@@ -124,6 +124,17 @@ Example:
124124
kci-dev results hardware builds --name mediatek,mt8195 --origin maestro --json
125125
```
126126

127+
#### tests
128+
129+
List test results for a hardware with `name` list for the last seven days.
130+
It supports the same options as [results tests](#result-tests).
131+
132+
Example:
133+
134+
```sh
135+
kci-dev results hardware tests --name mediatek,mt8195 --origin maestro --json
136+
```
137+
127138
## Common parameters
128139

129140
### --origin

kcidev/libs/dashboard.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,10 @@ def dashboard_fetch_hardware_builds(name, origin, use_json):
172172
return dashboard_api_post(
173173
f"hardware/{urllib.parse.quote_plus(name)}/builds", {}, use_json, body
174174
)
175+
176+
177+
def dashboard_fetch_hardware_tests(name, origin, use_json):
178+
body = _create_hardware_request_body(origin)
179+
return dashboard_api_post(
180+
f"hardware/{urllib.parse.quote_plus(name)}/tests", {}, use_json, body
181+
)

kcidev/subcommands/results/hardware.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
dashboard_fetch_hardware_builds,
88
dashboard_fetch_hardware_list,
99
dashboard_fetch_hardware_summary,
10+
dashboard_fetch_hardware_tests,
1011
)
1112
from kcidev.subcommands.results.options import (
1213
builds_and_tests_options,
@@ -68,3 +69,12 @@ def boots(name, origin, use_json, download_logs, status, filter, count):
6869
def builds(name, origin, use_json, download_logs, status, filter, count):
6970
data = dashboard_fetch_hardware_builds(name, origin, use_json)
7071
cmd_builds(data, name, download_logs, status, count, use_json)
72+
73+
74+
@hardware.command()
75+
@hardware_common_opt
76+
@results_display_options
77+
@builds_and_tests_options
78+
def tests(name, origin, use_json, download_logs, status, filter, count):
79+
data = dashboard_fetch_hardware_tests(name, origin, use_json)
80+
cmd_tests(data["tests"], name, download_logs, status, filter, count, use_json)

0 commit comments

Comments
 (0)