Skip to content

Commit

Permalink
feature: add a get_execution_plan method
Browse files Browse the repository at this point in the history
Add the `get_execution_plan` method that returns a list of test case IDs to execute
  • Loading branch information
gibiw committed Aug 6, 2024
1 parent 689a71a commit 5273539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qase-python-commons/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-python-commons"
version = "3.0.3"
version = "3.0.4"
description = "A library for Qase TestOps and Qase Report"
readme = "README.md"
authors = [{name = "Qase Team", email = "[email protected]"}]
Expand Down
9 changes: 6 additions & 3 deletions qase-python-commons/src/qase/commons/reporters/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .testops import QaseTestOps

from ..models import Result, Attachment, Runtime
from typing import Union
from typing import Union, List

"""
CoreReporter is a facade for all reporters and it is used to initialize and manage them.
Expand All @@ -21,7 +21,7 @@ class QaseCoreReporter:
def __init__(self, config: Config):
self.config = config
self.logger = Logger(self.config.get('debug', False, bool))
self.execution_plan = None
self._execution_plan = None
self.profilers = []
self.overhead = 0

Expand Down Expand Up @@ -149,6 +149,9 @@ def complete_worker(self) -> None:
self.logger.log(e, 'error')
self._run_fallback()

def get_execution_plan(self) -> Union[List[int], None]:
return self._execution_plan

def _run_fallback(self) -> None:
if self.fallback:
try:
Expand All @@ -174,7 +177,7 @@ def _load_testops_plan(self) -> None:
api_token=self.config.get("testops.api.token"),
host=self.config.get("testops.api.host", "qase.io"),
)
self.execution_plan = loader.load(self.config.get("testops.project"),
self._execution_plan = loader.load(self.config.get("testops.project"),
int(self.config.get("testops.plan.id")))
except Exception as e:
self.logger.log('Failed to load test plan from Qase TestOps', 'info')
Expand Down

0 comments on commit 5273539

Please sign in to comment.