Skip to content

Commit

Permalink
fix(test): Use current branch in the clang test
Browse files Browse the repository at this point in the history
The previous test ran always in the dev branch. Therefore, new issues
were not detected until merged to dev.

Signed-off-by: Crash <[email protected]>

Co-authored-by: guillex <[email protected]>
  • Loading branch information
ralcolea and lgsilva3087 committed Jan 22, 2025
1 parent b12f4f6 commit 4a8dcfa
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/test_suites/LongSystemTests/test_build_saunafs_using_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@ timeout_set 20 minutes
assert_program_installed git
assert_program_installed cmake
assert_program_installed make
assert_program_installed clang
assert_program_installed clang++-19

MINIMUM_PARALLEL_JOBS=4
MAXIMUM_PARALLEL_JOBS=16
PARALLEL_JOBS=$(get_nproc_clamped_between ${MINIMUM_PARALLEL_JOBS} ${MAXIMUM_PARALLEL_JOBS})

# Clone the repository
git clone --branch dev https://github.com/leil-io/saunafs.git "${TEMP_DIR}/saunafs"
git config --global --add safe.directory ${SOURCE_DIR}

# Change to the temporary directory
cd "${TEMP_DIR}/saunafs"
NEW_SOURCE_DIR="/tmp/saunafs"
mkdir -p "${NEW_SOURCE_DIR}"

# Check if the feature branch exists and check it out if it does
feature_branch="build-saunafs-using-clang"
if git ls-remote --heads origin "${feature_branch}" | \
grep -q "${feature_branch}"; then
git checkout "${feature_branch}"
fi
# Clone the repository to a new folder to bypass permission issues
git clone "${SOURCE_DIR}" "${NEW_SOURCE_DIR}"

assert_success cmake -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo \
# Change to the new directory
cd "${NEW_SOURCE_DIR}"

assert_success cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++-19 \
-DENABLE_TESTS=ON -DENABLE_NFS_GANESHA=ON -DENABLE_CLIENT_LIB=ON
assert_success make -C ./build -j${PARALLEL_JOBS}
assert_success cmake --build build -j${PARALLEL_JOBS}

0 comments on commit 4a8dcfa

Please sign in to comment.