-
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.
test: adds tests for atlas data lake
- Loading branch information
Thomas Reggi
authored
Oct 19, 2020
1 parent
3155bcc
commit 2704ce8
Showing
23 changed files
with
626 additions
and
28 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,11 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
export PROJECT_DIRECTORY="$(pwd)" | ||
NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" | ||
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
|
||
echo $MONGODB_URI; | ||
npm run check:adl |
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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
'use strict'; | ||
|
||
function resolveConnectionString(configuration, spec) { | ||
function resolveConnectionString(configuration, spec, context) { | ||
const isShardedEnvironment = configuration.topologyType === 'Sharded'; | ||
const useMultipleMongoses = spec && !!spec.useMultipleMongoses; | ||
|
||
return isShardedEnvironment && !useMultipleMongoses | ||
? `mongodb://${configuration.host}:${configuration.port}/${configuration.db}?directConnection=false` | ||
: configuration.url(); | ||
const user = context && context.user; | ||
const password = context && context.password; | ||
const connectionString = | ||
isShardedEnvironment && !useMultipleMongoses | ||
? `mongodb://${configuration.host}:${configuration.port}/${configuration.db}?directConnection=false` | ||
: configuration.url(user, password); | ||
return connectionString; | ||
} | ||
|
||
module.exports = { resolveConnectionString }; |
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,73 @@ | ||
'use strict'; | ||
const { expect } = require('chai'); | ||
const path = require('path'); | ||
const { TestRunnerContext } = require('../functional/spec-runner'); | ||
const { gatherTestSuites } = require('../functional/spec-runner'); | ||
const { generateTopologyTests } = require('../functional/spec-runner'); | ||
const { withClient } = require('../functional/shared'); | ||
|
||
describe('Atlas Data Lake', function () { | ||
context('spec tests', function () { | ||
const testContext = new TestRunnerContext({ | ||
skipPrepareDatabase: true, | ||
useSessions: false, | ||
user: 'mhuser', | ||
password: 'pencil' | ||
}); | ||
|
||
let testSuites = gatherTestSuites(path.resolve(__dirname, '../spec/atlas-data-lake-testing')); | ||
|
||
after(() => testContext.teardown()); | ||
before(function () { | ||
return testContext.setup(this.configuration); | ||
}); | ||
|
||
generateTopologyTests(testSuites, testContext); | ||
}); | ||
|
||
describe('prose Tests', function () { | ||
it( | ||
'should properly constructs and issues a killCursors command', | ||
withClient('mongodb://mhuser:pencil@localhost', function (client, done) { | ||
const db = client.db('admin'); | ||
db.command({ killCursors: 'kill_cursor_collection' }, err => { | ||
expect(err).to.not.exist; | ||
done(); | ||
}); | ||
}) | ||
); | ||
it( | ||
'should connect without authentication', | ||
withClient('mongodb://localhost', function (client, done) { | ||
expect(client).to.exist; | ||
done(); | ||
}) | ||
); | ||
it( | ||
'should connect with auth SCRAM-SHA-1', | ||
withClient('mongodb://mhuser:pencil@localhost?authMechanism=SCRAM-SHA-1', function ( | ||
client, | ||
done | ||
) { | ||
const db = client.db('admin'); | ||
db.command({ killCursors: 'kill_cursor_collection' }, err => { | ||
expect(err).to.not.exist; | ||
done(); | ||
}); | ||
}) | ||
); | ||
it( | ||
'should connect with auth SCRAM-SHA-256', | ||
withClient('mongodb://mhuser:pencil@localhost?authMechanism=SCRAM-SHA-256', function ( | ||
client, | ||
done | ||
) { | ||
const db = client.db('admin'); | ||
db.command({ killCursors: 'kill_cursor_collection' }, err => { | ||
expect(err).to.not.exist; | ||
done(); | ||
}); | ||
}) | ||
); | ||
}); | ||
}); |
Oops, something went wrong.