From 17de6db2c1a76be6e18a8ab6b99fbfde39de7b80 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Sun, 12 May 2024 22:42:21 +0000 Subject: [PATCH] fix unit tests --- library_generation/test/generate_library_unit_tests.sh | 3 +++ library_generation/utils/utilities.sh | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/library_generation/test/generate_library_unit_tests.sh b/library_generation/test/generate_library_unit_tests.sh index e3833c478e..68d70b7d91 100755 --- a/library_generation/test/generate_library_unit_tests.sh +++ b/library_generation/test/generate_library_unit_tests.sh @@ -150,6 +150,9 @@ download_protoc_succeed_with_baked_protoc() { download_protoc "99.99" "linux-x86_64" assertFileOrDirectoryExists "${output_folder}/protoc-99.99" rm -rf "${output_folder}/protoc-99.99" + unset DOCKER_PROTOC_LOCATION + unset DOCKER_PROTOC_VERSION + rm -rdf $(get_output_folder) } download_grpc_plugin_succeed_with_valid_version_linux_test() { diff --git a/library_generation/utils/utilities.sh b/library_generation/utils/utilities.sh index b0edbeb25f..37e7ddc621 100755 --- a/library_generation/utils/utilities.sh +++ b/library_generation/utils/utilities.sh @@ -158,16 +158,18 @@ download_protoc() { local protoc_version=$1 local os_architecture=$2 - protoc_path="${output_folder}/protoc-${protoc_version}/bin" + protoc_dirname="protoc-${protoc_version}" + protoc_path="${output_folder}/${protoc_dirname}/bin" if [[ -f "${protoc_path}/protoc" ]]; then return fi - if [[ -n "${DOCKER_PROTOC_VERSION}" ]] \ - && [[ "${DOCKER_PROTOC_VERSION}" == "${protoc_version}" ]]; then + if [[ "${DOCKER_PROTOC_VERSION}" == "${protoc_version}" ]]; then # if the specified protoc_version matches the one baked in the docker # container, we just copy it into the output folder - cp -r "${DOCKER_PROTOC_LOCATION}/protoc-${protoc_version}" "${output_folder}" + mkdir -p "${output_folder}/${protoc_dirname}" + cp -r "${DOCKER_PROTOC_LOCATION}/${protoc_dirname}" \ + "${output_folder}" fi if [ ! -d "${protoc_path}" ]; then