Skip to content

testkit-backend: Move all the skipTest to backend #701

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
Show file tree
Hide file tree
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
145 changes: 140 additions & 5 deletions bolt-connection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bolt-connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"@types/jest": "^26.0.20",
"jest": "^26.6.3",
"ts-jest": "^26.5.4",
"typescript": "^4.1.3"
},
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions neo4j-driver-lite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"test": "jest",
"test:watch": "jest --watch",
"test:it": "jest -c jest.integration.config.ts",
"test:it:browser": "jest -c jest.browser.config.ts",
"preinstall": "cd ../core && npm ci && npm run build && cd ../bolt-connection && npm ci && npm run build || true"
"test:it:browser": "jest -c jest.browser.config.ts"
},
"unpkg": "lib/browser/neo4j-lite-web.js",
"jsdelivr": "lib/browser/neo4j-lite-web.js",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"url": "git://github.com/neo4j/neo4j-javascript-driver.git"
},
"scripts": {
"preinstall": "cd core && npm ci && npm run build && cd ../bolt-connection && npm ci && npm run build || true",
"lint": "eslint --fix --ext .js ./",
"format": "prettier-eslint '**/*.js' '**/*.json' '**/*.md' '**/*.ts' '**/*.html' --write",
"test": "gulp test",
Expand Down
76 changes: 76 additions & 0 deletions testkit-backend/src/skipped-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@ function ifEndsWith (suffix) {
return testName => testName.endsWith(suffix)
}

function ifStartsWith (prefix) {
return testName => testName.startsWith(prefix)
}

function ifEquals (expectedName) {
return testName => testName === expectedName
}

function or () {
return testName => [...arguments].find(predicate => predicate(testName))
}

function skip (reason, predicate) {
return { reason, predicate }
}

const skippedTests = [
skip(
'Routing tests are disabled until the fix on the test scenario be merged',
or(ifStartsWith('stub.routing'), ifStartsWith('stub.retry.TestRetry'))
),
skip(
'Driver is failing trying to update the routing table using the original routing server',
ifEndsWith(
Expand All @@ -18,6 +34,66 @@ const skippedTests = [
ifEndsWith(
'test_should_successfully_check_if_support_for_multi_db_is_available'
)
),
skip(
'Driver should implement resolver',
or(
ifEndsWith(
'test_should_revert_to_initial_router_if_known_router_throws_protocol_errors'
),
ifEndsWith(
'test_should_use_resolver_during_rediscovery_when_existing_routers_fail'
)
)
),
skip(
'Test are not consuming the values inside the try catch',
or(
ifEndsWith('test_should_retry_read_tx_and_rediscovery_until_success'),
ifEndsWith('test_should_retry_write_tx_and_rediscovery_until_success'),
ifEndsWith('test_should_retry_write_tx_until_success'),
ifEndsWith(
'test_should_read_successfully_from_reachable_db_after_trying_unreachable_db'
),
ifEndsWith(
'test_should_retry_write_until_success_with_leader_shutdown_during_tx_using_tx_function'
)
)
),
skip(
'Requires investigation',
or(
ifEndsWith(
'test_should_fail_when_writing_without_explicit_consumption_on_writer_that_returns_not_a_leader_code'
),
ifEndsWith(
'test_should_fail_when_writing_on_unexpectedly_interrupting_writer_using_session_run'
),
ifEndsWith(
'test_should_fail_with_routing_failure_on_db_not_found_discovery_failure'
),
ifEndsWith(
'test_should_retry_write_until_success_with_leader_change_using_tx_function'
),
ifEndsWith(
'test_should_request_rt_from_all_initial_routers_until_successful'
),
ifEndsWith('test_should_pass_bookmark_from_tx_to_tx_using_tx_run'),
ifEndsWith('test_should_successfully_get_routing_table_with_context'),
ifStartsWith('stub.transport.Transport')
)
),
skip(
'Should implement result.consume',
ifEquals('neo4j.sessionrun.TestSessionRun.test_updates_last_bookmark')
),
skip(
'It could not guarantee the order of records requests between in the nested transactions',
ifEquals('stub.iteration.TxRun.test_nested')
),
skip(
'Keeps retrying on commit despite connection being dropped',
ifEquals('stub.retry.TestRetry.test_disconnect_on_commit')
)
]

Expand Down
2 changes: 2 additions & 0 deletions testkit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive
ENV NODE_OPTIONS --max_old_space_size=4096


RUN apt-get update && \
apt-get install -y \
Expand Down
8 changes: 4 additions & 4 deletions testkit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def run(args, env=None):


def build_core():
npm = ["npm", "--prefix", "core"]
npm = ["npm", "--prefix", "./core/"]
run(['rm', '-fr', 'core/node_modules', 'core/lib', 'core/types'])
run([*npm, 'ci'])
run([*npm, 'run', 'build'])


def build_bolt_connection():
npm = ['npm', '--prefix', 'bolt-connection']
npm = ['npm', '--prefix', './bolt-connection/']
run(['rm', '-fr', 'bolt-connection/node_modules', 'bolt-connection/lib'])
run([*npm, 'ci'])
run([*npm, 'run', 'build'])
Expand All @@ -33,14 +33,14 @@ def build_driver():


def build_driver_lite():
npm = ['npm', '--prefix', 'neo4j-driver-lite']
npm = ['npm', '--prefix', './neo4j-driver-lite/']
run(['rm', '-fr', 'neo4j-driver-lite/node_modules', 'neo4j-driver-lite/lib'])
run([*npm, "ci"])
run([*npm, "run", "build"])


def build_testkit_backend(isLite):
npm = ["npm", "--prefix", "testkit-backend"]
npm = ["npm", "--prefix", "./testkit-backend/"]
run(['rm', '-fr', 'testkit-backend/node_modules'])
run([*npm, "install"])
neo4jdriverPath = "neo4j@./"
Expand Down