Skip to content

Commit c5305ee

Browse files
committed
🤖 style: reduce Ollama test log spam in CI
Quiets verbose output from Ollama integration tests: **CI Changes:** - Added `--silent` flag to jest command (suppresses per-test output) **Test Changes:** - Removed `console.log` statements from `ensureOllamaModel()` - Changed stdio from 'inherit' to 'pipe' to capture output silently - Still capture stderr for error reporting if pull fails - Add explanatory comments about silent mode This dramatically reduces CI log verbosity while maintaining error visibility. _Generated with `cmux`_
1 parent 94cab2c commit c5305ee

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ jobs:
145145

146146
- name: Run Ollama integration tests with coverage
147147
# TEST_OLLAMA=1 enables Ollama-specific tests
148-
run: TEST_INTEGRATION=1 TEST_OLLAMA=1 bun x jest --coverage --maxWorkers=100% tests/ipcMain/ollama.test.ts
148+
# --silent suppresses verbose test output
149+
run: TEST_INTEGRATION=1 TEST_OLLAMA=1 bun x jest --coverage --maxWorkers=100% --silent tests/ipcMain/ollama.test.ts
149150
env:
150151
OLLAMA_BASE_URL: http://localhost:11434/api
151152

tests/ipcMain/ollama.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ async function ensureOllamaModel(model: string): Promise<void> {
4747
const modelExists = modelLines.some((line) => line.includes(model));
4848

4949
if (modelExists) {
50-
console.log(`✓ Ollama model ${model} already available`);
50+
// Model already available (silent in CI to reduce log spam)
5151
return resolve();
5252
}
5353

54-
// Model doesn't exist, pull it
55-
console.log(`Pulling Ollama model ${model}...`);
54+
// Model doesn't exist, pull it (silent in CI to reduce log spam)
5655
const pullProcess = spawn("ollama", ["pull", model], {
57-
stdio: ["ignore", "inherit", "inherit"],
56+
stdio: ["ignore", "pipe", "pipe"], // Capture stdout/stderr instead of inheriting
57+
});
58+
59+
// Capture output for error reporting but don't log progress
60+
let pullStderr = "";
61+
pullProcess.stderr?.on("data", (data) => {
62+
pullStderr += data.toString();
5863
});
5964

6065
const timeout = setTimeout(() => {
@@ -65,9 +70,9 @@ async function ensureOllamaModel(model: string): Promise<void> {
6570
pullProcess.on("close", (pullCode) => {
6671
clearTimeout(timeout);
6772
if (pullCode !== 0) {
68-
reject(new Error(`Failed to pull Ollama model ${model}`));
73+
reject(new Error(`Failed to pull Ollama model ${model}: ${pullStderr}`));
6974
} else {
70-
console.log(`✓ Ollama model ${model} pulled successfully`);
75+
// Model pulled successfully (silent in CI to reduce log spam)
7176
resolve();
7277
}
7378
});

0 commit comments

Comments
 (0)