From 00a448e1368fe6df3652e0cb0962be12f1bbaa52 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 12 May 2024 19:47:29 +0800 Subject: [PATCH] tests: move apps/metrics_tester to tests/unit so that we can reuse metrics_tester for unit test -- we will add tests exercising the query parameters supported by the exporter httpd server, like `__name__` and `__aggregate__`. Signed-off-by: Kefu Chai --- apps/CMakeLists.txt | 1 - apps/metrics_tester/CMakeLists.txt | 27 ------------------- tests/unit/CMakeLists.txt | 7 +++++ .../unit}/conf-example.yaml | 0 .../unit}/metrics_tester.cc | 2 +- .../unit}/test_metrics.py | 0 6 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 apps/metrics_tester/CMakeLists.txt rename {apps/metrics_tester => tests/unit}/conf-example.yaml (100%) rename {apps/metrics_tester => tests/unit}/metrics_tester.cc (99%) rename {apps/metrics_tester => tests/unit}/test_metrics.py (100%) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 333d72d9c4e..a4f34812cea 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -51,7 +51,6 @@ endmacro () add_subdirectory (httpd) add_subdirectory (io_tester) add_subdirectory (rpc_tester) -add_subdirectory(metrics_tester) add_subdirectory (iotune) add_subdirectory (memcached) add_subdirectory (seawreck) diff --git a/apps/metrics_tester/CMakeLists.txt b/apps/metrics_tester/CMakeLists.txt deleted file mode 100644 index 4883e083e1e..00000000000 --- a/apps/metrics_tester/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is open source software, licensed to you under the terms -# of the Apache License, Version 2.0 (the "License"). See the NOTICE file -# distributed with this work for additional information regarding copyright -# ownership. You may not use this file except in compliance with the License. -# -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# -# Copyright (C) 2024 Scylladb, Ltd. -# - -seastar_add_app (metrics_tester - SOURCES metrics_tester.cc) - -target_link_libraries (app_metrics_tester - PRIVATE yaml-cpp::yaml-cpp) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index e74df8d8ce9..b85d701eba6 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -757,3 +757,10 @@ add_test ( set_tests_properties (Seastar.unit.json2code PROPERTIES TIMEOUT ${Seastar_TEST_TIMEOUT}) + +add_executable (metrics_tester + metrics_tester.cc) +target_link_libraries (metrics_tester + PRIVATE + seastar_private + yaml-cpp::yaml-cpp) diff --git a/apps/metrics_tester/conf-example.yaml b/tests/unit/conf-example.yaml similarity index 100% rename from apps/metrics_tester/conf-example.yaml rename to tests/unit/conf-example.yaml diff --git a/apps/metrics_tester/metrics_tester.cc b/tests/unit/metrics_tester.cc similarity index 99% rename from apps/metrics_tester/metrics_tester.cc rename to tests/unit/metrics_tester.cc index 84fef695c94..b1a7ed87ac7 100644 --- a/apps/metrics_tester/metrics_tester.cc +++ b/tests/unit/metrics_tester.cc @@ -26,7 +26,7 @@ #include #include #include -#include "../lib/stop_signal.hh" +#include "../../apps/lib/stop_signal.hh" #include #include #include diff --git a/apps/metrics_tester/test_metrics.py b/tests/unit/test_metrics.py similarity index 100% rename from apps/metrics_tester/test_metrics.py rename to tests/unit/test_metrics.py