Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed May 12, 2024
1 parent 358be32 commit 17de6db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions library_generation/test/generate_library_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 6 additions & 4 deletions library_generation/utils/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 17de6db

Please sign in to comment.