Loading .pylintrc +3 −2 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ disable=print-statement, # Custom disables missing-docstring, too-many-ancestors, too-many-arguments too-many-arguments, logging-fstring-interpolation # Enable the message, report, category or checker with the given id(s). You can Loading Loading @@ -405,7 +406,7 @@ good-names=i, Run, _, # Custom ok, x, y, t, log ok, x, y, t, log, ft # Include a hint for the correct naming format with invalid-name include-naming-hint=no Loading ktdk/__init__.py +15 −5 Original line number Diff line number Diff line Loading @@ -8,12 +8,11 @@ from typing import Callable, List, Optional import requests from ktdk import log_config from ktdk import log_config, utils from ktdk.config import Config from ktdk.core import Result, Task, Test from ktdk.runtime import Context from ktdk.runtime.stat import stat_test from ktdk.utils import unique_name log = logging.getLogger(__name__) Loading @@ -25,18 +24,25 @@ def dump_to_file(context: Context, file_name: str, what): file_name(str): File name what: What should be written to the file """ file_name = unique_name(file_name, context=context) + ".json" file_name = utils.unique_name(file_name, context=context) + ".json" context.paths.save_result(file_name, json.dumps(what)) class KTDK(object): class KTDK: """ Main class of the KTDK, it holds configuration, the suite (root of the ) """ instance = None @staticmethod def get_instance(**cfg): def get_instance(**cfg) -> 'KTDK': """Gets an instance of the KTDK Args: **cfg: KTDK config Returns(KTDK): KTDK instance """ if KTDK.instance is None: log.debug(f"[KTDK] Instance config: {cfg}") KTDK.instance = KTDK(**cfg) Loading @@ -61,6 +67,10 @@ class KTDK(object): log.trace(f"[KTDK] Config: {key}={val}") def register_tags(self, *tags): """Register avail. tags for the suite run Args: *tags: List of tags """ if 'registered_tags' not in self.config: self.config['registered_tags'] = [] self.config['registered_tags'].extend(tags) Loading ktdk/asserts/checks/executable.py +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class ValgrindPassedCheck(AbstractExecResultMatchesTask): def points_multiplier(self): if self._points_multiplier: return self._points_multiplier else: return self.context.config['valgrind_penalization'] or 0 @property Loading ktdk/asserts/checks/general.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,9 +4,9 @@ from ktdk.core.tasks import Task class AbortTask(Task): def __init__(self, message: str = None, **kwargs): super().__init__(**kwargs) self.message = message self.desc = self.message or message self.name = self.name or 'abort_task' self.message = message def _run(self, *args, **kwargs): self.asserts.abort(self.message) Loading ktdk/asserts/checks/junit.py +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ class AbstractXUnitCaseCheck(AbstractMatchesTask): def case(self) -> junitparser.TestCase: return self.context.config['xunit_case'] class XUnitSuiteFailsCheck(AbstractXUnitSuiteCheck): def _run(self, *args, **kwargs): self.asserts.check(self.suite.failures, matcher=self.matcher) Loading @@ -33,4 +34,3 @@ class XUnitSuiteNokCheck(AbstractXUnitSuiteCheck): class XUnitCaseCheck(AbstractXUnitCaseCheck): def _run(self, *args, **kwargs): self.asserts.check(self.case.result, matcher=self.matcher) Loading
.pylintrc +3 −2 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ disable=print-statement, # Custom disables missing-docstring, too-many-ancestors, too-many-arguments too-many-arguments, logging-fstring-interpolation # Enable the message, report, category or checker with the given id(s). You can Loading Loading @@ -405,7 +406,7 @@ good-names=i, Run, _, # Custom ok, x, y, t, log ok, x, y, t, log, ft # Include a hint for the correct naming format with invalid-name include-naming-hint=no Loading
ktdk/__init__.py +15 −5 Original line number Diff line number Diff line Loading @@ -8,12 +8,11 @@ from typing import Callable, List, Optional import requests from ktdk import log_config from ktdk import log_config, utils from ktdk.config import Config from ktdk.core import Result, Task, Test from ktdk.runtime import Context from ktdk.runtime.stat import stat_test from ktdk.utils import unique_name log = logging.getLogger(__name__) Loading @@ -25,18 +24,25 @@ def dump_to_file(context: Context, file_name: str, what): file_name(str): File name what: What should be written to the file """ file_name = unique_name(file_name, context=context) + ".json" file_name = utils.unique_name(file_name, context=context) + ".json" context.paths.save_result(file_name, json.dumps(what)) class KTDK(object): class KTDK: """ Main class of the KTDK, it holds configuration, the suite (root of the ) """ instance = None @staticmethod def get_instance(**cfg): def get_instance(**cfg) -> 'KTDK': """Gets an instance of the KTDK Args: **cfg: KTDK config Returns(KTDK): KTDK instance """ if KTDK.instance is None: log.debug(f"[KTDK] Instance config: {cfg}") KTDK.instance = KTDK(**cfg) Loading @@ -61,6 +67,10 @@ class KTDK(object): log.trace(f"[KTDK] Config: {key}={val}") def register_tags(self, *tags): """Register avail. tags for the suite run Args: *tags: List of tags """ if 'registered_tags' not in self.config: self.config['registered_tags'] = [] self.config['registered_tags'].extend(tags) Loading
ktdk/asserts/checks/executable.py +2 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class ValgrindPassedCheck(AbstractExecResultMatchesTask): def points_multiplier(self): if self._points_multiplier: return self._points_multiplier else: return self.context.config['valgrind_penalization'] or 0 @property Loading
ktdk/asserts/checks/general.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,9 +4,9 @@ from ktdk.core.tasks import Task class AbortTask(Task): def __init__(self, message: str = None, **kwargs): super().__init__(**kwargs) self.message = message self.desc = self.message or message self.name = self.name or 'abort_task' self.message = message def _run(self, *args, **kwargs): self.asserts.abort(self.message) Loading
ktdk/asserts/checks/junit.py +1 −1 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ class AbstractXUnitCaseCheck(AbstractMatchesTask): def case(self) -> junitparser.TestCase: return self.context.config['xunit_case'] class XUnitSuiteFailsCheck(AbstractXUnitSuiteCheck): def _run(self, *args, **kwargs): self.asserts.check(self.suite.failures, matcher=self.matcher) Loading @@ -33,4 +34,3 @@ class XUnitSuiteNokCheck(AbstractXUnitSuiteCheck): class XUnitCaseCheck(AbstractXUnitCaseCheck): def _run(self, *args, **kwargs): self.asserts.check(self.case.result, matcher=self.matcher)