Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add a get_execution_plan method #240

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading