Skip to content

Commit 4dc28da

Browse files
authored
chore(clients): add more e2e (#2497)
1 parent 550e565 commit 4dc28da

File tree

8 files changed

+69
-9
lines changed

8 files changed

+69
-9
lines changed

scripts/cts/runCts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function runCtsOne(language: string): Promise<void> {
4040
});
4141
break;
4242
case 'ruby':
43-
await run(`bundle install && bundle exec rake test`, { cwd: 'tests/output/ruby' });
43+
await run(`bundle install && bundle exec rake test --trace`, { cwd: 'tests/output/ruby' });
4444
break;
4545
case 'scala':
4646
await run('sbt test', { cwd: 'tests/output/scala' });

tests/CTS/requests/search/browse.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
{
33
"testName": "browse with minimal parameters",
44
"parameters": {
5-
"indexName": "indexName"
5+
"indexName": "cts_e2e_browse"
66
},
77
"request": {
8-
"path": "/1/indexes/indexName/browse",
8+
"path": "/1/indexes/cts_e2e_browse/browse",
99
"method": "POST"
10+
},
11+
"response": {
12+
"statusCode": 200,
13+
"body": {
14+
"page": 0,
15+
"nbHits": 33191,
16+
"nbPages": 34,
17+
"hitsPerPage": 1000,
18+
"query": "",
19+
"params": ""
20+
}
1021
}
1122
},
1223
{
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,42 @@
11
[
22
{
33
"parameters": {
4-
"indexName": "theIndexName"
4+
"indexName": "cts_e2e_settings"
55
},
66
"request": {
7-
"path": "/1/indexes/theIndexName/settings",
7+
"path": "/1/indexes/cts_e2e_settings/settings",
88
"method": "GET"
9+
},
10+
"response": {
11+
"statusCode": 200,
12+
"body": {
13+
"minWordSizefor1Typo": 4,
14+
"minWordSizefor2Typos": 8,
15+
"hitsPerPage": 20,
16+
"maxValuesPerFacet": 100,
17+
"version": 1,
18+
"paginationLimitedTo": 10,
19+
"exactOnSingleWordQuery": "attribute",
20+
"ranking": [
21+
"typo",
22+
"geo",
23+
"words",
24+
"filters",
25+
"proximity",
26+
"attribute",
27+
"exact",
28+
"custom"
29+
],
30+
"separatorsToIndex": "",
31+
"removeWordsIfNoResults": "none",
32+
"queryType": "prefixLast",
33+
"highlightPreTag": "<em>",
34+
"highlightPostTag": "</em>",
35+
"alternativesAsExact": [
36+
"ignorePlurals",
37+
"singleWordSynonym"
38+
]
39+
}
940
}
1041
}
1142
]

tests/CTS/requests/search/setSettings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22
{
33
"testName": "setSettings with minimal parameters",
44
"parameters": {
5-
"indexName": "theIndexName",
5+
"indexName": "cts_e2e_settings",
66
"indexSettings": {
77
"paginationLimitedTo": 10
88
},
99
"forwardToReplicas": true
1010
},
1111
"request": {
12-
"path": "/1/indexes/theIndexName/settings",
12+
"path": "/1/indexes/cts_e2e_settings/settings",
1313
"method": "PUT",
1414
"body": {
1515
"paginationLimitedTo": 10
1616
},
1717
"queryParameters": {
1818
"forwardToReplicas": "true"
1919
}
20+
},
21+
"response": {
22+
"statusCode": 200
2023
}
2124
},
2225
{

tests/output/javascript/src/helpers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ export function union(
44
): Record<string, any> {
55
const res = {};
66

7+
if (!expected) {
8+
return expected;
9+
}
10+
11+
if (typeof expected !== 'object' && !Array.isArray(expected)) {
12+
return expected;
13+
}
14+
715
for (const [key, value] of Object.entries(expected)) {
816
if (key in received) {
917
if (Array.isArray(value)) {

tests/output/python/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
argcomplete==3.1.6
22
click==8.1.7
33
packaging==23.2
4-
pipx==1.4.1
5-
platformdirs==4.1.0
4+
pipx==1.3.2
5+
platformdirs==4.0.0
66
userpath==1.9.1

tests/output/python/tests/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ def union(self, expected: dict, received: dict) -> dict:
55
"""
66
_res = {}
77

8+
if not isinstance(expected, dict) or not isinstance(received, dict):
9+
return received
10+
811
for k, v in expected.items():
912
if k in received:
1013
if isinstance(v, dict):

tests/output/ruby/test/helpers.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
def union(expected, received)
22
res = {}
33

4+
if !expected.is_a?(Array) and !expected.is_a?(Hash)
5+
return expected
6+
end
7+
48
expected.each do |key, value|
59
if received.key?(key)
610
if value.is_a?(Array)

0 commit comments

Comments
 (0)