fix(qmd): repair integration test, pull models first, reorder CI steps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f21e4fb7c
commit
60f739ceb9
2 files changed
+6
-3
No files matched your search
@@ -184,12 +184,12 @@ jobs:
|
|||||||
node-version: '24'
|
node-version: '24'
|
||||||
- name: Install QMD
|
- name: Install QMD
|
||||||
run: npm install --global @tobilu/qmd@2.8.3
|
run: npm install --global @tobilu/qmd@2.8.3
|
||||||
|
- name: Run QMD unit tests
|
||||||
|
run: node --test scripts/tests/test-qmd-lib.mjs scripts/tests/test-qmd-daemon.mjs scripts/tests/test-qmd-search.mjs scripts/tests/test-qmd-warm.mjs scripts/tests/test-qmd-benchmark.mjs
|
||||||
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||||
with:
|
with:
|
||||||
path: .cache/qmd-models
|
path: .cache/qmd-models
|
||||||
key: qmd-models-${{ runner.os }}-2.8.3-qwen3
|
key: qmd-models-${{ runner.os }}-2.8.3-qwen3
|
||||||
- name: Run QMD unit tests
|
|
||||||
run: node --test scripts/tests/test-qmd-lib.mjs scripts/tests/test-qmd-daemon.mjs scripts/tests/test-qmd-search.mjs scripts/tests/test-qmd-warm.mjs scripts/tests/test-qmd-benchmark.mjs
|
|
||||||
- name: Run QMD integration test with real models
|
- name: Run QMD integration test with real models
|
||||||
env:
|
env:
|
||||||
QMD_TEST_CACHE: ${{ github.workspace }}/.cache/qmd-models
|
QMD_TEST_CACHE: ${{ github.workspace }}/.cache/qmd-models
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { mkdtempSync, mkdirSync, writeFileSync } from 'node:fs';
|
|||||||
import { tmpdir } from 'node:os';
|
import { tmpdir } from 'node:os';
|
||||||
import { join, resolve } from 'node:path';
|
import { join, resolve } from 'node:path';
|
||||||
|
|
||||||
|
import { runQmdCli } from '../../shared/qmd/qmd-lib.mjs';
|
||||||
|
|
||||||
const search =resolve('shared/qmd/qmd-search.mjs');
|
const search =resolve('shared/qmd/qmd-search.mjs');
|
||||||
|
|
||||||
test('wrapper finds the retry logic through the daemon and stops it', { timeout: 1_800_000 }, () => {
|
test('wrapper finds the retry logic through the daemon and stops it', { timeout: 1_800_000 }, () => {
|
||||||
@@ -18,7 +20,8 @@ test('wrapper finds the retry logic through the daemon and stops it', { timeout:
|
|||||||
execFileSync('git', ['add', '-A'], { cwd: repo });
|
execFileSync('git', ['add', '-A'], { cwd: repo });
|
||||||
const env = { ...process.env, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: join(home, '.config'), XDG_CACHE_HOME: process.env.QMD_TEST_CACHE || join(home, '.cache'), QMD_FORCE_CPU: '1' };
|
const env = { ...process.env, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: join(home, '.config'), XDG_CACHE_HOME: process.env.QMD_TEST_CACHE || join(home, '.cache'), QMD_FORCE_CPU: '1' };
|
||||||
execFileSync('node', ['shared/qmd/qmd-config.mjs', 'set-models'], { env });
|
execFileSync('node', ['shared/qmd/qmd-config.mjs', 'set-models'], { env });
|
||||||
|
runQmdCli(['pull'], { env, timeout: 1_700_000, stdio: 'inherit' }); // download models first so the search only measures indexing and query
|
||||||
const results =JSON.parse(execFileSync('node', [search, '--root', repo, '--query', 'Where are failed uploads retried after temporary errors?'], { env, encoding: 'utf8', timeout: 1_700_000 }));
|
const results =JSON.parse(execFileSync('node', [search, '--root', repo, '--query', 'Where are failed uploads retried after temporary errors?'], { env, encoding: 'utf8', timeout: 1_700_000 }));
|
||||||
assert.equal(results[0].path.replace(/\/g, '/'), 'src/upload.ts');
|
assert.equal(results[0].path.replaceAll('\\', '/'), 'src/upload.ts');
|
||||||
execFileSync('node', [search, '--stop'], { env });
|
execFileSync('node', [search, '--stop'], { env });
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user