Your Name
23113fedf3
test: add timezone package tests
...
Add comprehensive tests for timezone functionality:
- Init (valid/invalid timezones, default)
- getUTCOffset
- Now (with/without location)
- Location (with/without location)
- Name (with/without name)
- StartOfDay, Today, EndOfDay
- StartOfWeek (Monday-based)
- StartOfMonth
- ParseInLocation
- ParseInUserLocation (valid/empty/invalid TZ)
- NowInUserLocation
- StartOfDayInUserLocation
Coverage: timezone 45.2% → 93.5%
2026-05-29 21:20:30 +08:00
Your Name
7014936a75
test: add antigravity OAuth tests
...
Add tests for OAuth functionality:
- GetUserAgent
- BaseURLs and ForwardBaseURLs
- URLAvailability (mark/unavailable, mark/success, expired)
- SessionStore (set/get/delete, expired sessions)
- Generate functions (random bytes, state, session ID, verifier, challenge)
- base64URLEncode
- BuildAuthorizationURL
- Constants
Coverage: antigravity 19.6% → 27.1%
2026-05-29 21:08:28 +08:00
Your Name
dfca5e2272
test: expand httpclient pool tests
...
Add tests for:
- buildClientKey (consistent hashing)
- buildClientKeyTrimsSpaces
- isValidatedHost (cache hit/miss/expire)
- isValidatedHostNilTransport
- newValidatedTransport
- buildClient (valid options and error cases)
- buildTransport (default and custom values)
Coverage: httpclient 36.5% → 69.8%
2026-05-29 20:52:04 +08:00
Your Name
65309b95e7
test: add oauth package tests
...
Add tests for OAuth helper functions:
- GenerateRandomBytes
- GenerateState
- GenerateSessionID
- GenerateCodeVerifier
- GenerateCodeChallenge
- base64URLEncode
- BuildAuthorizationURL
- Constants and types
Coverage: oauth 15.9% → 47.6%
2026-05-29 20:50:16 +08:00
Your Name
abcbc4e58d
test: add antigravity model functions tests
...
Add tests for model-related functions:
- DefaultModels
- DefaultGeminiModels
- FallbackGeminiModelsList
- FallbackGeminiModel
- ClaudeModels/GeminiModels verification
Coverage: antigravity 18.8% → 19.6%
2026-05-29 20:48:12 +08:00
Your Name
e267bb8400
test: add openai request helper tests
...
Add tests for Codex client detection functions:
- IsCodexCLIRequest
- IsCodexOfficialClientRequest
- IsCodexOfficialClientOriginator
- IsCodexOfficialClientByHeaders
- normalizeCodexClientHeader
- matchCodexClientHeaderPrefixes
Coverage: openai 34.2% → 34.9%
2026-05-29 20:26:44 +08:00
Your Name
e47dae6fc6
test: add geminicli codeassist types tests
...
- Add TierInfo UnmarshalJSON tests
- Add LoadCodeAssistResponse GetTier tests
- Add model field tests
2026-05-29 17:43:16 +08:00
Your Name
cd5dae4778
test: add sysutil and cache tests
...
- Add RestartService tests (pkg/sysutil)
- Add decodeRedisValue and normalizeRedisValue tests (cache/l2.go)
2026-05-29 17:38:48 +08:00
Your Name
9cc4305395
test: add pkg tests for gemini, openai, geminicli packages
...
- Add sanitize tests (internal/pkg/geminicli): 55.3%
- Add constants/model tests (internal/pkg/openai): 34.2%
- Add models tests (internal/pkg/gemini): 100%
2026-05-29 16:36:54 +08:00
Your Name
0b17ab42c2
test: improve pkg coverage - pagination and ip packages
...
- Add PaginationParams tests (internal/pkg/pagination): 100%
- Add IP utility function tests (internal/pkg/ip): 80%
Total project coverage: 55.0% (+0.6%)
2026-05-29 16:33:54 +08:00
Your Name
ed399edb5f
test: improve pkg package coverage
...
- Add HTTP status error functions tests (internal/pkg/errors)
- Add ReadRequestBodyWithPrealloc tests (internal/pkg/httputil)
- Add HTTPStatusToGoogleStatus tests (internal/pkg/googleapi)
Coverage improvements:
- pkg/errors: 77.6%
- pkg/httputil: 91.7%
- pkg/googleapi: 79.5%
2026-05-29 16:24:23 +08:00
582ad7a069
test: add comprehensive test coverage and improve code quality
...
- Add new test files for auth, service, and handler modules
- Improve test organization and coverage
- Refactor code for better maintainability
- Add captcha, settings, stats, and theme handler tests
- Add auth module tests (CAS, OAuth, password, SSO, state)
- Add service layer tests for auth, export, permissions, roles
- All Go tests pass (exit code 0)
- All frontend tests pass (325 tests in 59 files)
2026-04-17 20:43:50 +08:00
12a5be9826
fix: suppress gosec G115/G118 false positive warnings
...
- G115 (integer overflow): Added nosec comments for safe type conversions
where values are bounded by design (e.g., rng.Intn(255) returns 0-254)
- G118 (context.Background): Added nosec for intentional async goroutines
that use WithTimeout for bounded execution after request completes
Note: G101 (hardcoded credentials) warnings are low-confidence false
positives - OAuth fields use getEnv() to read from environment.
2026-04-08 22:50:42 +08:00
5dbb530b76
chore: 删除未使用的孤立包
...
清理以下未导入的包:
- internal/response (未使用的响应结构体)
- pkg/response (未使用的响应封装)
- internal/model (TLSFingerprintProfile, ErrorPassthroughRule)
- internal/models (SocialAccount, domain已有)
- internal/pkg/response (未使用的响应封装)
- internal/security/ratelimit (已迁移到middleware)
验证: go build ./... && go test ./... 通过
2026-04-07 17:46:25 +08:00
dcc1f186f8
feat: backend core - auth, user, role, permission, device, webhook, monitoring, cache, repository, service, middleware, API handlers
2026-04-02 11:19:50 +08:00