From 1660929ee00c2df8a457dbece30d7e99af714019 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 13 Dec 2021 14:01:08 +0100 Subject: [PATCH 1/3] Check: performance data are only created for a S/T/K if the RF result is PASS. closes #177. --- CHANGELOG.md | 4 ++++ checks/v1/robotmk | 3 ++- checks/v2/robotmk.py | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2668800d..2cf2a6d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +* Check: performance data are only created for a S/T/K if the RF result is PASS (#177). + ## 1.2.5 - 2021-12-13 * Check: Fixed #178 when the suite ran, but procudes a fatal error. diff --git a/checks/v1/robotmk b/checks/v1/robotmk index 5a2a6b42..94198d1f 100644 --- a/checks/v1/robotmk +++ b/checks/v1/robotmk @@ -676,7 +676,8 @@ class RobotItem(object): check_params) perfdata_wanted = self._get_pattern_value('perfdata_creation', check_params) - if perfdata_wanted and self.elapsed_time != None: + # Only generate perfdata for RF PASS state. + if perfdata_wanted and self.elapsed_time != None and self.status == 'PASS': perflabel = get_perflabel("%s_%s" % (self.id, self.name)) if runtime_threshold: cmk_perfdata = ( diff --git a/checks/v2/robotmk.py b/checks/v2/robotmk.py index 6256c81a..5104e463 100644 --- a/checks/v2/robotmk.py +++ b/checks/v2/robotmk.py @@ -684,7 +684,8 @@ def _eval_node_cmk_perfdata(self, check_params): check_params) perfdata_wanted = self._get_pattern_value('perfdata_creation', check_params) - if perfdata_wanted and self.elapsed_time != None: + # Only generate perfdata for RF PASS state. + if perfdata_wanted and self.elapsed_time != None and self.status == 'PASS': perflabel = get_perflabel("%s_%s" % (self.id, self.name)) if runtime_threshold: cmk_perfdata = Metric( From 1a4055c88e65e66b62ff4937fc47a790c9d9c795 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 13 Dec 2021 14:01:25 +0100 Subject: [PATCH 2/3] CHANGELOG: v1.2.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cf2a6d3..04da93db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 1.2.6 - 2021-12-13 * Check: performance data are only created for a S/T/K if the RF result is PASS (#177). From eef13e15d78b7046d33259339125c54336e0b219 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 13 Dec 2021 14:01:26 +0100 Subject: [PATCH 3/3] Version bump: v1.2.6 --- agents_plugins/robotmk.py | 2 +- bakery/v1/robotmk.py | 2 +- bakery/v2/robotmk.py | 2 +- checks/v1/robotmk | 2 +- checks/v2/robotmk.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agents_plugins/robotmk.py b/agents_plugins/robotmk.py index 8bf7810a..9bce65a6 100755 --- a/agents_plugins/robotmk.py +++ b/agents_plugins/robotmk.py @@ -49,7 +49,7 @@ local_tz = datetime.utcnow().astimezone().tzinfo -ROBOTMK_VERSION = 'v1.2.5' +ROBOTMK_VERSION = 'v1.2.6' class RMKConfig(): _PRESERVED_WORDS = [ diff --git a/bakery/v1/robotmk.py b/bakery/v1/robotmk.py index c04eea41..c2c1173b 100644 --- a/bakery/v1/robotmk.py +++ b/bakery/v1/robotmk.py @@ -18,7 +18,7 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -ROBOTMK_VERSION = 'v1.2.5' +ROBOTMK_VERSION = 'v1.2.6' import cmk.utils.paths import os diff --git a/bakery/v2/robotmk.py b/bakery/v2/robotmk.py index 0379380c..cc79d13d 100644 --- a/bakery/v2/robotmk.py +++ b/bakery/v2/robotmk.py @@ -18,7 +18,7 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -ROBOTMK_VERSION = 'v1.2.5' +ROBOTMK_VERSION = 'v1.2.6' from typing import Iterable, TypedDict, List from pathlib import Path diff --git a/checks/v1/robotmk b/checks/v1/robotmk index 94198d1f..07b66931 100644 --- a/checks/v1/robotmk +++ b/checks/v1/robotmk @@ -34,7 +34,7 @@ from collections import namedtuple iam = "robotmk" # DO NOT DELETE inventory_robotmk_rules = [] -ROBOTMK_VERSION = 'v1.2.5' +ROBOTMK_VERSION = 'v1.2.6' DEFAULT_SVC_PREFIX = 'Robot Framework E2E $SUITEID$SPACE-$SPACE' HTML_LOG_DIR = "%s/%s" % (os.environ['OMD_ROOT'], 'local/share/addons/robotmk') diff --git a/checks/v2/robotmk.py b/checks/v2/robotmk.py index 5104e463..11a3a68d 100644 --- a/checks/v2/robotmk.py +++ b/checks/v2/robotmk.py @@ -35,7 +35,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1 import * from cmk.utils.exceptions import MKGeneralException -ROBOTMK_VERSION = 'v1.2.5' +ROBOTMK_VERSION = 'v1.2.6' DEFAULT_SVC_PREFIX = 'Robot Framework E2E $SUITEID$SPACE-$SPACE' HTML_LOG_DIR = "%s/%s" % (os.environ['OMD_ROOT'], 'local/share/addons/robotmk')