docs: dịch 22 file Markdown còn lại sang tiếng Việt có dấu (TEC-2881)
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 18s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m15s
Deploy / Build API Image (push) Failing after 28s
Deploy / Build Web Image (push) Failing after 16s
Deploy / Build AI Services Image (push) Failing after 17s
E2E Tests / Playwright E2E (push) Failing after 31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 3s
Security Scanning / Trivy Scan — API Image (push) Failing after 1m46s
Security Scanning / Trivy Scan — Web Image (push) Failing after 1m7s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 53s
Security Scanning / Trivy Filesystem Scan (push) Failing after 35s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 0s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 18s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m15s
Deploy / Build API Image (push) Failing after 28s
Deploy / Build Web Image (push) Failing after 16s
Deploy / Build AI Services Image (push) Failing after 17s
E2E Tests / Playwright E2E (push) Failing after 31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 3s
Security Scanning / Trivy Scan — API Image (push) Failing after 1m46s
Security Scanning / Trivy Scan — Web Image (push) Failing after 1m7s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 53s
Security Scanning / Trivy Filesystem Scan (push) Failing after 35s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 0s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Hoàn tất đợt cuối của nhiệm vụ chuyển toàn bộ tài liệu sang tiếng Việt. Đã dịch 22 file `.md` còn sót (~9.7k dòng) — gồm RUNBOOK, audits, docs/architecture, docs/load-testing, libs READMEs và các quick references. Giữ nguyên code blocks, đường dẫn, identifier kỹ thuật, URL và biến môi trường. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# K6 Load Testing — Quick Start Guide
|
||||
# K6 Load Testing — Hướng Dẫn Bắt Đầu Nhanh
|
||||
|
||||
Get started with K6 load tests for GoodGo Platform API in minutes.
|
||||
Bắt đầu với K6 load tests cho GoodGo Platform API trong vài phút.
|
||||
|
||||
---
|
||||
|
||||
## 1️⃣ Installation
|
||||
## 1️⃣ Cài Đặt
|
||||
|
||||
### macOS
|
||||
```bash
|
||||
@@ -21,16 +21,16 @@ apt-get install k6
|
||||
docker pull grafana/k6:latest
|
||||
```
|
||||
|
||||
### Verify Installation
|
||||
### Xác Minh Cài Đặt
|
||||
```bash
|
||||
k6 version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2️⃣ Setup Test Environment
|
||||
## 2️⃣ Thiết Lập Môi Trường Test
|
||||
|
||||
### Start API & Database
|
||||
### Khởi Động API & Database
|
||||
```bash
|
||||
# Terminal 1: Start all services
|
||||
pnpm dev
|
||||
@@ -39,7 +39,7 @@ pnpm dev
|
||||
pnpm db:seed
|
||||
```
|
||||
|
||||
### Verify API is Running
|
||||
### Xác Minh API Đang Chạy
|
||||
```bash
|
||||
curl http://localhost:3001/api/v1/docs
|
||||
# Should return Swagger UI
|
||||
@@ -47,11 +47,11 @@ curl http://localhost:3001/api/v1/docs
|
||||
|
||||
---
|
||||
|
||||
## 3️⃣ Create Your First K6 Test
|
||||
## 3️⃣ Tạo Test K6 Đầu Tiên
|
||||
|
||||
### Simple Search Load Test
|
||||
### Search Load Test Đơn Giản
|
||||
|
||||
Create file: `load-tests/search.k6.js`
|
||||
Tạo file: `load-tests/search.k6.js`
|
||||
|
||||
```javascript
|
||||
import http from 'k6/http';
|
||||
@@ -101,19 +101,19 @@ export default function() {
|
||||
|
||||
---
|
||||
|
||||
## 4️⃣ Run Your First Test
|
||||
## 4️⃣ Chạy Test Đầu Tiên
|
||||
|
||||
### Local Development
|
||||
### Phát Triển Cục Bộ
|
||||
```bash
|
||||
k6 run load-tests/search.k6.js
|
||||
```
|
||||
|
||||
### With Custom Base URL
|
||||
### Với Base URL Tùy Chỉnh
|
||||
```bash
|
||||
BASE_URL=http://localhost:3001/api/v1 k6 run load-tests/search.k6.js
|
||||
```
|
||||
|
||||
### With Docker
|
||||
### Với Docker
|
||||
```bash
|
||||
docker run -i grafana/k6 run - < load-tests/search.k6.js
|
||||
```
|
||||
@@ -145,9 +145,9 @@ docker run -i grafana/k6 run - < load-tests/search.k6.js
|
||||
|
||||
---
|
||||
|
||||
## 5️⃣ Authentication Test
|
||||
## 5️⃣ Test Authentication
|
||||
|
||||
Create file: `load-tests/auth.k6.js`
|
||||
Tạo file: `load-tests/auth.k6.js`
|
||||
|
||||
```javascript
|
||||
import http from 'k6/http';
|
||||
@@ -212,16 +212,16 @@ export default function() {
|
||||
}
|
||||
```
|
||||
|
||||
### Run Auth Test
|
||||
### Chạy Auth Test
|
||||
```bash
|
||||
k6 run load-tests/auth.k6.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 6️⃣ Listing Creation Test (Authenticated)
|
||||
## 6️⃣ Test Tạo Listing (Đã Xác Thực)
|
||||
|
||||
Create file: `load-tests/listings.k6.js`
|
||||
Tạo file: `load-tests/listings.k6.js`
|
||||
|
||||
```javascript
|
||||
import http from 'k6/http';
|
||||
@@ -319,16 +319,16 @@ export default function() {
|
||||
}
|
||||
```
|
||||
|
||||
### Run Listing Test
|
||||
### Chạy Listing Test
|
||||
```bash
|
||||
k6 run load-tests/listings.k6.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7️⃣ Payment Test
|
||||
## 7️⃣ Test Payment
|
||||
|
||||
Create file: `load-tests/payments.k6.js`
|
||||
Tạo file: `load-tests/payments.k6.js`
|
||||
|
||||
```javascript
|
||||
import http from 'k6/http';
|
||||
@@ -404,16 +404,16 @@ export default function() {
|
||||
}
|
||||
```
|
||||
|
||||
### Run Payment Test
|
||||
### Chạy Payment Test
|
||||
```bash
|
||||
k6 run load-tests/payments.k6.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 8️⃣ Run All Tests with Results
|
||||
## 8️⃣ Chạy Tất Cả Tests Với Kết Quả
|
||||
|
||||
Create file: `load-tests/all-scenarios.k6.js`
|
||||
Tạo file: `load-tests/all-scenarios.k6.js`
|
||||
|
||||
```javascript
|
||||
import http from 'k6/http';
|
||||
@@ -472,7 +472,7 @@ export default function() {
|
||||
}
|
||||
```
|
||||
|
||||
### Run with Summary
|
||||
### Chạy Với Tóm Tắt
|
||||
```bash
|
||||
k6 run load-tests/all-scenarios.k6.js \
|
||||
--vus=50 \
|
||||
@@ -482,21 +482,21 @@ k6 run load-tests/all-scenarios.k6.js \
|
||||
|
||||
---
|
||||
|
||||
## 9️⃣ Generate Reports
|
||||
## 9️⃣ Tạo Báo Cáo
|
||||
|
||||
### JSON Report
|
||||
### Báo Cáo JSON
|
||||
```bash
|
||||
k6 run load-tests/search.k6.js --summary-export=report.json
|
||||
```
|
||||
|
||||
### Upload to Grafana Cloud
|
||||
### Tải Lên Grafana Cloud
|
||||
```bash
|
||||
k6 run load-tests/search.k6.js \
|
||||
--out cloud
|
||||
# Requires: k6 login or K6_CLOUD_TOKEN env var
|
||||
```
|
||||
|
||||
### Generate HTML Report (with extension)
|
||||
### Tạo Báo Cáo HTML (với extension)
|
||||
```bash
|
||||
k6 run load-tests/search.k6.js \
|
||||
--out csv=results.csv
|
||||
@@ -504,9 +504,9 @@ k6 run load-tests/search.k6.js \
|
||||
|
||||
---
|
||||
|
||||
## 🔟 CI Integration
|
||||
## 🔟 Tích Hợp CI
|
||||
|
||||
Create: `.github/workflows/load-test.yml`
|
||||
Tạo: `.github/workflows/load-test.yml`
|
||||
|
||||
```yaml
|
||||
name: Load Tests
|
||||
@@ -576,7 +576,7 @@ jobs:
|
||||
|
||||
---
|
||||
|
||||
## 📊 Common K6 Checks
|
||||
## 📊 Các Check K6 Phổ Biến
|
||||
|
||||
```javascript
|
||||
// HTTP Status
|
||||
@@ -605,55 +605,55 @@ check(res, {
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Debugging
|
||||
## 🛠️ Debug
|
||||
|
||||
### Verbose Output
|
||||
### Output Chi Tiết
|
||||
```bash
|
||||
k6 run -v load-tests/search.k6.js
|
||||
```
|
||||
|
||||
### Show Request/Response
|
||||
### Hiển Thị Request/Response
|
||||
```bash
|
||||
k6 run --http-debug=full load-tests/search.k6.js
|
||||
```
|
||||
|
||||
### Limit to Single VU
|
||||
### Giới Hạn Một VU
|
||||
```bash
|
||||
k6 run --vus=1 --iterations=1 load-tests/search.k6.js
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Next Steps
|
||||
## 📚 Bước Tiếp Theo
|
||||
|
||||
1. **Read Full Guide**: `K6_LOAD_TESTING_GUIDE.md`
|
||||
2. **Check Endpoints**: `K6_ENDPOINTS_SUMMARY.md`
|
||||
3. **Explore K6 Docs**: https://k6.io/docs
|
||||
4. **Community Scripts**: https://github.com/grafana/k6-templates
|
||||
1. **Đọc Hướng Dẫn Đầy Đủ**: `K6_LOAD_TESTING_GUIDE.md`
|
||||
2. **Kiểm Tra Endpoint**: `K6_ENDPOINTS_SUMMARY.md`
|
||||
3. **Khám Phá Tài Liệu K6**: https://k6.io/docs
|
||||
4. **Script Cộng Đồng**: https://github.com/grafana/k6-templates
|
||||
|
||||
---
|
||||
|
||||
## ✅ Troubleshooting
|
||||
## ✅ Xử Lý Sự Cố
|
||||
|
||||
### "connection refused"
|
||||
- Ensure API is running: `pnpm dev`
|
||||
- Check port: 3001
|
||||
- Verify BASE_URL: `http://localhost:3001/api/v1`
|
||||
- Đảm bảo API đang chạy: `pnpm dev`
|
||||
- Kiểm tra port: 3001
|
||||
- Xác minh BASE_URL: `http://localhost:3001/api/v1`
|
||||
|
||||
### "rate limit exceeded"
|
||||
- Auth endpoints: 5/hour limit
|
||||
- Spread requests or use different test data
|
||||
- Check test database has seed data
|
||||
- Endpoint auth: giới hạn 5/giờ
|
||||
- Phân tán request hoặc dùng dữ liệu test khác
|
||||
- Kiểm tra database test có dữ liệu seed
|
||||
|
||||
### "insufficient credits" (payments)
|
||||
- Payments require authenticated user
|
||||
- Create user session first in test
|
||||
- Use test provider credentials
|
||||
- Payment yêu cầu người dùng đã xác thực
|
||||
- Tạo phiên người dùng trước trong test
|
||||
- Sử dụng thông tin xác thực provider test
|
||||
|
||||
### "timeout"
|
||||
- Increase K6 timeout in options
|
||||
- Check API logs for errors
|
||||
- Reduce number of VUs initially
|
||||
- Tăng K6 timeout trong options
|
||||
- Kiểm tra log API để tìm lỗi
|
||||
- Giảm số lượng VU ban đầu
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user