Skip Ollama integration test in CI environments#12
Conversation
The test 'getContext formats empty results correctly' was attempting to call getContext() which initializes an embedder and tries to connect to Ollama on port 11434. This connection fails in CI environments where Ollama is not running. The test was redundant since: 1. getContext function existence is already tested by the 'exports getContext as a function' test 2. This was an integration test that required external service dependencies 3. Other test suites already verify the core functionality with proper embedder mocking This fix allows the build job to pass without requiring Ollama to be running in CI."
MrDoe
left a comment
There was a problem hiding this comment.
Disable integration tests dependent on Ollama for Github Action. Then restart Action job.
Modified the 'getContext formats empty results correctly' test to skip when running in CI environments (when process.env.CI is set). This allows the test to run locally during development while being skipped in GitHub Actions where Ollama is not available. The test is preserved as a development/integration test for local environments with Ollama running, rather than being completely removed."
Done! I've modified the test to skip when running in CI environments (when Changes in commit cf9c107:
|
There was a problem hiding this comment.
Pull request overview
Adjusts the programmatic API test suite to avoid failing CI runs when the default embedder (Ollama on 127.0.0.1:11434) is unavailable, keeping the integration-style test runnable for local developers.
Changes:
- Conditionally skips the
getContext formats empty results correctlytest when running under CI.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Skip this integration test in CI environments where Ollama is not available | ||
| const testFn = process.env.CI ? it.skip : it; | ||
| testFn("getContext formats empty results correctly", async () => { |
The
npm testcommand in the GitHub Actions build job fails because thegetContext formats empty results correctlytest attempts to initialize an embedder that connects to Ollama on port 11434, which isn't available in the CI environment.Changes
getContext formats empty results correctlytest insrc/__tests__/api.test.tsto skip when running in CIprocess.env.CIis set (GitHub Actions sets this automatically)