Fri, Oct 30, 2020 at 05:15:01PM CET, jtluka@redhat.com wrote:
It make more sense to have both BasePerfTestTweakMixin and BasePerfTestIterationTweakMixin in one place.
In addition, the BasePerfTestTweakMixin was moved from BaseEnrtRecipe to Perf.Recipe class.
Signed-off-by: Jan Tluka jtluka@redhat.com
.../Perf}/PerfTestMixins/BasePerfTestTweakMixin.py | 0 lnst/RecipeCommon/Perf/Recipe.py | 13 ++++++++++--- lnst/Recipes/ENRT/BaseEnrtRecipe.py | 9 ++------- .../PerfTestMixins/SctpFirewallPerfTestMixin.py | 2 +- lnst/Recipes/ENRT/PerfTestMixins/__init__.py | 1 - 5 files changed, 13 insertions(+), 12 deletions(-) rename lnst/{Recipes/ENRT => RecipeCommon/Perf}/PerfTestMixins/BasePerfTestTweakMixin.py (100%)
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py b/lnst/RecipeCommon/Perf/PerfTestMixins/BasePerfTestTweakMixin.py similarity index 100% rename from lnst/Recipes/ENRT/PerfTestMixins/BasePerfTestTweakMixin.py rename to lnst/RecipeCommon/Perf/PerfTestMixins/BasePerfTestTweakMixin.py diff --git a/lnst/RecipeCommon/Perf/Recipe.py b/lnst/RecipeCommon/Perf/Recipe.py index 03494b29..d1098fa2 100644 --- a/lnst/RecipeCommon/Perf/Recipe.py +++ b/lnst/RecipeCommon/Perf/Recipe.py @@ -7,6 +7,7 @@ from lnst.RecipeCommon.Perf.Results import SequentialPerfResult from lnst.RecipeCommon.Perf.Results import ParallelPerfResult
from lnst.RecipeCommon.Perf.PerfTestMixins import (
BasePerfTestTweakMixin, BasePerfTestIterationTweakMixin,)
@@ -53,12 +54,18 @@ class RecipeResults(object): aggregated_results, new_results) self._results[measurement] = aggregated_results
-class Recipe(BasePerfTestIterationTweakMixin, BaseRecipe): +class Recipe(BasePerfTestTweakMixin, BasePerfTestIterationTweakMixin, BaseRecipe): def perf_test(self, recipe_conf): results = RecipeResults(recipe_conf)
for i in range(recipe_conf.iterations):self.perf_test_iteration(recipe_conf, results)
self.apply_perf_test_tweak(recipe_conf)self.describe_perf_test_tweak(recipe_conf)try:for i in range(recipe_conf.iterations):self.perf_test_iteration(recipe_conf, results)finally:self.remove_perf_test_tweak(recipe_conf) return resultsdiff --git a/lnst/Recipes/ENRT/BaseEnrtRecipe.py b/lnst/Recipes/ENRT/BaseEnrtRecipe.py index d629b726..180f922e 100644 --- a/lnst/Recipes/ENRT/BaseEnrtRecipe.py +++ b/lnst/Recipes/ENRT/BaseEnrtRecipe.py @@ -355,13 +355,8 @@ class BaseEnrtRecipe(CommonPerfTestTweakMixin, methods to execute, report and evaluate the results. """ for perf_config in self.generate_perf_configurations(recipe_config):
self.apply_perf_test_tweak(perf_config)self.describe_perf_test_tweak(perf_config)try:result = self.perf_test(perf_config)self.perf_report_and_evaluate(result)finally:self.remove_perf_test_tweak(perf_config)
result = self.perf_test(perf_config)self.perf_report_and_evaluate(result)def generate_ping_configurations(self, config): """Base ping test configuration generator
diff --git a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py index c0520405..841df3f7 100644 --- a/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py +++ b/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py @@ -1,5 +1,5 @@ from lnst.Controller.RecipeResults import ResultLevel -from lnst.Recipes.ENRT.PerfTestMixins import BasePerfTestTweakMixin +from lnst.RecipeCommon.Perf.PerfTestMixins import BasePerfTestTweakMixin
There's a bug. In a trial run following exception has been detected:
File "/usr/lib/python3.6/site-packages/lnst/RHExtensions/ExtendedRecipes.py", line 3, in <module> import lnst.Recipes.ENRT as enrt_recipes File "/usr/lib/python3.6/site-packages/lnst/Recipes/ENRT/__init__.py", line 53, in <module> from lnst.Recipes.ENRT.SimpleNetworkRecipe import SimpleNetworkRecipe File "/usr/lib/python3.6/site-packages/lnst/Recipes/ENRT/SimpleNetworkRecipe.py", line 4, in <module> from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe File "/usr/lib/python3.6/site-packages/lnst/Recipes/ENRT/BaseEnrtRecipe.py", line 16, in <module> from lnst.Recipes.ENRT.PerfTestMixins import CommonPerfTestTweakMixin File "/usr/lib/python3.6/site-packages/lnst/Recipes/ENRT/PerfTestMixins/__init__.py", line 1, in <module> from lnst.Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin import SctpFirewallPerfTestMixin File "/usr/lib/python3.6/site-packages/lnst/Recipes/ENRT/PerfTestMixins/SctpFirewallPerfTestMixin.py", line 2, in <module> from lnst.RecipeCommon.Perf.PerfTestMixins import BasePerfTestTweakMixin ModuleNotFoundError: No module named 'lnst.RecipeCommon.Perf.PerfTestMixins'
Will send a fixed patch set.
class SctpFirewallPerfTestMixin(BasePerfTestTweakMixin): def apply_perf_test_tweak(self, perf_config): diff --git a/lnst/Recipes/ENRT/PerfTestMixins/__init__.py b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py index 8a109ad0..addfb641 100644 --- a/lnst/Recipes/ENRT/PerfTestMixins/__init__.py +++ b/lnst/Recipes/ENRT/PerfTestMixins/__init__.py @@ -1,3 +1,2 @@ -from lnst.Recipes.ENRT.PerfTestMixins.BasePerfTestTweakMixin import BasePerfTestTweakMixin from lnst.Recipes.ENRT.PerfTestMixins.SctpFirewallPerfTestMixin import SctpFirewallPerfTestMixin from lnst.Recipes.ENRT.PerfTestMixins.CommonPerfTestTweakMixin import CommonPerfTestTweakMixin -- 2.21.3