Skip to content

Commit 1c096fb

Browse files
committed
CDRIVER-2875 test CSE in evergreen
1 parent 73616c3 commit 1c096fb

16 files changed

+801
-75
lines changed

.evergreen/abi-compliance-check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mkdir abi-compliance/latest-release-install
99
mkdir abi-compliance/dumps
1010

1111
# build the current changes
12-
export SKIP_TESTS=ON
12+
export SKIP_MOCK_TESTS=ON
1313
export EXTRA_CONFIGURE_FLAGS="-DCMAKE_INSTALL_PREFIX=./abi-compliance/changes-install -DCMAKE_C_FLAGS=-g -Og"
1414
python build/calc_release_version.py > VERSION_CURRENT
1515
python build/calc_release_version.py -p > VERSION_RELEASED
@@ -23,7 +23,7 @@ current=`cat VERSION_CURRENT`
2323
git checkout tags/$newest -f
2424

2525
# build the newest release
26-
export SKIP_TESTS=ON
26+
export SKIP_MOCK_TESTS=ON
2727
export EXTRA_CONFIGURE_FLAGS="-DCMAKE_INSTALL_PREFIX=./abi-compliance/latest-release-install -DCMAKE_C_FLAGS=-g -Og"
2828
sh .evergreen/compile.sh
2929
make install

.evergreen/add-build-dirs-to-paths.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ set_path ()
77
cygwin*)
88
export PATH=$PATH:`pwd`/src/libbson/Debug
99
export PATH=$PATH:`pwd`/src/libbson/Release
10+
export PATH=$PATH:`pwd`/install-dir/bin
1011
chmod +x src/libmongoc/Debug/* src/libbson/Debug/* || true
1112
chmod +x src/libmongoc/Release/* src/libbson/Release/* || true
13+
chmod +x `pwd`/install-dir/bin/* || true
1214
;;
1315

1416
darwin)
15-
export DYLD_LIBRARY_PATH=".:install-dir/lib:src/libbson:src/libmongoc:$EXTRA_LIB_PATH:$DYLD_LIBRARY_PATH"
17+
export DYLD_LIBRARY_PATH=".:install-dir/lib:install-dir/lib64:src/libbson:src/libmongoc:$EXTRA_LIB_PATH:$DYLD_LIBRARY_PATH"
1618
;;
1719

1820
*)
19-
export LD_LIBRARY_PATH=".:install-dir/lib:src/libbson:src/libmongoc:$EXTRA_LIB_PATH:$LD_LIBRARY_PATH"
21+
export LD_LIBRARY_PATH=".:install-dir/lib:install-dir/lib64:src/libbson:src/libmongoc:$EXTRA_LIB_PATH:$LD_LIBRARY_PATH"
2022
;;
2123
esac
2224

.evergreen/compile-unix.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set -o errexit # Exit the script with error if any of the commands fail
1414
# ANALYZE Run the build through clangs scan-build
1515
# COVERAGE Produce code coverage reports
1616
# RDTSCP Use Intel RDTSCP instruction
17-
# SKIP_TESTS Skips running the libmongoc tests after compiling
17+
# SKIP_MOCK_TESTS Skips running the libmongoc mock server tests after compiling
1818
# Options for CMake:
1919
# LIBBSON Build against bundled or external libbson
2020
# EXTRA_CONFIGURE_FLAGS Extra configure flags to use
@@ -33,7 +33,7 @@ VALGRIND=${VALGRIND:-OFF}
3333
ANALYZE=${ANALYZE:-OFF}
3434
COVERAGE=${COVERAGE:-OFF}
3535
RDTSCP=${RDTSCP:-OFF}
36-
SKIP_TESTS=${SKIP_TESTS:-OFF}
36+
SKIP_MOCK_TESTS=${SKIP_MOCK_TESTS:-OFF}
3737
ENABLE_SHM_COUNTERS=${ENABLE_SHM_COUNTERS:-AUTO}
3838

3939
# CMake options.
@@ -52,7 +52,7 @@ echo "VALGRIND: $VALGRIND"
5252
echo "CC: $CC"
5353
echo "ANALYZE: $ANALYZE"
5454
echo "COVERAGE: $COVERAGE"
55-
echo "SKIP_TESTS: $SKIP_TESTS"
55+
echo "SKIP_MOCK_TESTS: $SKIP_MOCK_TESTS"
5656
echo "ZLIB: $ZLIB"
5757

5858
# Get the kernel name, lowercased
@@ -188,6 +188,16 @@ export PATH=$INSTALL_DIR/bin:$PATH
188188
echo "OpenSSL Version:"
189189
pkg-config --modversion libssl || true
190190

191+
if [ "$COMPILE_LIBMONGOCRYPT" = "ON" ]; then
192+
# Build libmongocrypt, using the previously fetched installed source.
193+
git clone https://github.com/mongodb/libmongocrypt
194+
mkdir libmongocrypt/cmake-build
195+
cd libmongocrypt/cmake-build
196+
$CMAKE -DENABLE_SHARED_BSON=ON -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_PREFIX_PATH="$INSTALL_DIR" ../
197+
make install
198+
cd ../../
199+
fi
200+
191201
if [ "$ANALYZE" = "ON" ]; then
192202
# Clang static analyzer, available on Ubuntu 16.04 images.
193203
# https://clang-analyzer.llvm.org/scan-build.html
@@ -210,9 +220,12 @@ openssl md5 README.rst || true
210220

211221
ulimit -c unlimited || true
212222

223+
if [ "$ANALYZE" != "ON" ]; then
224+
make -j8 install
225+
fi
213226

214227
# We are done here if we don't want to run the tests.
215-
if [ "$SKIP_TESTS" = "ON" ]; then
228+
if [ "$SKIP_MOCK_TESTS" = "ON" ]; then
216229
exit 0
217230
fi
218231

@@ -248,6 +261,7 @@ if [ -s error.log ]; then
248261
grep -v "^ar: " error.log > log.log
249262
if [ -s log.log ]; then
250263
cat error.log
264+
echo "Found unexpected error logs"
251265
# Mark build as failed if there is unknown things in the log
252266
exit 2
253267
fi

.evergreen/compile-windows.sh

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ set -o xtrace # Write all commands first to stderr
44
set -o errexit # Exit the script with error if any of the commands fail
55

66
# Supported/used environment variables:
7-
# CC Which compiler to use
8-
# SSL OPENSSL, WINDOWS, or OFF
9-
# SASL AUTO, SSPI, CYRUS, or OFF
10-
# SRV Whether to enable SRV: ON or OFF
11-
# RELEASE Enable release-build MSVC flags (default: debug flags)
7+
# CC Which compiler to use
8+
# SSL OPENSSL, WINDOWS, or OFF
9+
# SASL AUTO, SSPI, CYRUS, or OFF
10+
# SRV Whether to enable SRV: ON or OFF
11+
# RELEASE Enable release-build MSVC flags (default: debug flags)
12+
# SKIP_MOCK_TESTS Skips running the libmongoc mock server tests after compiling
1213

1314

14-
INSTALL_DIR="C:/mongoc"
15+
INSTALL_DIR="$(cygpath -a ./install-dir -w)"
1516
CONFIGURE_FLAGS="\
1617
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
1718
-DCMAKE_PREFIX_PATH=${INSTALL_DIR} \
@@ -119,12 +120,22 @@ esac
119120
if [ "$RELEASE" ]; then
120121
BUILD_FLAGS="$BUILD_FLAGS /p:Configuration=RelWithDebInfo"
121122
TEST_PATH="./src/libmongoc/RelWithDebInfo/test-libmongoc.exe"
122-
export PATH=$PATH:`pwd`/src/libbson/RelWithDebInfo:`pwd`/src/libmongoc/RelWithDebInfo
123+
export PATH=$PATH:`pwd`/src/libbson/RelWithDebInfo:`pwd`/src/libmongoc/RelWithDebInfo:`pwd`/install-dir/bin
123124
else
124125
CONFIGURE_FLAGS="$CONFIGURE_FLAGS"
125126
BUILD_FLAGS="$BUILD_FLAGS /p:Configuration=Debug"
126127
TEST_PATH="./src/libmongoc/Debug/test-libmongoc.exe"
127-
export PATH=$PATH:`pwd`/src/libbson/Debug:`pwd`/src/libmongoc/Debug
128+
export PATH=$PATH:`pwd`/src/libbson/Debug:`pwd`/src/libmongoc/Debug:`pwd`/install-dir/bin
129+
fi
130+
131+
if [ "$COMPILE_LIBMONGOCRYPT" = "ON" ]; then
132+
# Build libmongocrypt, using the previously fetched installed source.
133+
git clone https://github.com/mongodb/libmongocrypt
134+
mkdir libmongocrypt/cmake-build
135+
cd libmongocrypt/cmake-build
136+
"$CMAKE" -G "$CC" "-DCMAKE_PREFIX_PATH=${INSTALL_DIR}/lib/cmake" -DENABLE_SHARED_BSON=ON -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" ../
137+
"$BUILD" $BUILD_FLAGS INSTALL.vcxproj
138+
cd ../../
128139
fi
129140

130141
"$CMAKE" -G "$CC" "-DCMAKE_PREFIX_PATH=${INSTALL_DIR}/lib/cmake" $CONFIGURE_FLAGS
@@ -134,4 +145,10 @@ fi
134145
export MONGOC_TEST_FUTURE_TIMEOUT_MS=30000
135146
export MONGOC_TEST_SKIP_LIVE=on
136147
export MONGOC_TEST_SKIP_SLOW=on
148+
149+
# We are done here if we don't want to run the tests.
150+
if [ "$SKIP_MOCK_TESTS" = "ON" ]; then
151+
exit 0
152+
fi
153+
137154
"$TEST_PATH" --no-fork -d -F test-results.json

0 commit comments

Comments
 (0)