Skip to content

Commit

Permalink
Update error message assertion in tests (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn committed Mar 28, 2024
1 parent 9efd657 commit 1cba687
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .docker/clickhouse/single_node_tls/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM clickhouse/clickhouse-server:24.2-alpine
FROM clickhouse/clickhouse-server:24.3-alpine
COPY .docker/clickhouse/single_node_tls/certificates /etc/clickhouse-server/certs
RUN chown clickhouse:clickhouse -R /etc/clickhouse-server/certs \
&& chmod 600 /etc/clickhouse-server/certs/* \
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2.3'

services:
clickhouse1:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.2-alpine}'
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.3-alpine}'
ulimits:
nofile:
soft: 262144
Expand All @@ -19,7 +19,7 @@ services:
- './.docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml'

clickhouse2:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.2-alpine}'
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.3-alpine}'
ulimits:
nofile:
soft: 262144
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
clickhouse:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.2-alpine}'
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.3-alpine}'
container_name: 'clickhouse-js-clickhouse-server'
ports:
- '8123:8123'
Expand Down
19 changes: 14 additions & 5 deletions packages/client-common/__tests__/integration/error_parsing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,33 @@ describe('ClickHouse server errors parsing', () => {
})

it('returns "unknown identifier" error', async () => {
// Possible error messages here:
// (since 24.3+, Cloud SMT): Unknown expression identifier 'number' in scope SELECT number AS FR
// (since 23.8+, Cloud RMT): Missing columns: 'number' while processing query: 'SELECT number AS FR', required columns: 'number'
const errorMessagePattern =
`((?:Missing columns: 'number' while processing query: 'SELECT number AS FR', required columns: 'number')|` +
`(?:Unknown expression identifier 'number' in scope SELECT number AS FR))`
await expectAsync(
client.query({
query: 'SELECT number FR',
})
).toBeRejectedWith(
jasmine.objectContaining({
message: `Missing columns: 'number' while processing query: 'SELECT number AS FR', required columns: 'number'. `,
message: jasmine.stringMatching(errorMessagePattern),
code: '47',
type: 'UNKNOWN_IDENTIFIER',
})
)
})

it('returns "unknown table" error', async () => {
// possible error messages here:
// (since 23.8+) Table foo.unknown_table does not exist.
// (pre-23.8) Table foo.unknown_table doesn't exist.
const errorMessagePattern = `^Table ${getTestDatabaseName()}.unknown_table does(n't| not) exist.*$`
// Possible error messages here:
// (since 24.3+, Cloud SMT): Unknown table expression identifier 'unknown_table' in scope
// (since 23.8+, Cloud RMT): Table foo.unknown_table does not exist.
const dbName = getTestDatabaseName()
const errorMessagePattern =
`((?:^Table ${dbName}.unknown_table does not exist.*)|` +
`(?:Unknown table expression identifier 'unknown_table' in scope))`
await expectAsync(
client.query({
query: 'SELECT * FROM unknown_table',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe('[Node.js] streaming e2e', () => {
'Schema<{ 0: id: Uint64, 1: name: Utf8, 2: sku: List<Uint8> }>'
)
const actualParquetData: unknown[] = []
const textDecoder = new TextDecoder()
table.toArray().map((v) => {
const row: Record<string, unknown> = {}
row['id'] = v.id
Expand Down

0 comments on commit 1cba687

Please sign in to comment.