Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body:
id: client
attributes:
label: Client
description: Which API are you targetting?
description: Which API are you targeting?
options:
- All
- AB testing
Expand Down
1 change: 0 additions & 1 deletion config/clients.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
"packageVersion": "5.5.3",
"modelFolder": "model",
"apiFolder": "src",
"dockerImage": "apic_base",
"tests": {
"extension": ".test.ts",
"outputFolder": "src"
Expand Down
4 changes: 2 additions & 2 deletions scripts/buildClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ async function buildLanguage(language: Language, gens: Generator[], buildType: B
await run('go build ./...', { cwd, language });
break;
case 'javascript':
await run('YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install', { cwd });
await run('YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install', { cwd, language });
if (buildType === 'client') {
const packageNames = gens.map(({ additionalProperties: { packageName } }) =>
packageName === 'algoliasearch' ? packageName : `@algolia/${packageName}`,
);
await run(`yarn build:many '{${packageNames.join(',')},}'`, { cwd });
await run(`yarn build:many '{${packageNames.join(',')},}'`, { cwd, language });
}

break;
Expand Down
12 changes: 8 additions & 4 deletions scripts/cts/runCts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ async function runCtsOne(language: Language, suites: Record<CTSType, boolean>):
});
break;
case 'go':
await run(`go test -race -count 1 ${isVerbose() ? '-v' : ''} ${filter((f) => `gotests/tests/${f}/...`)}`, {
cwd,
language,
});
await run(
`go test ${suites.benchmark ? '' : '-race'} -count 1 ${isVerbose() ? '-v' : ''} ${filter((f) => `gotests/tests/${f}/...`)}`,
{
cwd,
language,
},
);
break;
case 'java':
await run(`./gradle/gradlew -p tests/output/java test --rerun ${filter((f) => `--tests 'com.algolia.${f}*'`)}`, {
Expand All @@ -70,6 +73,7 @@ async function runCtsOne(language: Language, suites: Record<CTSType, boolean>):
case 'javascript':
await run(`YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install && yarn test ${filter((f) => `src/${f}`)}`, {
cwd,
language,
});
break;
case 'kotlin':
Expand Down
5 changes: 3 additions & 2 deletions scripts/cts/testServer/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export function printBenchmarkReport(): void {
const times: Array<{ lang: string; rate: number }> = [];
for (const lang of Object.keys(benchmarkStatus)) {
const status = benchmarkStatus[lang];
expect(status.requestTimes).to.have.length(1000);
const rate = 1000000 / (status.requestTimes.at(-1)! - status.requestTimes[0]);
expect(status.requestTimes).to.have.length(2000);
status.requestTimes.sort((a, b) => a - b);
const rate = (status.requestTimes.length * 1000) / (status.requestTimes.at(-1)! - status.requestTimes[0]);
times.push({ lang, rate });
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function formatter(language: string, cwd: string): Promise<void> {
);
break;
case 'javascript':
await run(`yarn eslint --ext=ts,json ${cwd} --fix --no-error-on-unmatched-pattern`);
await run(`yarn eslint --ext=ts,json ${cwd} --fix --no-error-on-unmatched-pattern`, { language });
break;
case 'kotlin':
await run(`./gradle/gradlew -p ${cwd} spotlessApply`, { language });
Expand Down
2 changes: 1 addition & 1 deletion scripts/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function playground({ language, client }: { language: AllLanguage;
});
break;
case 'javascript':
await run(`yarn workspace javascript-playground start ${client}`);
await run(`yarn workspace javascript-playground start ${client}`, { language });
break;
case 'java':
await run(
Expand Down
16 changes: 0 additions & 16 deletions templates/go/tests/client/benchmark.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ import (
"github.com/algolia/algoliasearch-client-go/v4/algolia/call"
)

func create{{#lambda.titlecase}}{{clientPrefix}}{{/lambda.titlecase}}Client(t *testing.T) (*{{clientPrefix}}.APIClient, *tests.EchoRequester) {
echo := &tests.EchoRequester{}
cfg := {{clientPrefix}}.{{clientName}}Configuration{
Configuration: transport.Configuration{
AppID: "appID",
ApiKey: "apiKey",
Requester: echo,
},{{#hasRegionalHost}}
Region: {{clientPrefix}}.{{#lambda.uppercase}}{{defaultRegion}}{{/lambda.uppercase}},{{/hasRegionalHost}}
}
client, err := {{clientPrefix}}.NewClientWithConfig(cfg)
require.NoError(t, err)

return client, echo
}

{{#blocksBenchmark}}
{{> tests/client/tests}}
{{/blocksBenchmark}}
2 changes: 1 addition & 1 deletion tests/CTS/benchmark/search/benchmark.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"type": "method",
"method": "search",
"times": 1000,
"times": 2000,
"parameters": {
"requests": [
{
Expand Down
Loading