From bd08d745f4e5bd6f3a7b94b4690ee28a0fac4f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 12 Jul 2023 20:56:55 +0200 Subject: [PATCH] tests: metrics: Move metrics specific function to metrics gha-run.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `compress_metrics_results_dir()` is only used by the metrics GHA. Signed-off-by: Fabiano FidĂȘncio --- tests/common.bash | 14 -------------- tests/metrics/gha-run.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/common.bash b/tests/common.bash index 0088b481cb..ab1ee6d470 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -241,20 +241,6 @@ function restart_containerd_service() { return 0 } -# @path_results: path to the input metric-results folder -# @tarball_fname: path and filename to the output tarball -function compress_metrics_results_dir() -{ - local path_results="${1:-results}" - local tarball_fname="${2:-}" - - [ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect." - [ ! -d "${path_results}" ] && die "Missing path to the results folder." - - cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd - - info "tarball generated: ${tarball_fname}" -} - function create_symbolic_links() { local KATA_HYPERVISOR="${1}" diff --git a/tests/metrics/gha-run.sh b/tests/metrics/gha-run.sh index 3e6d46817b..1ea5cd19cf 100755 --- a/tests/metrics/gha-run.sh +++ b/tests/metrics/gha-run.sh @@ -26,6 +26,20 @@ function install_checkmetrics() { popd } +# @path_results: path to the input metric-results folder +# @tarball_fname: path and filename to the output tarball +function compress_metrics_results_dir() +{ + local path_results="${1:-results}" + local tarball_fname="${2:-}" + + [ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect." + [ ! -d "${path_results}" ] && die "Missing path to the results folder." + + cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd - + info "tarball generated: ${tarball_fname}" +} + function check_metrics() { local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml" checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}"