feat(tstest): Enhance tstest with fluent API, suite grouping, tag filtering, fixture & snapshot testing, and parallel execution improvements
This commit is contained in:
@@ -99,4 +99,43 @@ export class TestDirectory {
|
||||
}
|
||||
return testFilePaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get test files organized by parallel execution groups
|
||||
* @returns An object with grouped tests
|
||||
*/
|
||||
async getTestFileGroups(): Promise<{
|
||||
serial: string[];
|
||||
parallelGroups: { [groupName: string]: string[] };
|
||||
}> {
|
||||
await this._init();
|
||||
|
||||
const result = {
|
||||
serial: [] as string[],
|
||||
parallelGroups: {} as { [groupName: string]: string[] }
|
||||
};
|
||||
|
||||
for (const testFile of this.testfileArray) {
|
||||
const filePath = testFile.path;
|
||||
const fileName = plugins.path.basename(filePath);
|
||||
|
||||
// Check if file has parallel group pattern
|
||||
const parallelMatch = fileName.match(/\.para__(\d+)\./);
|
||||
|
||||
if (parallelMatch) {
|
||||
const groupNumber = parallelMatch[1];
|
||||
const groupName = `para__${groupNumber}`;
|
||||
|
||||
if (!result.parallelGroups[groupName]) {
|
||||
result.parallelGroups[groupName] = [];
|
||||
}
|
||||
result.parallelGroups[groupName].push(filePath);
|
||||
} else {
|
||||
// File runs serially
|
||||
result.serial.push(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user