mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fixed 00921_datetime64_compatibility.python test case
Running it correctly so test runner does not report failure on intended exceptions.
This commit is contained in:
parent
3ea467d34a
commit
93afa6f2f3
@ -178,19 +178,15 @@ def escape_string(s):
|
||||
def execute_functions_for_types(functions, types):
|
||||
# TODO: use string.Template here to allow lines that do not contain type, like: SELECT CAST(toDateTime64(1234567890), 'DateTime64')
|
||||
for func in functions:
|
||||
print("""SELECT 'SELECT {func}'""".format(func=escape_string(func))) # for debug only
|
||||
print("""SELECT 'SELECT {func}';""".format(func=escape_string(func)))
|
||||
for dt in types:
|
||||
prologue = "\
|
||||
WITH \
|
||||
toDateTime64('2019-09-16 19:20:11.234', 3, 'Europe/Minsk') as DT64, \
|
||||
toDateTime('2019-09-16 19:20:11', 'Europe/Minsk') as DT, \
|
||||
toDate('2019-09-16') as D, {X} as N".format(X=dt)
|
||||
# dt64 = func.format(datetime=dt)
|
||||
# f = "'values match:', ({dt32}) == ({dt64}), 'types match:', toTypeName({dt32}) == toTypeName({dt64})".format(dt32=dt32, dt64=dt64)
|
||||
print("""{prologue} SELECT toTypeName(r), {func} as r FORMAT CSV""".format(prologue=prologue, func=func))
|
||||
# print("""SELECT toTypeName(r), {dt64} as r""".format(dt64=dt64)) # for debug only
|
||||
# print("""SELECT {f};""".format(f=f))
|
||||
print("""SELECT '------------------------------------------'""") # for debug only
|
||||
print("""{prologue} SELECT toTypeName(r), {func} as r FORMAT CSV;""".format(prologue=prologue, func=func))
|
||||
print("""SELECT '------------------------------------------';""")
|
||||
|
||||
def main():
|
||||
def parse_args():
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL="none"
|
||||
# We should have correct env vars from shell_config.sh to run this test
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
export CH_C_SETTINGS='--format_custom_field_delimiter=\ --format_custom_row_before_delimiter= --format_custom_row_between_delimiter= --format_custom_result_before_delimiter= --format_custom_result_after_delimiter='
|
||||
# in order to check queries individually (does not stop on the first one that fails):
|
||||
IFS=$'\n'; for I in $($CURDIR/00921_datetime64_compatibility.python) ; do "${CLICKHOUSE_CLIENT}" -nm -q "$I" $CH_C_SETTINGS; echo ; done 2>&1 \
|
||||
| tr "\n" "\t" \
|
||||
| sed -Eu 's/-------+\t+/\n/g; s/Received exception from server \(version 19.16.1\):\s+//g; s/DB::Exception: Received from localhost:9000. //g; s/\s+$//g; '
|
||||
# In order to check queries individually (don't stop on the first one that fails):
|
||||
#IFS=$'\n'; for I in $(${CURDIR}/00921_datetime64_compatibility.python) ; do unset IFS; ${CLICKHOUSE_CLIENT} --query "${I}"; echo ; done 2>&1;
|
||||
|
||||
# ${CURDIR}/00921_datetime64_compatibility.python
|
||||
|
||||
${CURDIR}/00921_datetime64_compatibility.python \
|
||||
| ${CLICKHOUSE_CLIENT} --ignore-error -T -nm --calculate_text_stack_trace 0 --log-level 'error' 2>&1 \
|
||||
| sed -Ee 's/Received exception from server .*//g; s/(Code: [0-9]+). DB::Exception: Received from .* DB::Exception/\1/g'
|
||||
|
Loading…
Reference in New Issue
Block a user