Skip to content

Commit

Permalink
Merge pull request #25 from aliceinwire/pytest_update
Browse files Browse the repository at this point in the history
docs: Divide index document
  • Loading branch information
aliceinwire authored Oct 4, 2024
2 parents 221630b + 645599e commit a2a7eaf
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 80 deletions.
83 changes: 3 additions & 80 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Where `default_instance` is the default instance to use, if not provided in the
In section `local`, `staging`, `production` you can provide the host and token for the available instances.
host is the URL of the KernelCI Pipeline API endpoint, and token is the API token to use for authentication.
If you are using KernelCI Pipeline instance, you can get the token from the project maintainers.
If it is a local instance, you can generate your token using kernelci-pipeline/tools/jwt_generator.py script.
If it is a local instance, you can generate your token using [kernelci-pipeline/tools/jwt_generator.py](https://github.com/kernelci/kernelci-pipeline/blob/main/tools/jwt_generator.py) script.

## Options

Expand All @@ -70,85 +70,8 @@ kci-dev --settings /path/to/.kci-dev.toml

### testretry

This command will retry the failed tests. In some cases tests may fail due to network issues, hardware problems,
nature of test (flaky), etc. This command will retry the failed tests, and create additional test jobs for the failed tests.
After observing the results, you can decide if test results were reliable, not, or maybe even test need improvement.

Example:
```sh
kci-dev testretry --nodeid <str: testnodeid>
```
- [testretry](testretry.md)

### results

This command will show the test result by node id.

Example:
```sh
kci-dev results --nodeid <str: testnodeid>
```

This command will show the results of tests by page nodes limit and page offset.

Example:
```sh
kci-dev results --nodes --limit <int: page nodes limit> --offset <int: page nodes offset>
```

Result sample:
```yaml
{'artifacts': None,
'created': '2024-10-04T00:49:15.691000',
'data': {'arch': 'x86_64',
'compiler': 'gcc-12',
'config_full': 'x86_64_defconfig+lab-setup+x86-board',
'defconfig': 'x86_64_defconfig',
'device': None,
'error_code': None,
'error_msg': None,
'job_context': None,
'job_id': None,
'kernel_revision': {'branch': 'staging-mainline',
'commit': '232edaea0fd9b4b7feb7b43508834bba7e820584',
'commit_message': 'staging-mainline-20241004.0',
'commit_tags': ['staging-mainline-20241004.0'],
'describe': 'staging-mainline-20241004.0',
'patchset': None,
'tip_of_branch': False,
'tree': 'kernelci',
'url': 'https://github.com/kernelci/linux.git',
'version': {'extra': '-rc1-115-g232edaea0fd9b',
'name': None,
'patchlevel': 12,
'sublevel': None,
'version': 6}},
'kernel_type': 'bzimage',
'platform': 'hp-14b-na0052xx-zork',
'regression': None,
'runtime': 'lava-collabora',
'test_revision': None,
'test_source': None},
'debug': None,
'group': 'kselftest-exec',
'holdoff': None,
'id': '66ff3b8c0abcc4c8343d1c71',
'jobfilter': None,
'kind': 'test',
'name': 'exec_execveat_Check_success_of_execveat_20_4096',
'owner': 'staging.kernelci.org',
'parent': '66ff3b8b0abcc4c8343d1b8a',
'path': ['checkout',
'kbuild-gcc-12-x86',
'kselftest-exec',
'kselftest-exec',
'exec_execveat_Check_success_of_execveat_20_4096'],
'result': 'pass',
'state': 'done',
'submitter': 'service:pipeline',
'timeout': '2024-10-04T06:49:15.691000',
'treeid': 'a44035dadc31327a5c30db4013b0e7e90acbb6a8fc45f94a6d91671e76cdfd8a',
'updated': '2024-10-04T00:49:15.691000',
'user_groups': []}
```
testnodeid is the node id of the test job, which you can get from the KernelCI dashboard. Usually it is hexadecimal string.
- [results](results.md)
73 changes: 73 additions & 0 deletions docs/results.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### results

This command will show the test result by node id.

Example:
```sh
kci-dev results --nodeid <str: testnodeid>
```

This command will show the results of tests by page nodes limit and page offset.

Example:
```sh
kci-dev results --nodes --limit <int: page nodes limit> --offset <int: page nodes offset>
```

Result sample:
```yaml
{'artifacts': None,
'created': '2024-10-04T00:49:15.691000',
'data': {'arch': 'x86_64',
'compiler': 'gcc-12',
'config_full': 'x86_64_defconfig+lab-setup+x86-board',
'defconfig': 'x86_64_defconfig',
'device': None,
'error_code': None,
'error_msg': None,
'job_context': None,
'job_id': None,
'kernel_revision': {'branch': 'staging-mainline',
'commit': '232edaea0fd9b4b7feb7b43508834bba7e820584',
'commit_message': 'staging-mainline-20241004.0',
'commit_tags': ['staging-mainline-20241004.0'],
'describe': 'staging-mainline-20241004.0',
'patchset': None,
'tip_of_branch': False,
'tree': 'kernelci',
'url': 'https://github.com/kernelci/linux.git',
'version': {'extra': '-rc1-115-g232edaea0fd9b',
'name': None,
'patchlevel': 12,
'sublevel': None,
'version': 6}},
'kernel_type': 'bzimage',
'platform': 'hp-14b-na0052xx-zork',
'regression': None,
'runtime': 'lava-collabora',
'test_revision': None,
'test_source': None},
'debug': None,
'group': 'kselftest-exec',
'holdoff': None,
'id': '66ff3b8c0abcc4c8343d1c71',
'jobfilter': None,
'kind': 'test',
'name': 'exec_execveat_Check_success_of_execveat_20_4096',
'owner': 'staging.kernelci.org',
'parent': '66ff3b8b0abcc4c8343d1b8a',
'path': ['checkout',
'kbuild-gcc-12-x86',
'kselftest-exec',
'kselftest-exec',
'exec_execveat_Check_success_of_execveat_20_4096'],
'result': 'pass',
'state': 'done',
'submitter': 'service:pipeline',
'timeout': '2024-10-04T06:49:15.691000',
'treeid': 'a44035dadc31327a5c30db4013b0e7e90acbb6a8fc45f94a6d91671e76cdfd8a',
'updated': '2024-10-04T00:49:15.691000',
'user_groups': []}
```
testnodeid is the node id of the test job, which you can get from the KernelCI dashboard. Usually it is hexadecimal string.
12 changes: 12 additions & 0 deletions docs/testretry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### testretry

This command will retry the failed tests. In some cases tests may fail due to network issues, hardware problems,
nature of test (flaky), etc. This command will retry the failed tests, and create additional test jobs for the failed tests.
After observing the results, you can decide if test results were reliable, not, or maybe even test need improvement.

Example:
```sh
kci-dev testretry --nodeid <str: testnodeid>
```

testnodeid is the node id of the test job, which you can get from the KernelCI dashboard. Usually it is hexadecimal string.

0 comments on commit a2a7eaf

Please sign in to comment.