Skip to content

Commit 4599aba

Browse files
committed
feat(extension-driver-ksqldb): add authorization to testing
1 parent f9634f2 commit 4599aba

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/extension-driver-ksqldb/src/lib/restfulClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class RestfulClient {
101101
try {
102102
const res = await this.request<KsqlInfoResponse>(RESTFUL_API.INFO, 'GET');
103103
return res.KsqlServerInfo['serverStatus'];
104-
} catch (e) {
104+
} catch (e: any) {
105105
if(e.error_code) {
106106
throw new Error(JSON.stringify(e));
107107
} else {

packages/extension-driver-ksqldb/test/docker/compose.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface ComposeConfig {
99
image: string;
1010
hostname: string;
1111
ports: string[];
12+
volumes: string[];
1213
environment: Record<string, any>;
1314
expose: string[];
1415
entrypoint: string | string[];
@@ -72,6 +73,8 @@ export class Compose {
7273
}
7374

7475
private convertContainerConfig(service: ComposeConfig, network: string) {
76+
// dockerode does not support relative paths in container volumes
77+
const Binds = (service['volumes'] || []).map((volume) => volume.replace('./', ''));
7578
return {
7679
Image: service['image'],
7780
name: service['hostname'],
@@ -84,6 +87,7 @@ export class Compose {
8487
[`${containerPort}/tcp`]: [{ HostPort: hostPort }],
8588
};
8689
}, {}),
90+
Binds,
8791
NetworkMode: network,
8892
},
8993
Env: Object.keys(service['environment'] || {}).map(
@@ -95,6 +99,6 @@ export class Compose {
9599
),
96100
Entrypoint: service['entrypoint'] || [],
97101
Tty: service['tty'] || false,
98-
};
102+
} as Docker.ContainerCreateOptions;;
99103
}
100104
}

packages/extension-driver-ksqldb/test/ksqlDbServer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ export class KSqlDbServer {
102102
type: 'ksqldb',
103103
connection: {
104104
host: `http://${this.host}:${this.port}`,
105+
username: this.username,
106+
password: this.password,
105107
},
106108
allow: '*',
107109
};

0 commit comments

Comments
 (0)