2023-08-03 09:55:06 +00:00
|
|
|
[tasks.ci-format]
|
|
|
|
category = "CI - CHECK"
|
|
|
|
dependencies = ["cargo-fmt", "cargo-fmt-unlinked"]
|
|
|
|
|
|
|
|
[tasks.ci-check]
|
|
|
|
category = "CI - CHECK"
|
|
|
|
command = "cargo"
|
|
|
|
args = ["check", "--locked", "--workspace"]
|
|
|
|
|
|
|
|
[tasks.ci-check-wasm]
|
|
|
|
category = "CI - CHECK"
|
|
|
|
command = "cargo"
|
|
|
|
args = ["check", "--locked", "--package", "surrealdb", "--features", "protocol-ws,protocol-http,kv-mem,kv-indxdb,http", "--target", "wasm32-unknown-unknown"]
|
|
|
|
|
|
|
|
[tasks.ci-clippy]
|
|
|
|
category = "CI - CHECK"
|
|
|
|
command = "cargo"
|
2023-12-19 08:56:24 +00:00
|
|
|
args = ["clippy", "--all-targets", "--features", "storage-mem,storage-rocksdb,storage-speedb,storage-tikv,storage-fdb,scripting,http", "--tests", "--benches", "--examples","--bins", "--", "-D", "warnings"]
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Integration Tests
|
|
|
|
#
|
|
|
|
|
|
|
|
[tasks.ci-cli-integration]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
2023-08-23 19:26:31 +00:00
|
|
|
env = { RUST_LOG={ value = "cli_integration=debug", condition = { env_not_set = ["RUST_LOG"] } } }
|
|
|
|
args = ["test", "--locked", "--no-default-features", "--features", "storage-mem,http,scripting", "--workspace", "--test", "cli_integration", "--", "cli_integration", "--nocapture"]
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
[tasks.ci-http-integration]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
2023-08-23 19:26:31 +00:00
|
|
|
env = { RUST_LOG={ value = "http_integration=debug", condition = { env_not_set = ["RUST_LOG"] } } }
|
2023-11-01 13:58:20 +00:00
|
|
|
args = ["test", "--locked", "--no-default-features", "--features", "storage-mem,http-compression", "--workspace", "--test", "http_integration", "--", "http_integration", "--nocapture"]
|
2023-08-14 15:36:27 +00:00
|
|
|
|
|
|
|
[tasks.ci-ws-integration]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
2023-08-23 19:26:31 +00:00
|
|
|
env = { RUST_LOG={ value = "ws_integration=debug", condition = { env_not_set = ["RUST_LOG"] } } }
|
|
|
|
args = ["test", "--locked", "--no-default-features", "--features", "storage-mem", "--workspace", "--test", "ws_integration", "--", "ws_integration", "--nocapture"]
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-12 13:51:43 +00:00
|
|
|
[tasks.ci-ml-integration]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
|
|
|
env = { RUST_LOG={ value = "cli_integration::common=debug", condition = { env_not_set = ["RUST_LOG"] } } }
|
|
|
|
args = ["test", "--locked", "--features", "storage-mem,ml", "--workspace", "--test", "ml_integration", "--", "ml_integration", "--nocapture"]
|
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
[tasks.ci-workspace-coverage]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"llvm-cov", "--html", "--locked", "--no-default-features", "--features", "storage-mem,scripting,http", "--workspace", "--",
|
|
|
|
"--skip", "api_integration",
|
|
|
|
"--skip", "cli_integration",
|
|
|
|
"--skip", "http_integration",
|
|
|
|
"--skip", "ws_integration"
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.test-workspace-coverage-complete]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
command = "cargo"
|
|
|
|
args = ["llvm-cov", "--html", "--locked", "--no-default-features", "--features", "protocol-ws,protocol-http,kv-mem,kv-rocksdb", "--workspace"]
|
|
|
|
|
|
|
|
[tasks.ci-workspace-coverage-complete]
|
|
|
|
env = { _START_SURREALDB_PATH = "memory" }
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
run_task = { name = ["start-surrealdb", "test-workspace-coverage-complete", "stop-surrealdb"], fork = true }
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tests private tasks
|
|
|
|
#
|
|
|
|
|
|
|
|
[tasks.test-kvs]
|
|
|
|
private = true
|
|
|
|
command = "cargo"
|
|
|
|
args = ["test", "--locked", "--package", "surrealdb", "--no-default-features", "--features", "${_TEST_FEATURES}", "--lib", "kvs"]
|
|
|
|
|
|
|
|
|
|
|
|
[tasks.test-api-integration]
|
|
|
|
private = true
|
|
|
|
command = "cargo"
|
|
|
|
args = ["test", "--locked", "--package", "surrealdb", "--no-default-features", "--features", "${_TEST_FEATURES}", "--test", "api", "api_integration::${_TEST_API_ENGINE}"]
|
|
|
|
|
|
|
|
[tasks.ci-api-integration]
|
2023-11-13 17:19:47 +00:00
|
|
|
env = { _START_SURREALDB_PATH = "memory" }
|
2023-08-03 09:55:06 +00:00
|
|
|
private = true
|
|
|
|
run_task = { name = ["start-surrealdb", "test-api-integration", "stop-surrealdb"], fork = true }
|
|
|
|
|
|
|
|
#
|
|
|
|
# Integration tests with background services
|
|
|
|
#
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-http]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "http", _TEST_FEATURES = "protocol-http" }
|
|
|
|
run_task = "ci-api-integration"
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-ws]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "ws", _TEST_FEATURES = "protocol-ws" }
|
|
|
|
run_task = "ci-api-integration"
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-any]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "any", _TEST_FEATURES = "protocol-http" }
|
|
|
|
run_task = "ci-api-integration"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Integration tests without background services
|
|
|
|
#
|
|
|
|
[tasks.ci-api-integration-mem]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "mem", _TEST_FEATURES = "kv-mem" }
|
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = true }
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-file]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "file", _TEST_FEATURES = "kv-rocksdb" }
|
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = true }
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-rocksdb]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "rocksdb", _TEST_FEATURES = "kv-rocksdb" }
|
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = true }
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-speedb]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "speedb", _TEST_FEATURES = "kv-speedb" }
|
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = true }
|
|
|
|
|
|
|
|
[tasks.ci-api-integration-fdb]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "fdb", _TEST_FEATURES = "kv-fdb-7_1" }
|
2023-08-11 11:50:48 +00:00
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = false }
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
[tasks.ci-api-integration-tikv-tests]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
env = { _TEST_API_ENGINE = "tikv", _TEST_FEATURES = "kv-tikv" }
|
2023-08-11 11:50:48 +00:00
|
|
|
run_task = { name = ["test-kvs", "test-api-integration"], fork = true, parallel = false }
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
[tasks.ci-api-integration-tikv]
|
|
|
|
category = "CI - INTEGRATION TESTS"
|
|
|
|
run_task = { name = ["start-tikv", "ci-api-integration-tikv-tests", "stop-tikv"], fork = true }
|
|
|
|
|
|
|
|
#
|
|
|
|
# Services
|
|
|
|
#
|
|
|
|
[tasks.start-surrealdb]
|
|
|
|
category = "CI - SERVICES"
|
|
|
|
dependencies = ["build-surrealdb"]
|
|
|
|
script = """
|
2023-12-04 10:24:44 +00:00
|
|
|
#!/bin/bash -ex
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
target/debug/surreal start ${_START_SURREALDB_PATH} --allow-all &>/tmp/surrealdb-${_TEST_API_ENGINE}.log &
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
echo $! > /tmp/surreal-${_TEST_API_ENGINE}.pid
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
set +e
|
|
|
|
echo "Waiting for surreal to be ready..."
|
|
|
|
tries=0
|
|
|
|
while [[ $tries < 5 ]]; do
|
|
|
|
target/debug/surreal is-ready 2>/dev/null && echo "Ready!" && exit 0 || sleep 1
|
|
|
|
tries=$((tries + 1))
|
|
|
|
done
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
echo "ERROR: Surreal is unhealthy!"
|
|
|
|
exit 1
|
2023-08-03 09:55:06 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.stop-surrealdb]
|
|
|
|
category = "CI - SERVICES"
|
2023-08-18 07:16:13 +00:00
|
|
|
script = """
|
2023-12-04 10:24:44 +00:00
|
|
|
kill $(cat /tmp/surreal-${_TEST_API_ENGINE}.pid) || true
|
|
|
|
sleep 5
|
|
|
|
kill -9 $(cat /tmp/surreal-${_TEST_API_ENGINE}.pid) || true
|
2023-08-18 07:16:13 +00:00
|
|
|
"""
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
[tasks.start-tikv]
|
|
|
|
category = "CI - SERVICES"
|
|
|
|
script = """
|
2023-12-04 10:24:44 +00:00
|
|
|
#!/bin/bash -ex
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
${HOME}/.tiup/bin/tiup install pd tikv playground
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
playground_attempts=0
|
|
|
|
while [[ $playground_attempts < 5 ]]; do
|
|
|
|
nohup ${HOME}/.tiup/bin/tiup playground --mode tikv-slim --kv 3 --without-monitor > /tmp/tiup.log &
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
echo $! > /tmp/tiup.pid
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
set +e
|
|
|
|
echo "Waiting for tiup playground to be ready..."
|
|
|
|
tries=0
|
|
|
|
while [[ $tries < 10 ]]; do
|
|
|
|
${HOME}/.tiup/bin/tiup playground display >/dev/null && echo "Ready!" && exit 0 || sleep 5
|
|
|
|
tries=$((tries + 1))
|
|
|
|
done
|
|
|
|
set -e
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
echo "ERROR: TiUP Playground is unhealthy! Try again..."
|
|
|
|
kill $(cat /tmp/tiup.pid) || true
|
|
|
|
|
|
|
|
playground_attempts=$((playground_attempts + 1))
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "PANIC: Couldn't start tiup playground! Here are the logs for the last attempt:"
|
|
|
|
cat /tmp/tiup.log
|
2023-12-19 08:56:24 +00:00
|
|
|
|
2023-12-04 10:24:44 +00:00
|
|
|
exit 1
|
2023-08-03 09:55:06 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
[tasks.stop-tikv]
|
|
|
|
category = "CI - SERVICES"
|
|
|
|
script = "kill $(cat /tmp/tiup.pid) || true"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Builds
|
|
|
|
#
|
|
|
|
|
|
|
|
[tasks.build-surrealdb]
|
|
|
|
category = "CI - BUILD"
|
|
|
|
command = "cargo"
|
2023-11-13 17:19:47 +00:00
|
|
|
args = ["build", "--locked", "--no-default-features", "--features", "storage-mem"]
|
2023-08-03 09:55:06 +00:00
|
|
|
|
|
|
|
#
|
2023-11-18 13:55:01 +00:00
|
|
|
# Benchmarks - Common
|
2023-08-03 09:55:06 +00:00
|
|
|
#
|
2023-11-18 13:55:01 +00:00
|
|
|
[tasks.ci-bench]
|
2023-08-03 09:55:06 +00:00
|
|
|
category = "CI - BENCHMARK"
|
|
|
|
command = "cargo"
|
2023-11-18 13:55:01 +00:00
|
|
|
args = ["bench", "--quiet", "--package", "surrealdb", "--no-default-features", "--features", "kv-mem,scripting,http", "${@}"]
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-11-18 13:55:01 +00:00
|
|
|
#
|
|
|
|
# Benchmarks - SDB - Per Target
|
|
|
|
#
|
|
|
|
[env]
|
|
|
|
BENCH_WORKER_THREADS = { value = "1", condition = { env_not_set = ["BENCH_WORKER_THREADS"] } }
|
|
|
|
BENCH_NUM_OPS = { value = "1000", condition = { env_not_set = ["BENCH_NUM_OPS"] } }
|
|
|
|
BENCH_DURATION = { value = "30", condition = { env_not_set = ["BENCH_DURATION"] } }
|
|
|
|
BENCH_SAMPLE_SIZE = { value = "10", condition = { env_not_set = ["BENCH_SAMPLE_SIZE"] } }
|
|
|
|
BENCH_FEATURES = { value = "protocol-ws,kv-mem,kv-rocksdb,kv-fdb-7_1", condition = { env_not_set = ["BENCH_FEATURES"] } }
|
|
|
|
|
|
|
|
[tasks.bench-target]
|
|
|
|
private = true
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
2023-08-03 09:55:06 +00:00
|
|
|
command = "cargo"
|
2023-11-18 13:55:01 +00:00
|
|
|
args = ["bench", "--package", "surrealdb", "--bench", "sdb", "--no-default-features", "--features", "${BENCH_FEATURES}", "${@}"]
|
|
|
|
|
|
|
|
[tasks.bench-lib-mem]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "lib-mem" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-lib-rocksdb]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "lib-rocksdb" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-lib-fdb]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "lib-fdb" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-sdk-mem]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "sdk-mem" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-sdk-rocksdb]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "sdk-rocksdb" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-sdk-fdb]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "sdk-fdb" }
|
|
|
|
run_task = { name = ["bench-target"] }
|
|
|
|
|
|
|
|
[tasks.bench-sdk-ws]
|
|
|
|
category = "CI - BENCHMARK - SurrealDB Target"
|
|
|
|
env = { BENCH_DATASTORE_TARGET = "sdk-ws" }
|
|
|
|
run_task = { name = ["bench-target"] }
|