feat: 重构测试框架并优化代码结构

refactor(tests): 将e2e_tests迁移到tests_suite和api_integration_tests
style: 为Java类添加文档注释
docs: 更新.gitignore和配置文件
test: 添加性能测试和Playwright测试脚本
chore: 清理旧测试文件和配置
This commit is contained in:
张翔
2026-03-14 13:49:39 +08:00
parent 9e187f42e5
commit c50ccd258f
178 changed files with 8655 additions and 2519 deletions
+41
View File
@@ -0,0 +1,41 @@
import http from 'k6/http';
import { check, sleep } from 'k6';
const BASE_URL = __ENV.BASE_URL || 'http://localhost:8080';
const TEST_DURATION = __ENV.DURATION || '30s';
const VUS = __ENV.VUS || '10';
export let options = {
scenarios: {
constant_load: {
executor: 'constant-vus',
vus: parseInt(VUS),
duration: TEST_DURATION,
startTime: '0s',
},
},
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.05'],
},
};
export default function () {
let responses = http.batch([
['GET', `${BASE_URL}/actuator/health`, null, null],
['GET', `${BASE_URL}/actuator/info`, null, null],
]);
responses.forEach((res) => {
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
});
sleep(1);
}
export function teardown() {
console.log('Performance test completed');
}