Commit Graph

12 Commits

Author SHA1 Message Date
SkywalkerJi 430e23f7b5 Merge pull request #229 from xqliu/test/add-ut-infrastructure
test: Add minimal UT infrastructure and fix Issue #227
2025-11-04 00:28:34 +09:00
zbhan 5e3517d62e fix comment 2025-11-02 22:55:27 -05:00
zbhan 9f311580e1 Fix validation logic 2025-11-02 22:49:43 -05:00
zbhan 3c7925dc46 Fix validation 2025-11-02 22:24:31 -05:00
zbhan 89ca3eedcc Fix backend check 2025-11-02 22:15:45 -05:00
zbhan c0a8375466 Fix validation error 2025-11-02 22:11:24 -05:00
zbhan 3f683200a6 fix(workflow): fix github workflow 2025-11-02 21:49:59 -05:00
Luna Martinez 8a4524747f Change permissions from read to write for contents 2025-11-02 21:15:31 -05:00
tangmengqiu 0168f766de fix(ci): Add comprehensive permissions to pr-checks workflow
Add workflow-level default permissions and explicit per-job permissions
following the principle of least privilege:
Workflow-level (default):
- contents: read - Read repository contents
- pull-requests: write - Manage PR labels and comments
- issues: write - Manage issues (PRs are issues in GitHub API)
Job-level overrides:
- validate-pr: Inherits workflow defaults (needs issue/PR write access)
- backend-tests: Downgrade to read-only (no write operations needed)
- frontend-tests: Downgrade to read-only (no write operations needed)
- auto-label: Add missing issues:write (labeler operates on PR issues)
- security-check: Add security-events:write (upload SARIF results)
- secrets-check: Downgrade to read-only (scanning only)
- all-checks: Downgrade to read-only (status checking only)
This fixes:
1. Potential 403 errors when auto-label tries to add labels to PR issues
2. Missing permission for uploading security scan results
3. Overly permissive access for read-only jobs
Related: #282
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-02 18:23:28 -05:00
Liu Xiang Qian cf12be74f5 test: Add minimal UT infrastructure and fix Issue #227
This commit sets up a minimal, KISS-principle testing infrastructure
for both backend and frontend, and includes the fix for Issue #227.
Backend Changes:
- Add Makefile with test commands (test, test-backend, test-frontend, test-coverage)
- Add example test: config/database_test.go
- Fix Go 1.25 printf format string warnings in trader/auto_trader.go
  (Changed log.Printf to log.Print for non-format strings)
- All backend tests pass ✓
Frontend Changes:
- Add Vitest configuration: web/vitest.config.ts (minimal setup)
- Add test utilities: web/src/test/test-utils.tsx
- Add example test: web/src/App.test.tsx
- Add dependencies: vitest, jsdom, @testing-library/react
- All frontend tests pass ✓
Issue #227 Fix:
- Fix AITradersPage to allow editing traders with disabled models/exchanges
- Change validation to use allModels/allExchanges instead of enabledModels/enabledExchanges
- Add comprehensive tests in web/src/components/AITradersPage.test.tsx
- Fixes: https://github.com/tinkle-community/nofx/issues/227
CI/CD:
- Add GitHub Actions workflow: .github/workflows/test.yml
- Non-blocking tests (continue-on-error: true)
- Runs on push/PR to main and dev branches
Test Results:
- Backend: 1 test passing
- Frontend: 5 tests passing (including 4 for Issue #227)
Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-02 10:58:31 +08:00
zbhan 3af9f3e376 fix: github workflow permission 2025-11-01 22:25:32 -04:00
zbhan 2f4f277001 feat: pr validation 2025-11-01 18:25:44 -04:00