ClickHouse/tests/queries/0_stateless/03021_output_format_tty.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
857 B
Bash
Raw Normal View History

2024-03-23 01:42:11 +00:00
#!/usr/bin/expect -f
set basedir [file dirname $argv0]
set basename [file tail $argv0]
2024-03-23 17:09:50 +00:00
if {[info exists env(CLICKHOUSE_TMP)]} {
set CLICKHOUSE_TMP $env(CLICKHOUSE_TMP)
} else {
set CLICKHOUSE_TMP "."
}
exp_internal -f $CLICKHOUSE_TMP/$basename.debuglog 0
set history_file $CLICKHOUSE_TMP/$basename.history
2024-03-23 01:42:11 +00:00
2024-03-23 17:09:50 +00:00
log_user 0
2024-03-23 01:42:11 +00:00
set timeout 60
match_max 100000
expect_after {
# Do not ignore eof from expect
-i $any_spawn_id eof { exp_continue }
# A default timeout action is to do nothing, change it to fail
-i $any_spawn_id timeout { exit 1 }
}
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT --query 'SELECT 1'"
expect "│ 1 │"
expect "└───┘"
expect eof
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_LOCAL --query 'SELECT 2'"
expect "│ 2 │"
expect "└───┘"
expect eof