-
Notifications
You must be signed in to change notification settings - Fork 574
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
test: add e2e extended mode test #8710
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Test binary format of different type. (sqllogitest return binary format in extended mode) | ||
|
||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
# RisingWave can't support list and struct now so we skip them. | ||
# include ../batch/types/array.slt.part | ||
# include ../batch/types/struct.slt.part | ||
# include ../batch/types/list.slt.part | ||
|
||
# Sqllogitest can't support binary format bytea type so we skip it. | ||
# include ../batch/types/bytea.slt.part | ||
|
||
# Can't support inf,-inf binary format now so we skip it. | ||
# include ../batch/types/decimal.slt.part | ||
|
||
# Sqllogitest can't support binary format jsonb type so we skip it. | ||
# include ../batch/types/jsonb_ord.slt.part | ||
# include ../batch/types/jsonb.slt.part | ||
|
||
include ../batch/types/boolean.slt.part | ||
include ../batch/types/cast.slt.part | ||
include ../batch/types/date.slt | ||
include ../batch/types/intercal.slt.part | ||
include ../batch/types/number_arithmetic.slt.part | ||
include ../batch/types/temporal_arithmetic.slt.part | ||
include ../batch/types/time.slt.part | ||
include ../batch/types/timestamptz_utc.slt.part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[package] | ||
name = "risingwave_e2e_extended_mode_test" | ||
version = { workspace = true } | ||
edition = { workspace = true } | ||
homepage = { workspace = true } | ||
keywords = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
|
||
[package.metadata.cargo-machete] | ||
ignored = ["workspace-hack"] | ||
|
||
[package.metadata.cargo-udeps.ignore] | ||
normal = ["workspace-hack"] | ||
|
||
[dependencies] | ||
anyhow = { version = "1", features = ["backtrace"] } | ||
chrono = { version = "0.4", features = ['serde'] } | ||
clap = { version = "4", features = ["derive"] } | ||
pg_interval = "0.4" | ||
rust_decimal ={ version = "1.25", features = ["db-postgres","db-tokio-postgres"] } | ||
tokio = { version = "1", features = ["rt", "macros","rt-multi-thread"] } | ||
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4"] } | ||
tracing = "0.1" | ||
tracing-subscriber = "0.3.16" | ||
|
||
[[bin]] | ||
name = "risingwave_e2e_extended_mode_test" | ||
path = "src/main.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This is a program used for e2e test in extended mode. | ||
|
||
## What is difference between it and extended_mode/*.slt in e2e_test | ||
|
||
For e2e test in extended query mode, there are two thing we can't test in sqllogitest | ||
1. bind parameter | ||
2. max row number | ||
See [detail](https://www.postgresql.org/docs/15/protocol-flow.html#PROTOCOL-FLOW-PIPELINING:~:text=Once%20a%20portal,count%20is%20ignored) | ||
|
||
So before sqllogictest supporting these, we test these function in this program. | ||
|
||
In the future, we may merge it to e2e_text/extended_query | ||
|
||
# How to run | ||
|
||
```shell | ||
RUST_BACKTRACE=1 target/debug/risingwave_e2e_extended_mode_test --host 127.0.0.1 \ | ||
-p 4566 \ | ||
-u root \ | ||
--database dev \ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2023 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
mod opts; | ||
mod test; | ||
|
||
use std::process::exit; | ||
|
||
use clap::Parser; | ||
use tracing::{error, info}; | ||
|
||
use crate::opts::Opts; | ||
use crate::test::TestSuite; | ||
|
||
#[tokio::main(flavor = "multi_thread", worker_threads = 5)] | ||
async fn main() { | ||
exit(run_test().await) | ||
} | ||
|
||
async fn run_test() -> i32 { | ||
let opts = Opts::parse(); | ||
|
||
tracing_subscriber::fmt::init(); | ||
|
||
let test_suite = TestSuite::new(opts); | ||
|
||
match test_suite.test().await { | ||
Ok(_) => { | ||
info!("Risingwave e2e extended mode test completed successfully!"); | ||
0 | ||
} | ||
Err(e) => { | ||
error!("Risingwave e2e extended mode test failed: {:?}. Please ensure that your psql version is larger than 14.1", e); | ||
1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2023 RisingWave Labs | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use clap::{Parser, ValueHint}; | ||
|
||
#[derive(Parser, Debug, Clone)] | ||
pub struct Opts { | ||
/// Database name used to connect to pg. | ||
#[clap(name = "DB", long = "database", default_value = "dev")] | ||
pub pg_db_name: String, | ||
/// Username used to connect to postgresql. | ||
#[clap(name = "PG_USERNAME", short = 'u', long = "user", default_value="postgres", value_hint=ValueHint::Username)] | ||
pub pg_user_name: String, | ||
/// Postgresql server address to test against. | ||
#[clap(name = "PG_SERVER_ADDRESS", long = "host", default_value = "localhost")] | ||
pub pg_server_host: String, | ||
/// Postgresql server port to test against. | ||
#[clap(name = "PG_SERVER_PORT", short = 'p', long = "port")] | ||
pub pg_server_port: u16, | ||
#[clap(name = "PG_PASSWARD", long = "password", default_value = "")] | ||
pub pg_password: String, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why do we remove these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have cover it with extended_mode/type.slt.🤔