Skip to content

Commit 7761ff2

Browse files
committed
ft-orchestration fix sim_threshold result and add test id in html report name
1 parent 1e3f4d9 commit 7761ff2

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

tools/ft-orchestration/src/common/html_report_plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pytest_html.plugin import HTMLReport
1717
from ftanalyzer.reports import ValidationReportSummary
1818
from py.xml import html # type: ignore
19-
from src.config.scenario import ScenarioCfg
19+
from src.config.scenario import ScenarioCfg, SimulationScenario
2020

2121

2222
class SimulationTestsSummary:
@@ -332,6 +332,8 @@ def pytest_runtest_makereport(item: pytest.Function) -> None: # type: ignore
332332
if not isinstance(scenario, ScenarioCfg):
333333
raise ValueError
334334
report.test_name = scenario.name
335+
if isinstance(scenario, SimulationScenario) and scenario.test:
336+
report.test_name += " " + scenario.test.id
335337
report.test_description = scenario.description
336338
except (AttributeError, ValueError):
337339
report.test_name = ""

tools/ft-orchestration/tests/simulation/test_simulation_threshold.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,16 @@ def run_single_test(loops: int, speed: MbpsSpeed) -> tuple[bool, StatisticalRepo
342342
objects_to_cleanup = []
343343
gc.collect()
344344

345-
passed = scenario.test.mbps_required <= speed_min
345+
passed = scenario.test.mbps_required <= speed_current
346346
report.print_results()
347347
HTMLReportData.simulation_summary_report.update_stats("sim_threshold", passed)
348348

349349
logging.getLogger().info(
350350
"maximum throughput: %s Mbps (accuracy: %s Mbps)",
351-
speed_min,
351+
speed_current,
352352
scenario.test.mbps_accuracy,
353353
)
354-
if passed:
354+
if not passed:
355355
pytest.xfail(
356-
f"throughput ({speed_min} Mbps) is less than required ({scenario.test.mbps_required} Mbps)"
356+
f"throughput ({speed_current} Mbps) is less than required ({scenario.test.mbps_required} Mbps)"
357357
)

0 commit comments

Comments
 (0)