mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
test: split cli tests from source tree
This commit is contained in:
parent
7d79d4e38e
commit
4619217804
496 changed files with 2582 additions and 952 deletions
|
|
@ -19,7 +19,7 @@ const RELATIONSHIP_RUNTIME_SOURCES = Object.freeze([
|
|||
]);
|
||||
|
||||
async function checkedInFixtureIds() {
|
||||
const fixtureRoot = new URL('packages/cli/src/test/fixtures/relationship-benchmarks/', KTX_ROOT);
|
||||
const fixtureRoot = new URL('packages/cli/test/fixtures/relationship-benchmarks/', KTX_ROOT);
|
||||
const entries = await readdir(fixtureRoot, { withFileTypes: true });
|
||||
return entries
|
||||
.filter((entry) => entry.isDirectory())
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ describe('buildBenchmarkSnapshot', () => {
|
|||
|
||||
assert.equal(
|
||||
packageJson.scripts['relationships:benchmarks:test'],
|
||||
'KTX_RUN_RELATIONSHIP_BENCHMARKS=1 vitest run src/context/scan/relationship-benchmarks.test.ts',
|
||||
'KTX_RUN_RELATIONSHIP_BENCHMARKS=1 vitest run test/context/scan/relationship-benchmarks.test.ts',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ describe('scanFileContent', () => {
|
|||
it('allows product identifiers in test fixtures', () => {
|
||||
const name = lowerProductName();
|
||||
|
||||
assert.equal(scanFileContent('packages/cli/src/setup.test.ts', `project: ${name}-dev`).length, 0);
|
||||
assert.equal(scanFileContent('packages/cli/src/context/ingest/importer.test.ts', `email: system@${name}.dev`).length, 0);
|
||||
assert.equal(scanFileContent('packages/cli/test/setup.test.ts', `project: ${name}-dev`).length, 0);
|
||||
assert.equal(scanFileContent('packages/cli/test/context/ingest/importer.test.ts', `email: system@${name}.dev`).length, 0);
|
||||
assert.equal(scanFileContent('python/ktx-daemon/tests/test_package.py', `${name}-ktx`).length, 0);
|
||||
});
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ describe('scanFileContent', () => {
|
|||
);
|
||||
assert.deepEqual(
|
||||
scanFileContent(
|
||||
'packages/cli/src/connectors/postgres/dialect.test.ts',
|
||||
'packages/cli/test/connectors/postgres/dialect.test.ts',
|
||||
"import { KtxPostgresDialect } from './dialect.js';",
|
||||
),
|
||||
[],
|
||||
|
|
@ -187,7 +187,7 @@ describe('scanFileContent', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
scanFileContent(
|
||||
'packages/cli/src/context/ingest/page-triage/page-triage.service.test.ts',
|
||||
'packages/cli/test/context/ingest/page-triage/page-triage.service.test.ts',
|
||||
"const model = this.deps.llmProvider.getModelByName('test-model');",
|
||||
),
|
||||
[],
|
||||
|
|
|
|||
|
|
@ -309,10 +309,10 @@ describe('standalone example docs', () => {
|
|||
it('runs the example smoke in the cli smoke script', async () => {
|
||||
const packageJson = JSON.parse(await readText('packages/cli/package.json'));
|
||||
|
||||
assert.match(packageJson.scripts.smoke, /src\/standalone-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.smoke, /src\/example-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.test, /--exclude src\/standalone-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.test, /--exclude src\/example-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.smoke, /test\/standalone-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.smoke, /test\/example-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.test, /--exclude test\/standalone-smoke\.test\.ts/);
|
||||
assert.match(packageJson.scripts.test, /--exclude test\/example-smoke\.test\.ts/);
|
||||
});
|
||||
|
||||
it('documents daemon HTTP database, source generation, LookML, embedding, and code execution support', async () => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import {
|
|||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const ktxRoot = resolve(scriptDir, '..');
|
||||
const fixtureRoot = join(ktxRoot, 'packages/cli/src/test/fixtures/relationship-benchmarks');
|
||||
const fixtureRoot = join(ktxRoot, 'packages/cli/test/fixtures/relationship-benchmarks');
|
||||
|
||||
async function buildDetector() {
|
||||
const backend = process.env.KTX_BENCHMARK_LLM_BACKEND;
|
||||
|
|
|
|||
|
|
@ -14,41 +14,41 @@ function assertScriptContainsAll(script, expected) {
|
|||
|
||||
describe('test tiering', () => {
|
||||
const cliSlowTests = [
|
||||
'src/setup-databases.test.ts',
|
||||
'src/scan.test.ts',
|
||||
'src/commands/connection-metabase-setup.test.ts',
|
||||
'src/setup-models.test.ts',
|
||||
'src/setup-sources.test.ts',
|
||||
'src/setup.test.ts',
|
||||
'src/connection.test.ts',
|
||||
'src/setup-embeddings.test.ts',
|
||||
'src/ingest.test.ts',
|
||||
'src/commands/connection-mapping.test.ts',
|
||||
'src/ingest-viz.test.ts',
|
||||
'src/demo.test.ts',
|
||||
'src/setup-project.test.ts',
|
||||
'src/sl.test.ts',
|
||||
'src/local-scan-connectors.test.ts',
|
||||
'src/commands/connection-notion.test.ts',
|
||||
'test/setup-databases.test.ts',
|
||||
'test/scan.test.ts',
|
||||
'test/commands/connection-metabase-setup.test.ts',
|
||||
'test/setup-models.test.ts',
|
||||
'test/setup-sources.test.ts',
|
||||
'test/setup.test.ts',
|
||||
'test/connection.test.ts',
|
||||
'test/setup-embeddings.test.ts',
|
||||
'test/ingest.test.ts',
|
||||
'test/commands/connection-mapping.test.ts',
|
||||
'test/ingest-viz.test.ts',
|
||||
'test/demo.test.ts',
|
||||
'test/setup-project.test.ts',
|
||||
'test/sl.test.ts',
|
||||
'test/local-scan-connectors.test.ts',
|
||||
'test/commands/connection-notion.test.ts',
|
||||
];
|
||||
|
||||
const contextSlowTests = [
|
||||
'src/context/scan/local-scan.test.ts',
|
||||
'src/context/mcp/local-project-ports.test.ts',
|
||||
'src/context/ingest/local-stage-ingest.test.ts',
|
||||
'src/context/sl/pglite-sl-search-prototype.test.ts',
|
||||
'src/context/core/git.service.test.ts',
|
||||
'src/context/ingest/local-adapters.test.ts',
|
||||
'src/context/ingest/local-bundle-ingest.test.ts',
|
||||
'src/context/ingest/local-metabase-ingest.test.ts',
|
||||
'src/context/sl/local-sl.test.ts',
|
||||
'src/context/search/pglite-owner-process.test.ts',
|
||||
'src/context/scan/local-enrichment-artifacts.test.ts',
|
||||
'src/context/search/pglite-spike.test.ts',
|
||||
'src/context/wiki/local-knowledge.test.ts',
|
||||
'src/context/sl/local-query.test.ts',
|
||||
'src/context/scan/relationship-review-decisions.test.ts',
|
||||
'src/context/scan/relationship-profiling.test.ts',
|
||||
'test/context/scan/local-scan.test.ts',
|
||||
'test/context/mcp/local-project-ports.test.ts',
|
||||
'test/context/ingest/local-stage-ingest.test.ts',
|
||||
'test/context/sl/pglite-sl-search-prototype.test.ts',
|
||||
'test/context/core/git.service.test.ts',
|
||||
'test/context/ingest/local-adapters.test.ts',
|
||||
'test/context/ingest/local-bundle-ingest.test.ts',
|
||||
'test/context/ingest/local-metabase-ingest.test.ts',
|
||||
'test/context/sl/local-sl.test.ts',
|
||||
'test/context/search/pglite-owner-process.test.ts',
|
||||
'test/context/scan/local-enrichment-artifacts.test.ts',
|
||||
'test/context/search/pglite-spike.test.ts',
|
||||
'test/context/wiki/local-knowledge.test.ts',
|
||||
'test/context/sl/local-query.test.ts',
|
||||
'test/context/scan/relationship-review-decisions.test.ts',
|
||||
'test/context/scan/relationship-profiling.test.ts',
|
||||
];
|
||||
|
||||
it('keeps slow package tests out of default local package test scripts', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue