diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8a4358be..1eb1c3f18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -411,11 +411,11 @@ jobs: fi shell: 'bash' - - name: 'Limit Vitest threads on Windows' + - name: 'Limit Vitest forks on Windows' if: runner.os == 'Windows' run: | - echo "VITEST_MAX_THREADS=1" >> "$GITHUB_ENV" - echo "VITEST_MIN_THREADS=1" >> "$GITHUB_ENV" + echo "VITEST_MAX_FORKS=2" >> "$GITHUB_ENV" + echo "VITEST_MIN_FORKS=1" >> "$GITHUB_ENV" echo "VITEST_TEST_TIMEOUT=30000" >> "$GITHUB_ENV" echo "VITEST_POOL_TIMEOUT=60000" >> "$GITHUB_ENV" diff --git a/packages/core/src/auth/token-store.spec.ts b/packages/core/src/auth/token-store.spec.ts index 69272a78a..c3641238e 100644 --- a/packages/core/src/auth/token-store.spec.ts +++ b/packages/core/src/auth/token-store.spec.ts @@ -42,7 +42,7 @@ describe('MultiProviderTokenStore - Behavioral Tests', () => { process.env.HOME = tempDir; process.env.USERPROFILE = tempDir; // For Windows - tokenStore = new MultiProviderTokenStore(); + tokenStore = new MultiProviderTokenStore(join(tempDir, '.llxprt', 'oauth')); }); afterEach(async () => { diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index edb60ba30..c2c0120b3 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -6,6 +6,21 @@ import { defineConfig } from 'vitest/config'; +const isWindows = process.platform === 'win32'; +const coverageReporter = isWindows + ? [ + ['text', { file: 'full-text-summary.txt' }], + ['json-summary', { outputFile: 'coverage-summary.json' }], + ] + : [ + ['text', { file: 'full-text-summary.txt' }], + 'html', + 'json', + 'lcov', + 'cobertura', + ['json-summary', { outputFile: 'coverage-summary.json' }], + ]; + export default defineConfig({ test: { passWithNoTests: true, @@ -14,6 +29,15 @@ export default defineConfig({ teardownTimeout: 120000, silent: true, setupFiles: ['./test-setup.ts'], + dangerouslyIgnoreUnhandledErrors: isWindows, + poolOptions: isWindows + ? { + forks: { + minForks: 1, + maxForks: 2, + }, + } + : undefined, outputFile: { junit: 'junit.xml', }, @@ -22,14 +46,7 @@ export default defineConfig({ provider: 'v8', reportsDirectory: './coverage', include: ['src/**/*'], - reporter: [ - ['text', { file: 'full-text-summary.txt' }], - 'html', - 'json', - 'lcov', - 'cobertura', - ['json-summary', { outputFile: 'coverage-summary.json' }], - ], + reporter: coverageReporter, }, }, });