Skip to content

Commit d78f260

Browse files
pb8ozulinx86
authored andcommitted
test: move the env_id prefix to the st_core fixture
This centralizes some of the logic in a single place so it does not have to be repeated for each test. Signed-off-by: Pablo Barbáchano <pablob@amazon.com>
1 parent aeed33d commit d78f260

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

tests/integration_tests/performance/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ def send_metrics(metrics, stats: core.Core):
8585
def st_core(metrics, results_file_dumper, guest_kernel, rootfs, request):
8686
"""Helper fixture to dump results and publish metrics"""
8787
stats = core.Core()
88+
guest_kernel_ver = guest_kernel.prop
8889
stats.check_baseline = request.config.getoption("--perf-fail")
90+
stats.env_id_prefix = f"{guest_kernel_ver}/{rootfs.name()}"
8991
stats.iterations = 1
9092
stats.custom = {
9193
"instance": global_props.instance,
9294
"cpu_model": global_props.cpu_model,
9395
"host_kernel": "linux-" + global_props.host_linux_version,
94-
"guest_kernel": guest_kernel.prop,
96+
"guest_kernel": guest_kernel_ver,
9597
"rootfs": rootfs.name(),
9698
}
9799
stats.metrics = metrics

tests/integration_tests/performance/test_block_performance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_block_performance(
285285
}
286286
)
287287

288-
env_id = f"{guest_kernel.name()}/{rootfs.name()}/{io_engine.lower()}_{microvm_cfg}"
288+
env_id = f"{st_core.env_id_prefix}/{io_engine.lower()}_{microvm_cfg}"
289289

290290
fio_id = f"{fio_mode}-bs{fio_block_size}"
291291
st_prod = st.producer.LambdaProducer(

tests/integration_tests/performance/test_network_latency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_network_latency(
133133

134134
raw_baselines = json.loads(CONFIG_NAME_ABS.read_text("utf-8"))
135135

136-
env_id = f"{guest_kernel.name()}/{rootfs.name()}/{guest_config}"
136+
env_id = f"{st_core.env_id_prefix}/{guest_config}"
137137
cons = consumer.LambdaConsumer(
138138
metadata_provider=DictMetadataProvider(
139139
measurements=raw_baselines["measurements"],

tests/integration_tests/performance/test_network_tcp_throughput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def test_network_tcp_throughput(
159159
payload_length,
160160
current_avail_cpu + 1,
161161
DEFAULT_HOST_IP,
162-
f"{guest_kernel.name()}/{rootfs.name()}/{microvm_cfg}",
162+
f"{st_core.env_id_prefix}/{microvm_cfg}",
163163
)
164164
st_core.add_pipe(prod, cons, tag)
165165

tests/integration_tests/performance/test_snapshot_restore_performance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_snapshot_scaling(
213213
pytest.skip()
214214

215215
guest_config = f"{vcpus}vcpu_{mem}mb"
216-
env_id = f"{guest_kernel.name()}/{rootfs.name()}/{guest_config}"
216+
env_id = f"{st_core.env_id_prefix}/{guest_config}"
217217
st_prod = st.producer.LambdaProducer(
218218
func=get_snap_restore_latency,
219219
func_kwargs={
@@ -244,7 +244,7 @@ def test_snapshot_all_devices(
244244
pytest.skip()
245245

246246
guest_config = "all_dev"
247-
env_id = f"{guest_kernel.name()}/{rootfs.name()}/{guest_config}"
247+
env_id = f"{st_core.env_id_prefix}/{guest_config}"
248248
st_prod = st.producer.LambdaProducer(
249249
func=get_snap_restore_latency,
250250
func_kwargs={

tests/integration_tests/performance/test_vsock_throughput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def test_vsock_throughput(
175175
cons, prod, tag = pipe(
176176
vm,
177177
current_avail_cpu + 1,
178-
f"{guest_kernel.name()}/{rootfs.name()}/{guest_config}",
178+
f"{st_core.env_id_prefix}/{guest_config}",
179179
mode,
180180
payload_length,
181181
)

0 commit comments

Comments
 (0)