-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Update benchmark imports - Add bson-ext test to CI
- Loading branch information
Showing
11 changed files
with
267 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
[ -s "$PROJECT_DIRECTORY/node-artifacts/nvm/nvm.sh" ] && source "$PROJECT_DIRECTORY"/node-artifacts/nvm/nvm.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: | ||
# SSL Set to enable SSL. Defaults to "nossl" | ||
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) | ||
# TEST_NPM_SCRIPT Script to npm run. Defaults to "check:test" | ||
|
||
MONGODB_URI=${MONGODB_URI:-} | ||
TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-check:test} | ||
|
||
# ssl setup | ||
SSL=${SSL:-nossl} | ||
if [ "$SSL" != "nossl" ]; then | ||
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem" | ||
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem" | ||
fi | ||
|
||
# run tests | ||
echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI" | ||
|
||
npm install bson-ext | ||
|
||
export MONGODB_API_VERSION=${MONGODB_API_VERSION} | ||
export MONGODB_URI=${MONGODB_URI} | ||
|
||
npm run "${TEST_NPM_SCRIPT}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expectType } from 'tsd'; | ||
import type { BSONSerializeOptions, Document } from '../../src/bson'; | ||
|
||
const options: BSONSerializeOptions = {}; | ||
|
||
expectType<boolean | undefined>(options.checkKeys); | ||
expectType<boolean | undefined>(options.serializeFunctions); | ||
expectType<boolean | undefined>(options.ignoreUndefined); | ||
expectType<boolean | undefined>(options.promoteLongs); | ||
expectType<boolean | undefined>(options.promoteBuffers); | ||
expectType<boolean | undefined>(options.promoteValues); | ||
expectType<Document | undefined>(options.fieldsAsRaw); | ||
|
||
type PermittedBSONOptionKeys = | ||
| 'checkKeys' | ||
| 'serializeFunctions' | ||
| 'ignoreUndefined' | ||
| 'promoteLongs' | ||
| 'promoteBuffers' | ||
| 'promoteValues' | ||
| 'fieldsAsRaw' | ||
| 'raw'; | ||
|
||
const keys = (null as unknown) as PermittedBSONOptionKeys; | ||
// creates an explicit allow list assertion | ||
expectType<keyof BSONSerializeOptions>(keys); |
Oops, something went wrong.