-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): Adding betelgeuse docstrings to test_client.py
- Loading branch information
Showing
2 changed files
with
227 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# Running Betelgeuse | ||
|
||
## Requirement command | ||
Requirement command generates an XML file that can be imported by the **Requirement XML Importer**. It reads the Python test suite source code and generated XML file with all the information necessary. | ||
|
||
**Requirements must be created in order to link test cases to them** | ||
|
||
```console | ||
$ betelgeuse requirement\ | ||
--assignee assignee\ | ||
--approver approver1\ | ||
sample_project/tests\ | ||
PROJECT\ | ||
betelgeuse-requirements.xml | ||
``` | ||
|
||
## Test-case command | ||
Command generates an XML file suited to be imported by the **Test Case XML Importer**. It reads the Python test suite source code and generated XML file with all the information necessary. | ||
|
||
The `test-case` requires: | ||
|
||
- The path to the Python test suite source code | ||
- The Polarion project ID | ||
- The output XML file path (will be overwritten if exists) | ||
|
||
It is also highly recommended to use `--response-property` as it will then be easier to monitor the importer messages | ||
|
||
Example: | ||
|
||
```console | ||
$ betelgeuse test-case \ | ||
--automation-script-format "https://github.com/SatelliteQE/betelgeuse/tree/master/{path}#L{line_number}" \ | ||
sample_project/tests \ | ||
PROJECT \ | ||
betelgeuse-test-cases.xml | ||
``` | ||
|
||
## Test-results command | ||
Command gives a summary of test cases/results in the given jUnit XML file | ||
|
||
```console | ||
$ betelgeuse test-results --path \ | ||
sample_project/results/sample-junit-result.xml | ||
|
||
Passed: 1 | ||
``` | ||
|
||
## Test-run command | ||
Command generates an XML file suited to be imported by the **Test Run XML Importer**. | ||
|
||
It takes: | ||
|
||
- A valid xUnit XML file | ||
- A Python test suite where test case IDs can be found | ||
|
||
And generates a resulting XML file with all the information necessary. | ||
|
||
It requires: | ||
|
||
- The path to the xUnit XML file | ||
- The path to the Python test suite source code | ||
- The Polarion user ID | ||
- The Polarion project ID | ||
- The output XML file path (will be overwritten if exists) | ||
|
||
It is also highly recommended to use `--response-property` as it will then be easier to monitor the importer messages | ||
|
||
Example: | ||
|
||
```console | ||
$ betelgeuse test-run \ | ||
--response-property property_key=property_value \ | ||
sample_project/results/sample-junit-result.xml \ | ||
sample_project/tests/ \ | ||
testuser \ | ||
PROJECT \ | ||
betelgeuse-test-run.xml | ||
``` | ||
|
||
NOTE: | ||
|
||
`--dry-run` can be used as following: | ||
|
||
```console | ||
$ betelgeuse test-run --dry-run --help | ||
Usage: betelgeuse test-run [OPTIONS] JUNIT_PATH SOURCE_CODE_PATH USER PROJECT | ||
OUTPUT_PATH | ||
|
||
Generate an XML suited to be importer by the test-run importer. | ||
|
||
This will read the jUnit XML at JUNIT_PATH and the source code at | ||
SOURCE_CODE_PATH in order to generate a XML file place at OUTPUT_PATH. The | ||
generated XML file will be ready to be imported by the XML Test Run | ||
Importer. | ||
|
||
The test run will be created on the project ID provided by PROJECT and will | ||
be assigned to the Polarion user ID provided by USER. | ||
|
||
Other test run options can be set by the various options this command | ||
accepts. Check their help for more information. | ||
``` | ||
|
||
Options: | ||
|
||
```console | ||
--collect-ignore-path PATH Ignore path during test collection. This | ||
option can be specified multiple times. | ||
--create-defects Specify to make the importer create defects | ||
for failed tests. | ||
--custom-fields TEXT Indicates to the importer which custom | ||
fields should be set. Expected format is | ||
either id=value or JSON format | ||
{"id":"value"}. This option can be specified | ||
multiple times. | ||
--dry-run Indicate to the importer to not make any | ||
change. | ||
--lookup-method [id|custom] Indicates to the importer which lookup | ||
method to use. "id" for work item id or | ||
"custom" for custom id (default). | ||
--lookup-method-custom-field-id TEXT | ||
Indicates to the importer which field ID to | ||
use when using the custom id lookup method. | ||
--no-include-skipped Specify to make the importer not import | ||
skipped tests. | ||
--project-span-ids TEXT A comma-separated list of project IDs used | ||
to set the project span field on the test | ||
run. | ||
--response-property TEXT When defined, the impoter will mark all | ||
responses with the selector.The format is " | ||
--response-property | ||
property_key=property_value". | ||
--status [finished|inprogress] Define which status the test run should be | ||
set: "Finished" (default)or "In Progress" | ||
--test-run-group-id TEXT Test Run GROUP ID to be created/updated. | ||
--test-run-id TEXT Test Run ID to be created/updated. | ||
--test-run-template-id TEXT Test Run template ID. | ||
--test-run-title TEXT Test Run title. | ||
--test-run-type-id TEXT Test Run type ID. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters