Skip to content

testkit-backend: add support to CheckMultiDBSupport #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions testkit-backend/src/request-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ export function StartTest (_, { testName }, wire) {
const reason =
'Driver is failing trying to update the original routing server'
wire.writeResponse('SkipTest', { reason })
} else if (
testName.endsWith(
'test_should_successfully_check_if_support_for_multi_db_is_available'
)
) {
console.warn(`>>> Skipping test ${testName}`)
const reason =
'Driver is creating a dedicated connection to check the MultiDBSupport'
wire.writeResponse('SkipTest', { reason })
} else {
console.log(`>>> Starting test ${testName}`)
wire.writeResponse('RunTest', null)
Expand All @@ -236,3 +245,13 @@ export function VerifyConnectivity (context, { driverId }, wire) {
.then(() => wire.writeResponse('Driver', { id: driverId }))
.catch(error => wire.writeError(error))
}

export function CheckMultiDBSupport (context, { driverId }, wire) {
const driver = context.getDriver(driverId)
driver
.supportsMultiDb()
.then(available =>
wire.writeResponse('MultiDBSupport', { id: driverId, available })
)
.catch(error => wire.writeError(error))
}