feat(test): add a performance test in asian language (#25392)

This commit is contained in:
cynthialong0-0
2026-04-14 11:43:36 -07:00
committed by GitHub
parent 88ddcab616
commit 8f6edc50c1
3 changed files with 37 additions and 0 deletions

View File

@@ -12,6 +12,11 @@
"cpuTotalUs": 12157,
"timestamp": "2026-04-08T22:28:19.098Z"
},
"asian-language-conv": {
"wallClockMs": 2315.1,
"cpuTotalUs": 6283,
"timestamp": "2026-04-14T15:22:56.133Z"
},
"skill-loading-time": {
"wallClockMs": 930.0920409999962,
"cpuTotalUs": 1323,

View File

@@ -98,6 +98,36 @@ describe('CPU Performance Tests', () => {
}
});
it('asian-language-conv: verify perf is acceptable ', async () => {
const result = await harness.runScenario(
'asian-language-conv',
async () => {
const rig = new TestRig();
try {
rig.setup('perf-asian-language', {
fakeResponsesPath: join(__dirname, 'perf.asian-language.responses'),
});
return await harness.measure('asian-language', async () => {
await rig.run({
args: ['嗨'],
timeout: 120000,
env: { GEMINI_API_KEY: 'fake-perf-test-key' },
});
});
} finally {
await rig.cleanup();
}
},
);
if (UPDATE_BASELINES) {
harness.updateScenarioBaseline(result);
} else {
harness.assertWithinBaseline(result);
}
});
it('skill-loading-time: startup with many skills within baseline', async () => {
const SKILL_COUNT = 20;

View File

@@ -0,0 +1,2 @@
{"method":"generateContent","response":{"candidates":[{"content":{"parts":[{"text":"0"}],"role":"model"},"finishReason":"STOP","index":0}]}}
{"method":"generateContentStream","response":[{"candidates":[{"content":{"parts":[{"text":"你好!我是 Gemini CLI你的 AI 编程助手"}],"role":"model"},"finishReason":"STOP","index":0}],"usageMetadata":{"promptTokenCount":20648,"candidatesTokenCount":12,"totalTokenCount":20769,"promptTokensDetails":[{"modality":"TEXT","tokenCount":5}]}}]}