Skip to content

Commit d04f4fb

Browse files
committed
fix: remove test discovery from cost command to avoid parsing errors
- Cost estimation now uses configuration file only, avoiding test file parsing issues - Remove SimpleTestDiscovery import and related logic from cost command - Use reasonable default test count (1) when no tests are defined in config - This resolves parsing errors in CI when cost command scans test files
1 parent 8505192 commit d04f4fb

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/commands/cost.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import type { EvaluationConfig } from '../types';
44
import { YamlParser } from '../lib/yaml-parser';
5-
import { SimpleTestDiscovery } from '../lib/simple-test-discovery';
65
import { Logger } from '../utils/logger';
76

87
interface CostOptions {
@@ -115,19 +114,13 @@ export class CostCommand {
115114
throw error;
116115
}
117116

118-
// Discover test cases
117+
// Use test count from configuration only (avoid test discovery parsing issues)
119118
let totalTests = config.tests?.length || 0;
120-
try {
121-
const discovery = new SimpleTestDiscovery();
122-
const discoveredTests = await discovery.discoverAllTests();
123-
totalTests += discoveredTests.length;
124-
125-
if (options.verbose && discoveredTests.length > 0) {
126-
Logger.success(`✓ Found ${discoveredTests.length} additional test case(s)`);
127-
}
128-
} catch (error) {
119+
if (totalTests === 0) {
120+
// Provide a reasonable default for cost estimation
121+
totalTests = 1;
129122
if (options.verbose) {
130-
Logger.warn(`Test discovery failed: ${error instanceof Error ? error.message : error}`);
123+
Logger.info('ℹ No tests defined in configuration, using default count for estimation');
131124
}
132125
}
133126

0 commit comments

Comments
 (0)