diff --git a/packages/cli/src/context-build-view.ts b/packages/cli/src/context-build-view.ts index 2d8c36bf..0af8ef2f 100644 --- a/packages/cli/src/context-build-view.ts +++ b/packages/cli/src/context-build-view.ts @@ -44,7 +44,7 @@ export interface ContextBuildArgs { depth?: Extract['depth']; queryHistory?: Extract['queryHistory']; queryHistoryWindowDays?: number; - scanMode?: 'structural' | 'enriched'; + scanMode?: Extract['scanMode']; detectRelationships?: boolean; } diff --git a/packages/cli/src/public-ingest.test.ts b/packages/cli/src/public-ingest.test.ts index 149a0a29..11e6b7c6 100644 --- a/packages/cli/src/public-ingest.test.ts +++ b/packages/cli/src/public-ingest.test.ts @@ -466,14 +466,15 @@ describe('runKtxPublicIngest', () => { ).resolves.toBe(1); expect(runIngest).toHaveBeenCalledWith( - { + expect.objectContaining({ command: 'run', projectDir: '/tmp/project', connectionId: 'prod_metabase', adapter: 'metabase', + allowImplicitAdapter: true, outputMode: 'plain', inputMode: 'disabled', - }, + }), expect.anything(), ); expect(runScan).toHaveBeenCalledWith( @@ -550,7 +551,7 @@ describe('runKtxPublicIngest', () => { detectRelationships: true, dryRun: false, }, - io.io, + expect.objectContaining({ capturedOutput: expect.any(Function) }), ); }); diff --git a/packages/cli/src/setup-databases.test.ts b/packages/cli/src/setup-databases.test.ts index abe444a0..5e675ebf 100644 --- a/packages/cli/src/setup-databases.test.ts +++ b/packages/cli/src/setup-databases.test.ts @@ -1231,9 +1231,11 @@ describe('setup databases step', () => { const config = parseKtxProjectConfig(await readFile(join(tempDir, 'ktx.yaml'), 'utf-8')); expect(config.connections.warehouse).toMatchObject({ driver: 'postgres', url: 'env:DATABASE_URL' }); expect(await readFile(join(tempDir, 'ktx.yaml'), 'utf-8')).not.toContain('completed_steps:'); - expect(io.stderr()).toContain('Structural scan failed for warehouse.'); - expect(io.stderr()).toContain('│ Structural scan failed for warehouse.'); - expect(io.stderr()).not.toMatch(/^Structural scan failed for warehouse\./m); + expect(io.stderr()).toContain('Fast database ingest failed for warehouse.'); + expect(io.stderr()).toContain('│ Fast database ingest failed for warehouse.'); + expect(io.stderr()).toContain(`Debug command: ktx ingest warehouse --project-dir ${tempDir} --fast --debug`); + expect(io.stderr()).not.toContain('Structural scan failed for warehouse.'); + expect(io.stderr()).not.toMatch(/^Fast database ingest failed for warehouse\./m); }); it('prints the native SQLite rebuild command when scanning hits a Node ABI mismatch', async () => { @@ -1329,7 +1331,8 @@ describe('setup databases step', () => { expect(scanConnection).toHaveBeenCalledTimes(2); expect(io.stderr()).toContain('Native SQLite is built for a different Node.js ABI.'); expect(io.stderr()).toContain('Rebuilding Native SQLite with pnpm run native:rebuild…'); - expect(io.stdout()).toContain('◇ Scan complete for warehouse'); + expect(io.stdout()).toContain('◇ Schema context complete for warehouse'); + expect(io.stdout()).toContain('│ Changes: 0 changes across 56 tables'); }); it('writes query history config for supported Snowflake databases after validation succeeds', async () => {