Skip to content

Commit

Permalink
add failure test & bump version
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Sep 15, 2023
1 parent 4b2ac70 commit 2c78e58
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["sqllogictest", "sqllogictest-bin", "sqllogictest-engines", "tests"]

[workspace.package]
version = "0.15.3"
version = "0.16.0"
edition = "2021"
homepage = "https://github.com/risinglightdb/sqllogictest-rs"
keywords = ["sql", "database", "parser", "cli"]
Expand Down
4 changes: 2 additions & 2 deletions sqllogictest-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ glob = "0.3"
itertools = "0.11"
quick-junit = { version = "0.3" }
rand = "0.8"
sqllogictest = { path = "../sqllogictest", version = "0.15" }
sqllogictest-engines = { path = "../sqllogictest-engines", version = "0.15" }
sqllogictest = { path = "../sqllogictest", version = "0.16" }
sqllogictest-engines = { path = "../sqllogictest-engines", version = "0.16" }
tokio = { version = "1", features = [
"rt",
"rt-multi-thread",
Expand Down
2 changes: 1 addition & 1 deletion sqllogictest-engines/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ postgres-types = { version = "0.2.5", features = ["derive", "with-chrono-0_4"] }
rust_decimal = { version = "1.30.0", features = ["tokio-pg"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sqllogictest = { path = "../sqllogictest", version = "0.15" }
sqllogictest = { path = "../sqllogictest", version = "0.16" }
thiserror = "1"
tokio = { version = "1", features = [
"rt",
Expand Down
2 changes: 1 addition & 1 deletion sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
let result = D::run_command(cmd).await;

#[derive(thiserror::Error, Debug)]
#[error("external command exited unsuccessfully: {0}")]
#[error("process exited unsuccessfully: {0}")] // message from unstable `ExitStatusError`
struct SystemError(ExitStatus);

let error: Option<Arc<dyn std::error::Error + Send + Sync>> = match result {
Expand Down
13 changes: 13 additions & 0 deletions tests/system_command/system_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ fn test() {
.run_file("./system_command/system_command.slt")
.unwrap();
}

#[test]
fn test_fail() {
let mut tester = sqllogictest::Runner::new(|| async { Ok(FakeDB) });
// enable `__TEST_DIR__` override
tester.enable_testdir();

let err = tester
.run_file("./system_command/system_command_fail.slt")
.unwrap_err();

assert!(err.to_string().contains("system command failed"), "{err}");
}
2 changes: 2 additions & 0 deletions tests/system_command/system_command_fail.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
system ok
__TEST_DIR__/something_than_not_exist

0 comments on commit 2c78e58

Please sign in to comment.