Skip to content

Commit

Permalink
refactor: support the new qase-python-commons package
Browse files Browse the repository at this point in the history
Support the new qase config
  • Loading branch information
gibiw committed Jun 13, 2024
1 parent 6308bf8 commit a424be0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
45 changes: 23 additions & 22 deletions qase-robotframework/docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ Environment variables override the values given in the config file.

## Configuration options

| Description | Config file | Environment variable | Default value | Required | Possible values |
|------------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
| **Common** |
| Main reporting mode | `mode` | `QASE_MODE` | `testops` | No | `testops`, `report`, `off` |
| Fallback reporting mode | `fallback` | `QASE_FALLBACK` | `report` | No | `testops`, `report`, `off` |
| Execution plan path | `execution_plan_path` | `QASE_EXECUTION_PLAN_PATH` | `./build/qase-execution-plan.json` | No | Any string |
| **Qase TestOps mode configuration** |
| Qase project code | `testops.project` | `QASE_TESTOPS_PROJECT` | | Yes | Any string |
| Qase API token | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | | Yes | Any string |
| Qase API host | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
| Title of the Qase test run | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated Run {current date and time}` | No | Any string |
| Description of the Qase test run | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | None, leave empty | No | Any string |
| Create test run using a test plan | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | None, don't use plans for the test run | No | Any integer |
| Complete test run after running tests | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | No | `true`, `false` |
| ID of the Qase test run to report results | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | None, create a new test run | No | Any integer |
| Batch size for uploading test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | 200 | No | 1 to 2000 |
| Create defects in Qase | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False`, don't create defects | No | `True`, `False` |
| Qase environment | `environment` | `QASE_ENVIRONMENT` | `local` | No | Any string |
| **Qase Report mode configuration** |
| Local path to store report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | No | Any string |
| Report format | `report.connection.format` | `QASE_REPORT_CONNECTION_FORMAT` | `json` | No | `json`, `jsonp` |
| Driver used for report mode | `report.driver` | `QASE_REPORT_DRIVER` | `local` | No | `local` |
| Description | Config file | Environment variable | Default value | Required | Possible values |
|-------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
| **Common** |
| Main reporting mode | `mode` | `QASE_MODE` | `testops` | No | `testops`, `report`, `off` |
| Fallback reporting mode | `fallback` | `QASE_FALLBACK` | `report` | No | `testops`, `report`, `off` |
| Execution plan path | `execution_plan_path` | `QASE_EXECUTION_PLAN_PATH` | `./build/qase-execution-plan.json` | No | Any string |
| Qase environment | `environment` | `QASE_ENVIRONMENT` | `local` | No | Any string |
| Root suite | `rootSuite` | `QASE_ROOT_SUITE` | | No | Any string |
| **Qase TestOps mode configuration** |
| Qase project code | `testops.project` | `QASE_TESTOPS_PROJECT` | | Yes | Any string |
| Qase API token | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | | Yes | Any string |
| Qase API host | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
| Title of the Qase test run | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated Run {current date and time}` | No | Any string |
| Description of the Qase test run | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | None, leave empty | No | Any string |
| Create test run using a test plan | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | None, don't use plans for the test run | No | Any integer |
| Complete test run after running tests | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | No | `true`, `false` |
| ID of the Qase test run to report results | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | None, create a new test run | No | Any integer |
| Batch size for uploading test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | 200 | No | 1 to 2000 |
| Create defects in Qase | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False`, don't create defects | No | `True`, `False` |
| **Qase Report mode configuration** |
| Local path to store report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | No | Any string |
| Report format | `report.connection.format` | `QASE_REPORT_CONNECTION_FORMAT` | `json` | No | `json`, `jsonp` |
| Driver used for report mode | `report.driver` | `QASE_REPORT_DRIVER` | `local` | No | `local` |
7 changes: 3 additions & 4 deletions qase-robotframework/src/qase/robotframework/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ class Listener:
ROBOT_LISTENER_API_VERSION = 2

def __init__(self):
self.config = ConfigManager()
self.reporter = QaseCoreReporter(self.config)
config = ConfigManager().config
self.reporter = QaseCoreReporter(config)
self.runtime = Runtime()
self.step_uuid = None
self.suite = {}

self.debug = self.config.get("debug", False, bool)
if self.debug:
if config.debug:
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
formatter = logging.Formatter(
Expand Down

0 comments on commit a424be0

Please sign in to comment.