From 62c2196b8767a95d1be4178ecd11c7f4d0ab7e61 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Tue, 1 Oct 2024 14:16:48 +0300 Subject: [PATCH 1/4] tests: Fix the spec URL value https://github.com/openhpc/ohpc/tests leads to 404. The correct one would be https://github.com/openhpc/ohpc/tree/3.x/tests but it is version specific Signed-off-by: Martin Tzvetanov Grigorov --- components/admin/test-suite/SPECS/tests.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/admin/test-suite/SPECS/tests.spec b/components/admin/test-suite/SPECS/tests.spec index 3d80393a5f..3df9e0442a 100644 --- a/components/admin/test-suite/SPECS/tests.spec +++ b/components/admin/test-suite/SPECS/tests.spec @@ -17,7 +17,7 @@ Release: 1 License: Apache-2.0 Group: %{PROJ_NAME}/admin BuildArch: noarch -URL: https://github.com/openhpc/ohpc/tests +URL: https://github.com/openhpc/ohpc Source0: tests-ohpc.tar BuildRequires: autoconf%{PROJ_DELIM} From a82aeb483ed065099dcffd29fcffaaa31d6b8487 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 4 Oct 2024 23:10:34 +0300 Subject: [PATCH 2/4] Add get_source.sh for admin/test-suite component Signed-off-by: Martin Tzvetanov Grigorov --- .../admin/test-suite/SOURCES/get_source.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 components/admin/test-suite/SOURCES/get_source.sh diff --git a/components/admin/test-suite/SOURCES/get_source.sh b/components/admin/test-suite/SOURCES/get_source.sh new file mode 100644 index 0000000000..d0bd95a62c --- /dev/null +++ b/components/admin/test-suite/SOURCES/get_source.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -xe + +# Note: The current working directory is the component's SPEC folder +OHPC_ROOT_FOLDER="../../../.." + +# The folder that will contain the .git/ and docs/ folders +TESTS_OHPC_FOLDER=tests-ohpc + +cleanup() { + rm -rf ${TESTS_OHPC_FOLDER} +} +trap cleanup EXIT + +# 1. Prepare +cleanup +mkdir -p ${TESTS_OHPC_FOLDER} + +# 2. Copy the local docs/ +cp -r ${OHPC_ROOT_FOLDER}/tests ${TESTS_OHPC_FOLDER} + +# 3. Create tests-ohpc.tar +tar cf ../SOURCES/tests-ohpc.tar ${TESTS_OHPC_FOLDER} From 95869119975e93782a3a4e9cd5c5abc0aaf9f5b4 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 4 Oct 2024 23:25:40 +0300 Subject: [PATCH 3/4] Add Perl File::Copy & File::Compare as build requirements Signed-off-by: Martin Tzvetanov Grigorov --- components/admin/test-suite/SPECS/tests.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/admin/test-suite/SPECS/tests.spec b/components/admin/test-suite/SPECS/tests.spec index 3df9e0442a..4a68ba9f5b 100644 --- a/components/admin/test-suite/SPECS/tests.spec +++ b/components/admin/test-suite/SPECS/tests.spec @@ -20,6 +20,8 @@ BuildArch: noarch URL: https://github.com/openhpc/ohpc Source0: tests-ohpc.tar +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Compare) BuildRequires: autoconf%{PROJ_DELIM} BuildRequires: automake%{PROJ_DELIM} From 6b98e9329990b4caec1856b89a30b3e64fd82da7 Mon Sep 17 00:00:00 2001 From: Martin Tzvetanov Grigorov Date: Fri, 4 Oct 2024 23:48:43 +0300 Subject: [PATCH 4/4] docs & test-suite: shellcheck lint the get_source.sh scripts Signed-off-by: Martin Tzvetanov Grigorov --- components/admin/docs/SOURCES/get_source.sh | 23 ++++++++++--------- .../admin/test-suite/SOURCES/get_source.sh | 8 +++---- tests/ci/Makefile | 2 ++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/components/admin/docs/SOURCES/get_source.sh b/components/admin/docs/SOURCES/get_source.sh index 07892d2de4..f9adb9aaed 100644 --- a/components/admin/docs/SOURCES/get_source.sh +++ b/components/admin/docs/SOURCES/get_source.sh @@ -1,33 +1,34 @@ #!/usr/bin/env bash -set -x +set -xe # Note: The current working directory is the component's SPEC folder OHPC_ROOT_FOLDER="../../../.." # The folder that will contain the .git/ and docs/ folders -DOCS_OHPC_FOLDER=docs-ohpc +DOCS_OHPC_FOLDER="docs-ohpc" cleanup() { - rm -rf ${DOCS_OHPC_FOLDER} - find ${OHPC_ROOT_FOLDER}/docs/recipes/install/ -name "vc.tex" -delete + rm -rf "${DOCS_OHPC_FOLDER}" + find "${OHPC_ROOT_FOLDER}/docs/recipes/install/" -name "vc.tex" -delete } trap cleanup EXIT # 1. Prepare cleanup -mkdir -p ${DOCS_OHPC_FOLDER} +mkdir -p "${DOCS_OHPC_FOLDER}" # 2. Copy the Git metadata -cp -r ${OHPC_ROOT_FOLDER}/.git ${DOCS_OHPC_FOLDER} +cp -r "${OHPC_ROOT_FOLDER}/.git" "${DOCS_OHPC_FOLDER}" # 3. Copy the local docs/ -cp -r ${OHPC_ROOT_FOLDER}/docs ${DOCS_OHPC_FOLDER} +cp -r "${OHPC_ROOT_FOLDER}/docs" "${DOCS_OHPC_FOLDER}" # 4. Add dummy vc.tex to the docs -for makefile in `find ${DOCS_OHPC_FOLDER}/docs/recipes/install/ -name "Makefile"`; do - folder=$(dirname ${makefile}) - cat <<'EOF' > ${folder}/vc.tex +find "${DOCS_OHPC_FOLDER}"/docs/recipes/install/ -name "Makefile" -print0 | while IFS= read -r -d '' makefile +do + folder=$(dirname "${makefile}") + cat <<'EOF' > "${folder}"/vc.tex %%% Define Git specific macros. \gdef\GITHash{5ffbf3e2ed0ed558c1ae5672f7e5023298b7c2a9}% \gdef\GITAbrHash{5ffbf3e}% @@ -55,4 +56,4 @@ EOF done # 5. Create docs-ohpc.tar -tar cf ../SOURCES/docs-ohpc.tar ${DOCS_OHPC_FOLDER} +tar cf ../SOURCES/docs-ohpc.tar "${DOCS_OHPC_FOLDER}" diff --git a/components/admin/test-suite/SOURCES/get_source.sh b/components/admin/test-suite/SOURCES/get_source.sh index d0bd95a62c..88b39d2421 100644 --- a/components/admin/test-suite/SOURCES/get_source.sh +++ b/components/admin/test-suite/SOURCES/get_source.sh @@ -9,16 +9,16 @@ OHPC_ROOT_FOLDER="../../../.." TESTS_OHPC_FOLDER=tests-ohpc cleanup() { - rm -rf ${TESTS_OHPC_FOLDER} + rm -rf "${TESTS_OHPC_FOLDER}" } trap cleanup EXIT # 1. Prepare cleanup -mkdir -p ${TESTS_OHPC_FOLDER} +mkdir -p "${TESTS_OHPC_FOLDER}" # 2. Copy the local docs/ -cp -r ${OHPC_ROOT_FOLDER}/tests ${TESTS_OHPC_FOLDER} +cp -r "${OHPC_ROOT_FOLDER}/tests" "${TESTS_OHPC_FOLDER}" # 3. Create tests-ohpc.tar -tar cf ../SOURCES/tests-ohpc.tar ${TESTS_OHPC_FOLDER} +tar cf ../SOURCES/tests-ohpc.tar "${TESTS_OHPC_FOLDER}" diff --git a/tests/ci/Makefile b/tests/ci/Makefile index a1fd8539ab..56fbd972a0 100644 --- a/tests/ci/Makefile +++ b/tests/ci/Makefile @@ -70,6 +70,8 @@ shellcheck-lint: ../../components/OHPC_setup_compiler \ ../../components/OHPC_setup_mpi \ ../../components/admin/prun/SOURCES/prun \ + ../../components/admin/docs/SOURCES/get_source.sh \ + ../../components/admin/test-suite/SOURCES/get_source.sh \ ../../components/rms/slurm/SOURCES/slurm.epilog.clean \ ../../tests/libs/netcdf/ohpc-tests/netcdf_all_test_mpi_families \ ../../tests/libs/netcdf/ohpc-tests/test_mpi_families