Skip to content

Commit c6513c4

Browse files
authored
Supporting browser, integration and stress tests on testkit (#641)
Teskit doesn't run Neo4j on the localhost and with the same credentials of boltkit, but it exposes the host and credentials as env variables. So all this configuration being loaded to karma on the config files, parsed in `shared-neo4j` with fallback to the process env (case it's running the usual integration test) and to the default boltkit values. All the integration tests were changed to use the values from the shareNeo4j object. Disabled tests: * IPV6 tests are skipped on the testkit because of the lack of support for this * TLS tests are disabled since it's already tested on the testkit suite * Tests which depends on the enterprise edition of Neo4j is running only on this scenario
1 parent ae46eb4 commit c6513c4

26 files changed

+342
-138
lines changed

test/bolt-v3.test.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ describe('#integration Bolt V3 API', () => {
3737
let originalTimeout
3838

3939
beforeEach(async () => {
40-
driver = neo4j.driver('bolt://localhost', sharedNeo4j.authToken)
40+
driver = neo4j.driver(
41+
`bolt://${sharedNeo4j.hostname}`,
42+
sharedNeo4j.authToken
43+
)
4144
session = driver.session()
4245
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL
4346
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000
@@ -52,7 +55,7 @@ describe('#integration Bolt V3 API', () => {
5255
})
5356

5457
it('should set transaction metadata for auto-commit transaction', async () => {
55-
if (!databaseSupportsBoltV3()) {
58+
if (!databaseSupportsBoltV3() || !databaseSupportsListTransaction()) {
5659
return
5760
}
5861

@@ -144,7 +147,7 @@ describe('#integration Bolt V3 API', () => {
144147
))
145148

146149
it('should set transaction metadata for explicit transactions', async () => {
147-
if (!databaseSupportsBoltV3()) {
150+
if (!databaseSupportsBoltV3() || !databaseSupportsListTransaction()) {
148151
return
149152
}
150153

@@ -395,7 +398,7 @@ describe('#integration Bolt V3 API', () => {
395398
})
396399

397400
async function testTransactionMetadataWithTransactionFunctions (read) {
398-
if (!databaseSupportsBoltV3()) {
401+
if (!databaseSupportsBoltV3() || !databaseSupportsListTransaction()) {
399402
return
400403
}
401404

@@ -498,4 +501,8 @@ describe('#integration Bolt V3 API', () => {
498501
function databaseSupportsBoltV3 () {
499502
return protocolVersion >= 3
500503
}
504+
505+
function databaseSupportsListTransaction () {
506+
return sharedNeo4j.edition === 'enterprise'
507+
}
501508
})

test/bolt-v4x0.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ describe('#integration Bolt V4.0 API', () => {
2727
let originalTimeout
2828

2929
beforeEach(async () => {
30-
driver = neo4j.driver('bolt://localhost', sharedNeo4j.authToken)
30+
driver = neo4j.driver(
31+
`bolt://${sharedNeo4j.hostname}`,
32+
sharedNeo4j.authToken
33+
)
3134
session = driver.session()
3235
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL
3336
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000

test/browser/karma-chrome.conf.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ module.exports = function (config) {
4141
autoWatch: false,
4242
singleRun: true,
4343
concurrency: 1,
44-
browserNoActivityTimeout: 30 * 60 * 1000
44+
browserNoActivityTimeout: 30 * 60 * 1000,
45+
client: {
46+
env: process.env
47+
}
4548
})
4649
}

test/browser/karma-firefox.conf.js

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ module.exports = function (config) {
5050
'network.websocket.max-connections': 256 // as in Chrome
5151
}
5252
}
53+
},
54+
client: {
55+
env: process.env
5356
}
5457
})
5558
}

0 commit comments

Comments
 (0)