This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-orbit.git


The following commit(s) were added to refs/heads/main by this push:
     new 1230db4d Fix: aggregate reads a test run attribute that does not exist 
(#59)
1230db4d is described below

commit 1230db4d22593116906cf6301c05302910029231
Author: Serhiy Bzhezytskyy <[email protected]>
AuthorDate: Mon Jul 27 22:19:51 2026 +0300

    Fix: aggregate reads a test run attribute that does not exist (#59)
    
    update_config_object read test_run.cluster_config_instance_params, which no
    test run has, so aggregate always failed with
    
        Cannot aggregate. 'TestRun' object has no attribute 
'cluster_config_instance_params'.
    
    Regression from commits 2c85d505 and e10342d1
---
 solrorbit/aggregator.py  |  2 +-
 tests/aggregator_test.py | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/solrorbit/aggregator.py b/solrorbit/aggregator.py
index 7f099314..6d0a7790 100644
--- a/solrorbit/aggregator.py
+++ b/solrorbit/aggregator.py
@@ -166,7 +166,7 @@ class Aggregator:
         self.config.add(config.Scope.applicationOverride, "test_run", 
"pipeline", test_run.pipeline)
         self.config.add(config.Scope.applicationOverride, "workload", 
"params", test_run.workload_params)
         self.config.add(config.Scope.applicationOverride, "builder",
-                        "cluster_config.params", 
test_run.cluster_config_instance_params)
+                        "cluster_config.params", 
test_run.cluster_config_params)
         self.config.add(config.Scope.applicationOverride, "builder", 
"plugin.params", test_run.plugin_params)
         self.config.add(config.Scope.applicationOverride, "workload", 
"latency.percentiles", test_run.latency_percentiles)
         self.config.add(config.Scope.applicationOverride, "workload", 
"throughput.percentiles", test_run.throughput_percentiles)
diff --git a/tests/aggregator_test.py b/tests/aggregator_test.py
index 7bc046ad..50a3d9d9 100644
--- a/tests/aggregator_test.py
+++ b/tests/aggregator_test.py
@@ -2,6 +2,7 @@ from unittest.mock import Mock
 import pytest
 from solrorbit import config
 from solrorbit.aggregator import Aggregator, AggregatedResults
+from solrorbit import metrics
 
 @pytest.fixture
 def mock_config():
@@ -120,6 +121,21 @@ def test_calculate_weighted_average(aggregator):
     assert result["latency"]["avg"] == 16  # (10*2 + 20*3) / (2+3)
     assert result["latency"]["unit"] == "ms"
 
+def 
test_update_config_object_reads_attributes_that_test_runs_actually_have(aggregator):
+    # a real TestRun, not a Mock: a Mock creates whatever attribute is asked 
of it, so it cannot
+    # tell us whether update_config_object reads attributes that a test run 
really carries
+    test_run = metrics.TestRun(
+        benchmark_version="1.0.0", benchmark_revision="abc123", 
environment_name="unit-test",
+        test_run_id="test1", test_run_timestamp="20250101T000000Z", 
pipeline="docker", user_tags={},
+        workload="workload1", workload_params={}, test_procedure="test_proc1",
+        cluster_config=["vanilla"], cluster_config_params={"heap_size": "6g"}, 
plugin_params={},
+        meta_data={})
+
+    aggregator.update_config_object(test_run)
+
+    aggregator.config.add.assert_any_call(config.Scope.applicationOverride, 
"builder",
+                                          "cluster_config.params", 
{"heap_size": "6g"})
+
 def test_calculate_rsd(aggregator):
     values = [1, 2, 3, 4, 5]
     rsd = aggregator.calculate_rsd(values, "test_metric")

Reply via email to