feat: add test suite (96 tests) and GitHub Actions CI workflow#400
Open
East-rayyy wants to merge 6 commits into
Open
feat: add test suite (96 tests) and GitHub Actions CI workflow#400East-rayyy wants to merge 6 commits into
East-rayyy wants to merge 6 commits into
Conversation
- Add vitest as root devDependency, add test/test:ci scripts - Remove NODE_PATH=/tmp/node_modules hack from tests/package.json - Add 5 new test files (96 tests total): - translator-request: openaiToClaudeRequest role mapping, tools, thinking - translator-response: claudeToOpenAI + geminiToOpenAI streaming chunks - format-detection: detectFormatByEndpoint for /v1/responses, chat/completions - data-dir: getUserDataDir DATA_DIR, XDG_CONFIG_HOME, platform defaults - provider-models: PROVIDER_MODELS structure, helpers (getProviderModels, etc.) - Add GitHub Actions CI workflow (test on Node 20+22, build, lint)
The commenting/reporting needs write permissions which fork PRs don't get. Split into: - ci.yml: runs tests/build/lint (works for all PRs) - ci-report.yml: posts results comment via workflow_run (runs in base repo context with write permissions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
No CI runs on PRs — a broken build or failing test can slip through without anyone noticing until it ships. The existing test suite also had 2 outdated test files that fail on current master.
What this adds
.github/workflows/ci.yml) — runs on every PR to masterdetectFormatByEndpoint)Lint note
The lint job fails due to pre-existing issues in the codebase (React hooks, setState in effects). Not introduced by this PR. Happy to fix in a follow-up.
@decolua — what do you think about having CI on PRs? If you like this direction I can also add the lint fixes as a separate PR so the whole pipeline goes green. Let me know if you'd prefer a different setup or if testing isn't a priority right now.