Skip to content

Commit dd1beb3

Browse files
authored
testkit-backend: Move all the skipTest to backend (#701)
The goal of this changes is make all driver specific code part of the driver repository.
1 parent 028c500 commit dd1beb3

File tree

7 files changed

+224
-12
lines changed

7 files changed

+224
-12
lines changed

bolt-connection/package-lock.json

Lines changed: 140 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bolt-connection/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"devDependencies": {
3131
"@types/jest": "^26.0.20",
3232
"jest": "^26.6.3",
33+
"ts-jest": "^26.5.4",
3334
"typescript": "^4.1.3"
3435
},
3536
"dependencies": {

neo4j-driver-lite/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"test": "jest",
1111
"test:watch": "jest --watch",
1212
"test:it": "jest -c jest.integration.config.ts",
13-
"test:it:browser": "jest -c jest.browser.config.ts",
14-
"preinstall": "cd ../core && npm ci && npm run build && cd ../bolt-connection && npm ci && npm run build || true"
13+
"test:it:browser": "jest -c jest.browser.config.ts"
1514
},
1615
"unpkg": "lib/browser/neo4j-lite-web.js",
1716
"jsdelivr": "lib/browser/neo4j-lite-web.js",

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"url": "git://github.com/neo4j/neo4j-javascript-driver.git"
1010
},
1111
"scripts": {
12-
"preinstall": "cd core && npm ci && npm run build && cd ../bolt-connection && npm ci && npm run build || true",
1312
"lint": "eslint --fix --ext .js ./",
1413
"format": "prettier-eslint '**/*.js' '**/*.json' '**/*.md' '**/*.ts' '**/*.html' --write",
1514
"test": "gulp test",

testkit-backend/src/skipped-tests.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,27 @@ function ifEndsWith (suffix) {
22
return testName => testName.endsWith(suffix)
33
}
44

5+
function ifStartsWith (prefix) {
6+
return testName => testName.startsWith(prefix)
7+
}
8+
9+
function ifEquals (expectedName) {
10+
return testName => testName === expectedName
11+
}
12+
13+
function or () {
14+
return testName => [...arguments].find(predicate => predicate(testName))
15+
}
16+
517
function skip (reason, predicate) {
618
return { reason, predicate }
719
}
820

921
const skippedTests = [
22+
skip(
23+
'Routing tests are disabled until the fix on the test scenario be merged',
24+
or(ifStartsWith('stub.routing'), ifStartsWith('stub.retry.TestRetry'))
25+
),
1026
skip(
1127
'Driver is failing trying to update the routing table using the original routing server',
1228
ifEndsWith(
@@ -18,6 +34,66 @@ const skippedTests = [
1834
ifEndsWith(
1935
'test_should_successfully_check_if_support_for_multi_db_is_available'
2036
)
37+
),
38+
skip(
39+
'Driver should implement resolver',
40+
or(
41+
ifEndsWith(
42+
'test_should_revert_to_initial_router_if_known_router_throws_protocol_errors'
43+
),
44+
ifEndsWith(
45+
'test_should_use_resolver_during_rediscovery_when_existing_routers_fail'
46+
)
47+
)
48+
),
49+
skip(
50+
'Test are not consuming the values inside the try catch',
51+
or(
52+
ifEndsWith('test_should_retry_read_tx_and_rediscovery_until_success'),
53+
ifEndsWith('test_should_retry_write_tx_and_rediscovery_until_success'),
54+
ifEndsWith('test_should_retry_write_tx_until_success'),
55+
ifEndsWith(
56+
'test_should_read_successfully_from_reachable_db_after_trying_unreachable_db'
57+
),
58+
ifEndsWith(
59+
'test_should_retry_write_until_success_with_leader_shutdown_during_tx_using_tx_function'
60+
)
61+
)
62+
),
63+
skip(
64+
'Requires investigation',
65+
or(
66+
ifEndsWith(
67+
'test_should_fail_when_writing_without_explicit_consumption_on_writer_that_returns_not_a_leader_code'
68+
),
69+
ifEndsWith(
70+
'test_should_fail_when_writing_on_unexpectedly_interrupting_writer_using_session_run'
71+
),
72+
ifEndsWith(
73+
'test_should_fail_with_routing_failure_on_db_not_found_discovery_failure'
74+
),
75+
ifEndsWith(
76+
'test_should_retry_write_until_success_with_leader_change_using_tx_function'
77+
),
78+
ifEndsWith(
79+
'test_should_request_rt_from_all_initial_routers_until_successful'
80+
),
81+
ifEndsWith('test_should_pass_bookmark_from_tx_to_tx_using_tx_run'),
82+
ifEndsWith('test_should_successfully_get_routing_table_with_context'),
83+
ifStartsWith('stub.transport.Transport')
84+
)
85+
),
86+
skip(
87+
'Should implement result.consume',
88+
ifEquals('neo4j.sessionrun.TestSessionRun.test_updates_last_bookmark')
89+
),
90+
skip(
91+
'It could not guarantee the order of records requests between in the nested transactions',
92+
ifEquals('stub.iteration.TxRun.test_nested')
93+
),
94+
skip(
95+
'Keeps retrying on commit despite connection being dropped',
96+
ifEquals('stub.retry.TestRetry.test_disconnect_on_commit')
2197
)
2298
]
2399

testkit/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
FROM ubuntu:20.04
22

33
ENV DEBIAN_FRONTEND noninteractive
4+
ENV NODE_OPTIONS --max_old_space_size=4096
5+
46

57
RUN apt-get update && \
68
apt-get install -y \

testkit/build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ def run(args, env=None):
1313

1414

1515
def build_core():
16-
npm = ["npm", "--prefix", "core"]
16+
npm = ["npm", "--prefix", "./core/"]
1717
run(['rm', '-fr', 'core/node_modules', 'core/lib', 'core/types'])
1818
run([*npm, 'ci'])
1919
run([*npm, 'run', 'build'])
2020

2121

2222
def build_bolt_connection():
23-
npm = ['npm', '--prefix', 'bolt-connection']
23+
npm = ['npm', '--prefix', './bolt-connection/']
2424
run(['rm', '-fr', 'bolt-connection/node_modules', 'bolt-connection/lib'])
2525
run([*npm, 'ci'])
2626
run([*npm, 'run', 'build'])
@@ -33,14 +33,14 @@ def build_driver():
3333

3434

3535
def build_driver_lite():
36-
npm = ['npm', '--prefix', 'neo4j-driver-lite']
36+
npm = ['npm', '--prefix', './neo4j-driver-lite/']
3737
run(['rm', '-fr', 'neo4j-driver-lite/node_modules', 'neo4j-driver-lite/lib'])
3838
run([*npm, "ci"])
3939
run([*npm, "run", "build"])
4040

4141

4242
def build_testkit_backend(isLite):
43-
npm = ["npm", "--prefix", "testkit-backend"]
43+
npm = ["npm", "--prefix", "./testkit-backend/"]
4444
run(['rm', '-fr', 'testkit-backend/node_modules'])
4545
run([*npm, "install"])
4646
neo4jdriverPath = "neo4j@./"

0 commit comments

Comments
 (0)