Skip to content

Commit 42242e8

Browse files
committed
make changes for 1.23 support
1 parent fa0dec5 commit 42242e8

9 files changed

+97
-13
lines changed

ci/docker-compose-azure-cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- --scheme
1111
- http
1212
- --write-timeout=600s
13-
image: semitechnologies/weaviate:1.22.0
13+
image: semitechnologies/weaviate:1.23.0-rc.1
1414
ports:
1515
- 8081:8081
1616
restart: on-failure:0

ci/docker-compose-cluster.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '3.4'
33
services:
44
weaviate-node-1:
5-
image: semitechnologies/weaviate:1.22.0
5+
image: semitechnologies/weaviate:1.23.0-rc.1
66
restart: on-failure:0
77
ports:
88
- "8087:8080"
@@ -25,7 +25,7 @@ services:
2525
- '8080'
2626
- --scheme
2727
- http
28-
image: semitechnologies/weaviate:1.22.0
28+
image: semitechnologies/weaviate:1.23.0-rc.1
2929
ports:
3030
- 8088:8080
3131
- 6061:6060

ci/docker-compose-okta-cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- --scheme
1111
- http
1212
- --write-timeout=600s
13-
image: semitechnologies/weaviate:1.22.0
13+
image: semitechnologies/weaviate:1.23.0-rc.1
1414
ports:
1515
- 8082:8082
1616
restart: on-failure:0

ci/docker-compose-okta-users.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- --scheme
1111
- http
1212
- --write-timeout=600s
13-
image: semitechnologies/weaviate:1.22.0
13+
image: semitechnologies/weaviate:1.23.0-rc.1
1414
ports:
1515
- 8083:8083
1616
restart: on-failure:0

ci/docker-compose-openai.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
- '8086'
1010
- --scheme
1111
- http
12-
image: semitechnologies/weaviate:1.22.0
12+
image: semitechnologies/weaviate:1.23.0-rc.1
1313
ports:
1414
- 8086:8086
1515
restart: on-failure:0

ci/docker-compose-wcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- --scheme
1111
- http
1212
- --write-timeout=600s
13-
image: semitechnologies/weaviate:1.22.0
13+
image: semitechnologies/weaviate:1.23.0-rc.1
1414
ports:
1515
- 8085:8085
1616
restart: on-failure:0

ci/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '3.4'
33
services:
44
weaviate:
5-
image: semitechnologies/weaviate:1.22.0
5+
image: semitechnologies/weaviate:1.23.0-rc.1
66
restart: on-failure:0
77
ports:
88
- "8080:8080"

src/cluster/journey.test.ts

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
SOUP_CLASS_NAME,
88
} from '../utils/testData';
99

10-
const EXPECTED_WEAVIATE_VERSION = '1.22.0';
11-
const EXPECTED_WEAVIATE_GIT_HASH = 'b4f2ffb';
10+
const EXPECTED_WEAVIATE_VERSION = '1.23.0-rc.1';
11+
const EXPECTED_WEAVIATE_GIT_HASH = '841915f';
1212

1313
describe('cluster nodes endpoint', () => {
1414
const client = weaviate.client({
@@ -19,6 +19,7 @@ describe('cluster nodes endpoint', () => {
1919
it('get nodes status of empty db', () => {
2020
return client.cluster
2121
.nodesStatusGetter()
22+
.withOutput('verbose')
2223
.do()
2324
.then((nodesStatusResponse: NodesStatusResponse) => {
2425
expect(nodesStatusResponse.nodes).toBeDefined();
@@ -44,9 +45,10 @@ describe('cluster nodes endpoint', () => {
4445

4546
it('sets up db', () => createTestFoodSchemaAndData(client));
4647

47-
it('get nodes status of food db', () => {
48+
it('get verbose nodes status of food db', () => {
4849
return client.cluster
4950
.nodesStatusGetter()
51+
.withOutput('verbose')
5052
.do()
5153
.then((nodesStatusResponse: NodesStatusResponse) => {
5254
expect(nodesStatusResponse.nodes).toHaveLength(1);
@@ -88,10 +90,80 @@ describe('cluster nodes endpoint', () => {
8890
});
8991
});
9092

93+
it('get default nodes status of food db', () => {
94+
return client.cluster
95+
.nodesStatusGetter()
96+
.do()
97+
.then((nodesStatusResponse: NodesStatusResponse) => {
98+
expect(nodesStatusResponse.nodes).toHaveLength(1);
99+
if (nodesStatusResponse.nodes) {
100+
const node = nodesStatusResponse.nodes[0];
101+
expect(node.name).toMatch(/.+/);
102+
expect(node.version).toEqual(EXPECTED_WEAVIATE_VERSION);
103+
expect(node.gitHash).toEqual(EXPECTED_WEAVIATE_GIT_HASH);
104+
expect(node.status).toEqual('HEALTHY');
105+
expect(node.stats?.objectCount).toEqual(6);
106+
expect(node.stats?.shardCount).toEqual(2);
107+
expect(node.shards).toBeDefined();
108+
expect(node.shards).toHaveLength(2);
109+
if (node.shards) {
110+
expect([node.shards[0].class, node.shards[1].class]).toEqual(
111+
expect.arrayContaining([PIZZA_CLASS_NAME, SOUP_CLASS_NAME])
112+
);
113+
for (let i = 0; i < node.shards.length; i++) {
114+
const shard = node.shards[i];
115+
expect(shard.name).toMatch(/.+/);
116+
switch (shard.class) {
117+
case PIZZA_CLASS_NAME:
118+
expect(shard.objectCount).toEqual(4);
119+
break;
120+
case SOUP_CLASS_NAME:
121+
expect(shard.objectCount).toEqual(2);
122+
break;
123+
}
124+
}
125+
} else {
126+
throw new Error('node.shards should be defined');
127+
}
128+
} else {
129+
throw new Error('nodesStatusResponse.nodes should be defined');
130+
}
131+
})
132+
.catch((e: any) => {
133+
throw new Error('should not fail on getting nodes: ' + e);
134+
});
135+
});
136+
137+
it('get minimal nodes status of food db', () => {
138+
return client.cluster
139+
.nodesStatusGetter()
140+
.withOutput('minimal')
141+
.do()
142+
.then((nodesStatusResponse: NodesStatusResponse) => {
143+
expect(nodesStatusResponse.nodes).toHaveLength(1);
144+
if (nodesStatusResponse.nodes) {
145+
const node = nodesStatusResponse.nodes[0];
146+
expect(node.name).toMatch(/.+/);
147+
expect(node.version).toEqual(EXPECTED_WEAVIATE_VERSION);
148+
expect(node.gitHash).toEqual(EXPECTED_WEAVIATE_GIT_HASH);
149+
expect(node.status).toEqual('HEALTHY');
150+
expect(node.stats?.objectCount).toEqual(6);
151+
expect(node.stats?.shardCount).toEqual(2);
152+
expect(node.shards).toBeNull();
153+
} else {
154+
throw new Error('nodesStatusResponse.nodes should be defined');
155+
}
156+
})
157+
.catch((e: any) => {
158+
throw new Error('should not fail on getting nodes: ' + e);
159+
});
160+
});
161+
91162
it('get nodes status of only Pizza class in food db', () => {
92163
return client.cluster
93164
.nodesStatusGetter()
94165
.withClassName(PIZZA_CLASS_NAME)
166+
.withOutput('verbose')
95167
.do()
96168
.then((nodesStatusResponse: NodesStatusResponse) => {
97169
expect(nodesStatusResponse.nodes).toBeDefined();

src/cluster/nodesStatusGetter.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CommandBase } from '../validation/commandBase';
44

55
export default class NodesStatusGetter extends CommandBase {
66
private className?: string;
7+
private output?: string;
78

89
constructor(client: Connection) {
910
super(client);
@@ -14,14 +15,25 @@ export default class NodesStatusGetter extends CommandBase {
1415
return this;
1516
};
1617

18+
withOutput = (output: 'minimal' | 'verbose') => {
19+
this.output = output;
20+
return this;
21+
};
22+
1723
validate() {
1824
// nothing to validate
1925
}
2026

2127
do = (): Promise<NodesStatusResponse> => {
28+
let path = '/nodes';
2229
if (this.className) {
23-
return this.client.get(`/nodes/${this.className}`);
30+
path = `${path}/${this.className}`;
31+
}
32+
if (this.output) {
33+
path = `${path}?output=${this.output}`;
34+
} else {
35+
path = `${path}?output=verbose`;
2436
}
25-
return this.client.get('/nodes');
37+
return this.client.get(path);
2638
};
2739
}

0 commit comments

Comments
 (0)