Skip to content

Commit

Permalink
[qase-python-commons] Fixed an issue with host
Browse files Browse the repository at this point in the history
  • Loading branch information
n3r committed Dec 5, 2022
1 parent 30e2b19 commit abf567b
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion qase-pytest/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package_dir =
setup_requires = pyscaffold>=3.2a0,<3.3a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires =
qase-python-commons>=1.0.1
qase-python-commons>=1.0.2
pytest>=5.2.0
filelock>=3.0
python_requires = >=3.7
Expand Down
2 changes: 1 addition & 1 deletion qase-python-commons/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pkg_resources import VersionConflict, require
from setuptools import setup

VERSION = "1.0.1"
VERSION = "1.0.2"

try:
require("setuptools>=38.3")
Expand Down
2 changes: 1 addition & 1 deletion qase-python-commons/src/qaseio/commons/testops.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self,

configuration = Configuration()
configuration.api_key['TokenAuth'] = api_token
configuration.host = f'http://api.{host}/v1'
configuration.host = f'https://api.{host}/v1'

self.client = ApiClient(configuration)

Expand Down
2 changes: 1 addition & 1 deletion qase-robotframework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ENV variables:
- `QASE_TESTOPS_HOST` - Define a host for Qase TestOps. Default: `qase.io`
### Usage:
```
QASE_API_TOKEN=<API TOKEN> QASE_PROJECT=PRJCODE robot --listener qaseio.robotframework.Listener keyword_driven.robot data_driven.robot
QASE_API_TOKEN=<API TOKEN> QASE_PROJECT=PRJCODE robot --listener qaseio.robotframework.QaseListener keyword_driven.robot data_driven.robot
```
Moving variables to `tox.ini`, example configuration:
```ini
Expand Down
2 changes: 1 addition & 1 deletion qase-robotframework/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
qase-python-commons=1.0.1
qase-python-commons=1.0.2
2 changes: 1 addition & 1 deletion qase-robotframework/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package_dir =
setup_requires = pyscaffold>=3.2a0,<3.3a0
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires =
qase-python-commons>=1.0.0
qase-python-commons>=1.0.2
python_requires = >=3.7

[options.packages.find]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from qaseio.commons import QaseTestOps
from qaseio.commons import QaseUtils
from qaseio.commons import QaseReport
from .types import Envs, STATUSES
from .models import *

Expand Down Expand Up @@ -54,14 +55,16 @@ def __init__(self):
host=self._get_param(Envs.TESTOPS_HOST, 'qase.io'),
environment=self._get_param(Envs.ENVIRONMENT, None)
)
else:
self.reporter = QaseReport(
report_path=self._get_param(Envs.REPORT_PATH, 'build/qase-report'),
)

self.result = {}
self.steps = {}
self.step_uuid = None
self.suite = {}

self.reporter.start_run()

self.debug = self._get_param(Envs.DEBUG) and self._get_param(Envs.DEBUG).lower() in ['true', '1']
if self.debug:
logger.setLevel(logging.DEBUG)
Expand All @@ -72,6 +75,8 @@ def __init__(self):
ch.setFormatter(formatter)
logger.addHandler(ch)

self.reporter.start_run()

def _get_param(self, param: Envs, default=None):
param: str = param.value
return os.environ.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Envs(Enum):
TESTOPS_RUN_TITLE = "QASE_TESTOPS_RUN_TITLE"
TESTOPS_COMPLETE_RUN = "QASE_TESTOPS_COMPLETE_RUN"

REPORT_PATH = "QASE_REPORT_PATH"

STATUSES = {
"PASS": "passed",
"FAIL": "failed",
Expand Down
7 changes: 1 addition & 6 deletions qase-robotframework/tests/test_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,4 @@ def setup_env():


def test_init_listener(setup_env):
QaseListener()


def test_init_listener_error():
with pytest.raises(ValueError):
QaseListener()
QaseListener()

0 comments on commit abf567b

Please sign in to comment.