diff --git a/qase-robotframework/changelog.md b/qase-robotframework/changelog.md index e770d78d..c0283cdb 100644 --- a/qase-robotframework/changelog.md +++ b/qase-robotframework/changelog.md @@ -1,3 +1,11 @@ +# qase-pytest 3.1.1 + +## What's new + +Minor release that includes all changes from beta versions 3.1.1b. + +Support `ignore` tag. If the test has the `ignore` tag, the reporter will not send the result to Qase. + # qase-pytest 3.1.1b2 ## What's new diff --git a/qase-robotframework/pyproject.toml b/qase-robotframework/pyproject.toml index 6761fb3a..e4df7719 100644 --- a/qase-robotframework/pyproject.toml +++ b/qase-robotframework/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "qase-robotframework" -version = "3.1.1b2" +version = "3.1.1" description = "Qase Robot Framework Plugin" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] @@ -17,7 +17,7 @@ classifiers = [ urls = {"Homepage" = "https://github.com/qase-tms/qase-python/tree/master/qase-robotframework"} requires-python = ">=3.7" dependencies = [ - "qase-python-commons~=3.1.0", + "qase-python-commons~=3.1.3", ] [project.optional-dependencies] diff --git a/qase-robotframework/src/qase/robotframework/listener.py b/qase-robotframework/src/qase/robotframework/listener.py index 1993b2ad..794ab38d 100644 --- a/qase-robotframework/src/qase/robotframework/listener.py +++ b/qase-robotframework/src/qase/robotframework/listener.py @@ -53,6 +53,12 @@ def start_test(self, name, attributes: StartTestModel): def end_test(self, name, attributes: EndTestModel): logger.debug("Finishing test '%s'", name) + self.step_uuid = None + + if self.__is_test_ignore(attributes.get("tags")): + logger.info("Test '%s' is ignored", name) + return + case_id = self._extract_ids(attributes.get("tags")) if case_id: self.runtime.result.testops_id = int(case_id) @@ -80,8 +86,6 @@ def end_test(self, name, attributes: EndTestModel): self.reporter.add_result(self.runtime.result) - self.step_uuid = None - logger.info( "Finished case result: %s, error: %s", attributes.get("status"), @@ -117,12 +121,18 @@ def close(self): logger.info("complete run executing") self.reporter.complete_run() - def log_message(self, message): + @staticmethod + def log_message(message): logger.debug("Log:", message) - def _extract_ids(self, list_of_tags: List[str]): - id = re.compile(r"Q-(\d+)", re.IGNORECASE) + @staticmethod + def _extract_ids(list_of_tags: List[str]): + qase_id = re.compile(r"Q-(\d+)", re.IGNORECASE) for tag in list_of_tags: - if id.fullmatch(tag): - return int(id.match(tag).groups()[0]) + if qase_id.fullmatch(tag): + return int(qase_id.match(tag).groups()[0]) return None + + @staticmethod + def __is_test_ignore(list_of_tags: List[str]): + return any(tag.lower() == "ignore" for tag in list_of_tags)