Skip to content

Skip building tests when BUILD_TESTING=OFF#1139

Open
kevinAlbs wants to merge 2 commits intomongodb:masterfrom
kevinAlbs:do-not-build-tests
Open

Skip building tests when BUILD_TESTING=OFF#1139
kevinAlbs wants to merge 2 commits intomongodb:masterfrom
kevinAlbs:do-not-build-tests

Conversation

@kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Mar 20, 2026

Summary

Skip building tests when BUILD_TESTING=OFF

Background & Motivation

Attempting to update the C driver to use a newer libmongocrypt resulted in an error on Windows:

[2026/03/19 15:32:15.763] Command 'archive.targz_extract' in function 'fetch-build' (step 1.3 of 7) failed: extracting file '\data\mci\f53c\build.tar.gz': extracting path '\data\mci\f53c\mongoc': artifact path name 'libmongocrypt/cmake-build/mc-mlib.int128.test.dir/RelWithDebInfo/mc-mlib..227B0180.tlog/' should be relative to the root path: relative path starts with '..'.

The failure to untar a path with two dots is reported in DEVPROD-30287. The path being untarred is part of the test build. As a workaround, this PR skips building more test executables when BUILD_TESTING=OFF. With this PR applied, updating libmongocrypt the C driver succeeds to extract a produced tarball.

Intended to work around error untarring paths with two dots.
@kevinAlbs kevinAlbs marked this pull request as ready for review March 20, 2026 13:21
@kevinAlbs kevinAlbs requested a review from a team as a code owner March 20, 2026 13:21
Comment on lines +104 to +110
if [[ "${BUILD_TESTING:?}" =~ ^(0|OFF|NO|FALSE|n|off|no|false)$ ]]; then
echo "Skipping tests since BUILD_TESTING is false"
exit 0;
fi

_cmake_with_env --build "$BINARY_DIR" --target test-mongocrypt test_kms_request
run_chdir "$BINARY_DIR" run_ctest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, BUILD_TESTING=TRUE should add the test targets as default build targets, and this branch would be unnecessary. Is the branch required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants