Skip to content

Commit

Permalink
chore(test): upgrade sqllogictest to 0.27.1 (#20516)
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <stdrc@outlook.com>
  • Loading branch information
stdrc authored Feb 19, 2025
1 parent 01ef2d6 commit 7df444c
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 51 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ echo "All processes has exited."

[tasks.slt]
category = "RiseDev - Test - SQLLogicTest"
install_crate = { min_version = "0.26.3", crate_name = "sqllogictest-bin", binary = "sqllogictest", test_arg = [
install_crate = { min_version = "0.27.1", crate_name = "sqllogictest-bin", binary = "sqllogictest", test_arg = [
"--help",
], install_command = "binstall" }
dependencies = ["check-and-load-risedev-env-file"]
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
RUN cargo binstall -y --locked cargo-llvm-cov cargo-nextest cargo-sort cargo-cache cargo-machete \
cargo-make@0.37.9 \
sqllogictest-bin@0.26.3 \
sqllogictest-bin@0.27.1 \
sccache@0.7.4 \
&& cargo cache -a \
&& rm -rf "/root/.cargo/registry/index" \
Expand Down
2 changes: 1 addition & 1 deletion ci/build-ci-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cat ../rust-toolchain
# shellcheck disable=SC2155

# REMEMBER TO ALSO UPDATE ci/docker-compose.yml
export BUILD_ENV_VERSION=v20250115
export BUILD_ENV_VERSION=v20250218

export BUILD_TAG="public.ecr.aws/w1p7b4n3/rw-build-env:${BUILD_ENV_VERSION}"

Expand Down
14 changes: 7 additions & 7 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ services:
retries: 5

source-test-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
depends_on:
- mysql
- mysql-meta
Expand All @@ -106,7 +106,7 @@ services:
- ..:/risingwave

sink-test-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
depends_on:
- mysql
- mysql-meta
Expand All @@ -129,28 +129,28 @@ services:
- ..:/risingwave

rw-build-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
volumes:
- ..:/risingwave

# Standard environment for CI, including MySQL and Postgres for metadata.
ci-standard-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
depends_on:
- mysql-meta
- db
volumes:
- ..:/risingwave

iceberg-engine-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
depends_on:
- db
volumes:
- ..:/risingwave

ci-flamegraph-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
# NOTE(kwannoel): This is used in order to permit
# syscalls for `nperf` (perf_event_open),
# so it can do CPU profiling.
Expand All @@ -161,7 +161,7 @@ services:
- ..:/risingwave

regress-test-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250115
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20250218
depends_on:
db:
condition: service_healthy
Expand Down
38 changes: 19 additions & 19 deletions ci/scripts/e2e-test-parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@ download_and_prepare_rw "$profile" common
echo "--- Download artifacts"
download-and-decompress-artifact e2e_test_generated ./

start_cluster() {
echo "--- Start cluster"
risedev ci-start ci-3streaming-2serving-3fe
}

kill_cluster() {
echo "--- Kill cluster"
risedev ci-kill
echo "--- Kill cluster"
risedev ci-kill
}

host_args=(-h localhost -p 4565 -h localhost -p 4566 -h localhost -p 4567)

RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info,risingwave_storage::hummock::compactor::compactor_runner=warn"

echo "--- e2e, ci-3streaming-2serving-3fe, streaming"
RUST_LOG=$RUST_LOG \
risedev ci-start ci-3streaming-2serving-3fe
sqllogictest "${host_args[@]}" -d dev './e2e_test/streaming/**/*.slt' -j 16 --junit "parallel-streaming-${profile}" --label "parallel"

echo "--- e2e, parallel, streaming"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info,risingwave_storage::hummock::compactor::compactor_runner=warn" \
start_cluster
risedev slt "${host_args[@]}" -d dev './e2e_test/streaming/**/*.slt' -j 16 --junit "parallel-streaming-${profile}" --label "parallel"
kill_cluster

echo "--- e2e, ci-3streaming-2serving-3fe, batch"
RUST_LOG=$RUST_LOG \
risedev ci-start ci-3streaming-2serving-3fe
echo "--- e2e, parallel, batch"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info,risingwave_storage::hummock::compactor::compactor_runner=warn" \
start_cluster
# Exclude files that contain ALTER SYSTEM commands
find ./e2e_test/ddl -name "*.slt" -type f -exec grep -L "ALTER SYSTEM" {} \; | xargs -r sqllogictest "${host_args[@]}" -d dev --junit "parallel-batch-ddl-${profile}" --label "parallel"
sqllogictest "${host_args[@]}" -d dev './e2e_test/visibility_mode/*.slt' -j 16 --junit "parallel-batch-${profile}" --label "parallel"

risedev slt "${host_args[@]}" -d dev './e2e_test/visibility_mode/*.slt' -j 16 --junit "parallel-batch-${profile}" --label "parallel"
kill_cluster

echo "--- e2e, ci-3streaming-2serving-3fe, generated"
RUST_LOG=$RUST_LOG \
risedev ci-start ci-3streaming-2serving-3fe
sqllogictest "${host_args[@]}" -d dev './e2e_test/generated/**/*.slt' -j 16 --junit "parallel-generated-${profile}" --label "parallel"

echo "--- e2e, parallel, generated"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info,risingwave_storage::hummock::compactor::compactor_runner=warn" \
start_cluster
risedev slt "${host_args[@]}" -d dev './e2e_test/generated/**/*.slt' -j 16 --junit "parallel-generated-${profile}" --label "parallel"
kill_cluster
11 changes: 1 addition & 10 deletions ci/scripts/e2e-test-serial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ echo "--- e2e, $mode, streaming"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info,risingwave_stream::common::table::state_table=warn" \
cluster_start
# Please make sure the regression is expected before increasing the timeout.
sqllogictest -p 4566 -d dev './e2e_test/streaming/**/*.slt' --junit "streaming-${profile}"
risedev slt -p 4566 -d dev './e2e_test/queryable_internal_state/**/*.slt' --junit "queryable-internal-state-${profile}"
risedev slt -p 4566 -d dev './e2e_test/streaming/**/*.slt' --junit "streaming-${profile}"
sqllogictest -p 4566 -d dev './e2e_test/backfill/sink/different_pk_and_dist_key.slt'

echo "--- Kill cluster"
Expand Down Expand Up @@ -145,14 +144,6 @@ sqllogictest -p 4566 -d dev './e2e_test/udf/python_udf.slt'
echo "--- Kill cluster"
cluster_stop

echo "--- e2e, $mode, generated"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info" \
cluster_start
sqllogictest -p 4566 -d dev './e2e_test/generated/**/*.slt' --junit "generated-${profile}"

echo "--- Kill cluster"
cluster_stop

# only run if mode is not single-node or standalone
if [[ "$mode" != "single-node" && "$mode" != "standalone" ]]; then
echo "--- e2e, ci-3cn-1fe-with-recovery, error ui"
Expand Down
17 changes: 11 additions & 6 deletions e2e_test/commands/internal_table.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
// https://google.github.io/zx/

const {
db: db_name,
name: job_name,
type: table_type,
count: count,
} = minimist(process.argv.slice(3), {
string: ["name", "type"],
string: ["db", "name", "type"],
boolean: ["count"],
default: {
"db": "dev",
}
});

// Return an array of CSV string
async function psql(query) {
async function psql(db_name, query) {
return (
await $`
psql -h $RISEDEV_RW_FRONTEND_LISTEN_ADDRESS -p $RISEDEV_RW_FRONTEND_PORT -U root -d dev \
psql -h $RISEDEV_RW_FRONTEND_LISTEN_ADDRESS -p $RISEDEV_RW_FRONTEND_PORT -U root -d ${db_name} \
--csv --tuples-only --quiet -c ${query}
`
)
Expand All @@ -28,9 +32,10 @@ psql -h $RISEDEV_RW_FRONTEND_LISTEN_ADDRESS -p $RISEDEV_RW_FRONTEND_PORT -U root

// If `table_type` is null, return all internal tables for the job.
// If `job_name` is null, return all jobs' internal tables.
async function select_internal_table(job_name, table_type) {
async function select_internal_table(db_name, job_name, table_type) {
// Note: if we have `t1`, and `t1_balabala`, the latter one will also be matched 😄.
const internal_tables = await psql(
db_name,
`select name from rw_internal_tables where name like '__internal_${job_name}_%_${table_type}_%'`
);
if (internal_tables.length == 0) {
Expand All @@ -42,15 +47,15 @@ async function select_internal_table(job_name, table_type) {
const res = new Map(
await Promise.all(
internal_tables.map(async (t) => {
let rows = await psql(`select * from ${t}`);
let rows = await psql(db_name, `select * from ${t}`);
return [t, rows];
})
)
);
return res;
}

const tables = await select_internal_table(job_name, table_type);
const tables = await select_internal_table(db_name, job_name, table_type);
for (const [table_name, rows] of tables) {
if (tables.size > 1) {
console.log(`Table: ${table_name}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# See https://github.com/risingwavelabs/risingwave/pull/20435 for the bug.

control substitution on

statement ok
SET RW_IMPLICIT_FLUSH TO true;

Expand All @@ -17,8 +19,9 @@ select * from mv;
----
1 7

skipif madsim
system ok
internal_table.mjs --name mv --type hashaggstate --count
internal_table.mjs --db $__DATABASE__ --name mv --type hashaggstate --count
----
count: 1

Expand All @@ -32,8 +35,9 @@ select * from mv order by foo;
1 7
2 7

skipif madsim
system ok
internal_table.mjs --name mv --type hashaggstate --count
internal_table.mjs --db $__DATABASE__ --name mv --type hashaggstate --count
----
count: 2

Expand All @@ -46,8 +50,9 @@ select * from mv;
----
2 7

skipif madsim
system ok
internal_table.mjs --name mv --type hashaggstate --count
internal_table.mjs --db $__DATABASE__ --name mv --type hashaggstate --count
----
count: 1

Expand Down
2 changes: 1 addition & 1 deletion src/tests/simulation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ risingwave_sqlsmith = { workspace = true }
serde = "1.0.188"
serde_derive = "1.0.188"
serde_json = "1.0.107"
sqllogictest = "0.26.3"
sqllogictest = "0.27.1"
tempfile = "3"
tikv-jemallocator = { workspace = true }
tokio = { version = "0.2", package = "madsim-tokio" }
Expand Down
2 changes: 2 additions & 0 deletions src/tests/simulation/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ impl sqllogictest::AsyncDB for RisingWave {
}
}

async fn shutdown(&mut self) {}

fn engine_name(&self) -> &str {
"risingwave"
}
Expand Down

0 comments on commit 7df444c

Please sign in to comment.