-
Notifications
You must be signed in to change notification settings - Fork 106
Initial work to test mongodb-core on evergreen #287
Changes from all commits
dbf4a2f
3e9675e
a780fa6
3268a89
21afc38
e56a82c
08c395f
8386f0f
3142eb4
08839c3
2bc6ff0
eebada7
0d15e6a
b6b4632
27022d7
ccdc2d6
f3b2812
c467957
788fff8
e1619a1
6f9ed15
93ab85f
68fdaeb
679b6e4
3ad7edd
e8ec942
322d931
e321367
9bddb5e
ea2f171
5734e5a
3c545ba
4edfbb5
fab8a52
d0e72d5
873aeba
a3803de
129986b
89dfdbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
# set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
NODE_LTS_NAME=${NODE_LTS_NAME:-carbon} | ||
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" | ||
NPM_CACHE_DIR="${NODE_ARTIFACTS_PATH}/npm" | ||
NPM_TMP_DIR="${NODE_ARTIFATS_PATH}/tmp" | ||
|
||
# this needs to be explicitly exported for the nvm install below | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
|
||
# create node artifacts path if needed | ||
mkdir -p ${NODE_ARTIFACTS_PATH} | ||
mkdir -p ${NPM_CACHE_DIR} | ||
mkdir -p "${NPM_TMP_DIR}" | ||
|
||
# install Node.js | ||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash | ||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh" | ||
nvm install --lts=${NODE_LTS_NAME} | ||
|
||
# setup npm cache in a local directory | ||
cat <<EOT > .npmrc | ||
devdir=${NPM_CACHE_DIR}/.node-gyp | ||
init-module=${NPM_CACHE_DIR}/.npm-init.js | ||
cache=${NPM_CACHE_DIR} | ||
tmp=${NPM_TMP_DIR} | ||
EOT | ||
|
||
# install node dependencies | ||
npm install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
# Supported/used environment variables: | ||
# AUTH Set to enable authentication. Defaults to "noauth" | ||
# SSL Set to enable SSL. Defaults to "nossl" | ||
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) | ||
# MARCH Machine Architecture. Defaults to lowercase uname -m | ||
|
||
AUTH=${AUTH:-noauth} | ||
SSL=${SSL:-nossl} | ||
MONGODB_URI=${MONGODB_URI:-} | ||
DRIVERS_TOOLS=${DRIVERS_TOOLS:-} | ||
MONGODB_VERSION=${MONGODB_VERSION:-} | ||
|
||
# install MongoDB | ||
# Functions to fetch MongoDB binaries | ||
. ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh | ||
|
||
get_distro | ||
if [ -z "$MONGODB_DOWNLOAD_URL" ]; then | ||
get_mongodb_download_url_for "$DISTRO" "$MONGODB_VERSION" | ||
fi | ||
# Even though we have the MONGODB_DOWNLOAD_URL, we still call this to get the proper EXTRACT variable | ||
get_mongodb_download_url_for "$DISTRO" | ||
download_and_extract "$MONGODB_DOWNLOAD_URL" "$EXTRACT" | ||
|
||
# run tests | ||
echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI" | ||
|
||
export PATH="/opt/mongodbtoolchain/v2/bin:$PATH" | ||
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
MONGODB_VERSION=${MONGODB_VERSION} MONGODB_ENVIRONMENT=${TOPOLOGY} npm test -- --local |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ | |
const ConfigurationBase = require('mongodb-test-runner').ConfigurationBase; | ||
const f = require('util').format; | ||
|
||
const chai = require('chai'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we are adding these things in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually glad to have found this, we often have cases where we There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this sounds useful. Like I said above though, lets make sure it is a separate commit when we squash. |
||
chai.config.includeStack = true; | ||
chai.config.showDiff = true; | ||
chai.config.truncateThreshold = 0; | ||
|
||
// Configuration for mongodb-core | ||
class CoreConfiguration extends ConfigurationBase { | ||
constructor(options) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug that needs to be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually using this to determine when the pool was destroyed, before I opted to use connection spies. It's a harmless addition, but adds flexibility to the design (it's a no-op if nobody is listening) so I'd opt for keeping it in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make sure that when we squash, this is a separate commit so we can track it.