Commit Graph

7 Commits

Author SHA1 Message Date
Azat Khuzhin
e4b81e6de9 Add exp_internal for expect tests
This is to catch possible issues like 01565_reconnect_after_client_error in [1].

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/38417/e33f236d502fe9f7906392f4ceffaee44e3c4ce4/stateless_tests__thread__actions__[3/3].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-02 17:08:06 +03:00
Azat Khuzhin
3b69e635dc Add functions from CREATE FUNCTION to completion 2022-05-01 18:35:22 +03:00
Azat Khuzhin
4a9ef3ba76 Use hex char numbers for Ctrl-C/Ctrl-V in 02160_client_autocomplete_parse_query
Since special symbols for Ctrl-C/Ctrl-V are not rendered in github UI,
yes vim renders it, but this does not makes review easier.
2022-01-18 21:03:51 +03:00
Azat Khuzhin
df64b89ce5 Fix 02160_client_autocomplete_parse_query in a more better way
The problem was that "eof" handler had been reseted.
2021-12-28 21:16:20 +03:00
Azat Khuzhin
a656e4c0bd Fix 02160_client_autocomplete_parse_query by waiting for the client to be spawned
expect can be terminated with eof, if the process has not been started
yet, add a while loop to wait until it will be started.
2021-12-28 21:16:20 +03:00
Azat Khuzhin
72dd5a2d2f Fix 02160_client_autocomplete_parse_query
Sad (since I wanted to make the test a little bit cleaner/easier to
understand), but you cannot use send_user in tests, since expect
send_user works only if stdin is a tty, so the following will fail (so
as in CI):

    $ ./tests/clickhouse-test --database default 02160  < /dev/null
    Using queries from '/src/ch/clickhouse-upstream/tests/queries' directory
    Using clickhouse-client as client program (expecting split build)
    Connecting to ClickHouse server... OK

    Running 1 stateless tests (MainProcess).

    02160_client_autocomplete_parse_query:                                  [ FAIL ] - return code: 1
    send: spawn id exp0 not open
        while executing
    "send_user "Completion loaded\n""
        (file "/src/ch/clickhouse-upstream/tests/queries/0_stateless/02160_client_autocomplete_parse_query.expect" line 40)
    , result:

    stdout:

    Database: default
2021-12-28 10:05:14 +03:00
Azat Khuzhin
36c4fc054c Client interactive suggest (extract info from CREATE queries)
This will parse CREATE queries and add the following things to
completion list for clickhouse-client/clickhouse-local:
- table
- database
- columns
2021-12-26 19:10:25 +03:00