Skip to content

Commit 5b80d36

Browse files
committed
split the cts and create separate folders to host the build part
1 parent 7eb9fcf commit 5b80d36

File tree

119 files changed

+1029
-919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+1029
-919
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"build:specs": "./scripts/builds/specs.sh ${0:-all} ${1:-yaml}",
1212
"build": "yarn build:specs && yarn build:clients",
1313
"clean": "rm -rf **/dist **/build **/node_modules",
14-
"cts:generate": "yarn workspace tests start",
15-
"cts:test": "yarn workspace tests test",
14+
"cts:generate": "yarn workspace tests build && ./scripts/multiplexer.sh yarn workspace tests generate ${0:-all} ${1:-all} && yarn workspace tests lint:fix",
15+
"cts:test": "./scripts/multiplexer.sh ./scripts/runCTS.sh ${0:-all} all",
1616
"docker:build": "./scripts/docker/build.sh",
1717
"docker:clean": "docker stop dev; docker rm -f dev; docker image rm -f api-clients-automation",
1818
"docker:mount": "./scripts/docker/mount.sh",
@@ -36,13 +36,13 @@
3636
"eslint-plugin-algolia": "2.0.0",
3737
"eslint-plugin-eslint-comments": "3.2.0",
3838
"eslint-plugin-import": "2.25.4",
39-
"eslint-plugin-jsdoc": "37.5.1",
39+
"eslint-plugin-jsdoc": "37.6.1",
4040
"eslint-plugin-prettier": "4.0.0",
4141
"eslint-plugin-unused-imports": "2.0.0",
4242
"eslint-plugin-yml": "0.12.0",
4343
"json": "11.0.0",
4444
"prettier": "2.5.1",
45-
"prettier-plugin-java": "1.6.0",
45+
"prettier-plugin-java": "1.6.1",
4646
"swagger-cli": "4.0.4",
4747
"typescript": "4.5.4"
4848
},

playground/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@algolia/client-query-suggestions": "5.0.0",
2424
"@algolia/client-search": "5.0.0",
2525
"@algolia/recommend": "5.0.0",
26-
"dotenv": "10.0.0",
26+
"dotenv": "11.0.0",
2727
"typescript": "4.5.4"
2828
},
2929
"engines": {

scripts/multiplexer.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,26 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
1515
# Move to the root (easier to locate other scripts)
1616
cd ${DIR}/..
1717

18-
CMD=$1
19-
LANGUAGE=$2
20-
CLIENT=$3
18+
CMD=${@:1:$#-2}
19+
LANGUAGE=${@: -2:1}
20+
CLIENT=${@: -1}
2121

2222
if [[ $CMD == "./scripts/playground.sh" ]] && ([[ $LANGUAGE == "all" ]] || [[ $CLIENT == "all" ]]); then
2323
echo "You cannot use 'all' when running the playground, please specify the language and client"
2424

2525
exit 1
2626
fi
2727

28+
if [[ $CMD == "./scripts/runCTS.sh" ]]; then
29+
if [[ $CLIENT == "all" ]]; then
30+
CLIENT=search # dummy client to only run once
31+
else
32+
echo "You must use 'all' clients when testing the CTS, as they all run at the same time"
33+
34+
exit 1
35+
fi
36+
fi
37+
2838
LANGUAGES=()
2939
CLIENTS=()
3040

scripts/runCTS.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Break on non-zero code
4+
set -e
5+
6+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
7+
# Move to the root (easier to locate other scripts)
8+
cd ${DIR}/..
9+
10+
lang=$1
11+
12+
# Run the pre generation script if it exists.
13+
run_cts() {
14+
if [[ $lang == 'javascript' ]]; then
15+
yarn workspace javascript-tests test
16+
elif [[ $lang == 'java' ]]; then
17+
mvn clean compile exec:java -f tests/output/java/pom.xml
18+
fi
19+
}
20+
21+
run_cts

tests/CTS/templates/java/requests.mustache

Whitespace-only changes.

tests/generateCTS.ts

Lines changed: 0 additions & 279 deletions
This file was deleted.

tests/output/java/tests/searchRequests.java

Whitespace-only changes.
File renamed without changes.

tests/output/javascript/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "javascript-tests",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"lint:fix": "yarn eslint --ext=ts tests --fix",
6+
"test": "jest"
7+
},
8+
"dependencies": {
9+
"@algolia/client-abtesting": "5.0.0",
10+
"@algolia/client-analytics": "5.0.0",
11+
"@algolia/client-insights": "5.0.0",
12+
"@algolia/client-personalization": "5.0.0",
13+
"@algolia/client-query-suggestions": "5.0.0",
14+
"@algolia/client-search": "5.0.0",
15+
"@algolia/recommend": "5.0.0"
16+
},
17+
"devDependencies": {
18+
"@apidevtools/swagger-parser": "10.0.3",
19+
"@types/jest": "27.0.3",
20+
"@types/mustache": "4.1.2",
21+
"@types/node": "16.11.11",
22+
"dotenv": "11.0.0",
23+
"eslint": "8.6.0",
24+
"jest": "27.4.7",
25+
"mustache": "4.2.0",
26+
"openapi-types": "10.0.0",
27+
"prettier": "2.5.1",
28+
"ts-jest": "27.1.2",
29+
"typescript": "4.5.4"
30+
}
31+
}

0 commit comments

Comments
 (0)