use config.configDir as cwd
This commit is contained in:
parent
6e2f581a3c
commit
7716b23c14
|
|
@ -234,7 +234,7 @@ function createLoadTask(mode: 'out-of-process' | 'in-process', options: { filter
|
||||||
if (testRun.config.cliOnlyChanged && options.filterOnlyChanged) {
|
if (testRun.config.cliOnlyChanged && options.filterOnlyChanged) {
|
||||||
for (const plugin of testRun.config.plugins)
|
for (const plugin of testRun.config.plugins)
|
||||||
await plugin.instance?.populateDependencies?.();
|
await plugin.instance?.populateDependencies?.();
|
||||||
const changedFiles = await detectChangedFiles(testRun.config.cliOnlyChanged);
|
const changedFiles = await detectChangedFiles(testRun.config.cliOnlyChanged, testRun.config.configDir);
|
||||||
cliOnlyChangedMatcher = file => changedFiles.has(file);
|
cliOnlyChangedMatcher = file => changedFiles.has(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ import childProcess from 'child_process';
|
||||||
import { affectedTestFiles } from '../transform/compilationCache';
|
import { affectedTestFiles } from '../transform/compilationCache';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
export async function detectChangedFiles(baseCommit: string): Promise<Set<string>> {
|
export async function detectChangedFiles(baseCommit: string, configDir: string): Promise<Set<string>> {
|
||||||
function gitFileList(command: string) {
|
function gitFileList(command: string) {
|
||||||
try {
|
try {
|
||||||
return childProcess.execSync(
|
return childProcess.execSync(
|
||||||
`git ${command}`,
|
`git ${command}`,
|
||||||
{ encoding: 'utf-8', stdio: 'pipe' }
|
{ encoding: 'utf-8', stdio: 'pipe', cwd: configDir }
|
||||||
).split('\n').filter(Boolean);
|
).split('\n').filter(Boolean);
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
const error = _error as childProcess.SpawnSyncReturns<string>;
|
const error = _error as childProcess.SpawnSyncReturns<string>;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue