@git.zone/tstest 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/index.js +9 -2
- package/dist_ts/tstest.classes.tap.parser.d.ts +4 -0
- package/dist_ts/tstest.classes.tap.parser.js +114 -24
- package/dist_ts/tstest.classes.testdirectory.d.ts +10 -0
- package/dist_ts/tstest.classes.testdirectory.js +31 -1
- package/dist_ts/tstest.classes.tstest.d.ts +3 -1
- package/dist_ts/tstest.classes.tstest.js +52 -27
- package/dist_ts_tapbundle/index.d.ts +1 -0
- package/dist_ts_tapbundle/index.js +2 -1
- package/dist_ts_tapbundle/tapbundle.classes.tap.d.ts +54 -1
- package/dist_ts_tapbundle/tapbundle.classes.tap.js +288 -24
- package/dist_ts_tapbundle/tapbundle.classes.taptest.d.ts +7 -1
- package/dist_ts_tapbundle/tapbundle.classes.taptest.js +75 -27
- package/dist_ts_tapbundle/tapbundle.classes.taptools.d.ts +81 -1
- package/dist_ts_tapbundle/tapbundle.classes.taptools.js +180 -2
- package/dist_ts_tapbundle/ts_tapbundle/00_commitinfo_data.d.ts +8 -0
- package/dist_ts_tapbundle/ts_tapbundle/00_commitinfo_data.js +9 -0
- package/dist_ts_tapbundle/ts_tapbundle/index.d.ts +6 -0
- package/dist_ts_tapbundle/ts_tapbundle/index.js +7 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.pretask.d.ts +10 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.pretask.js +13 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.tap.d.ts +104 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.tap.js +401 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.taptest.d.ts +38 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.taptest.js +110 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.taptools.d.ts +109 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.taptools.js +241 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.tapwrap.d.ts +8 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.classes.tapwrap.js +7 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.plugins.d.ts +8 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.plugins.js +10 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.tapcreator.d.ts +3 -0
- package/dist_ts_tapbundle/ts_tapbundle/tapbundle.tapcreator.js +5 -0
- package/dist_ts_tapbundle/ts_tapbundle/webhelpers.d.ts +7 -0
- package/dist_ts_tapbundle/ts_tapbundle/webhelpers.js +35 -0
- package/dist_ts_tapbundle/ts_tapbundle_node/classes.pathinject.d.ts +5 -0
- package/dist_ts_tapbundle/ts_tapbundle_node/classes.pathinject.js +13 -0
- package/dist_ts_tapbundle/ts_tapbundle_node/plugins.d.ts +11 -0
- package/dist_ts_tapbundle/ts_tapbundle_node/plugins.js +14 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.classes.taptest.d.ts +38 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.classes.taptest.js +110 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.classes.taptools.d.ts +109 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.classes.taptools.js +241 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.plugins.d.ts +8 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.plugins.js +10 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.tapcreator.d.ts +3 -0
- package/dist_ts_tapbundle_node/ts_tapbundle/tapbundle.tapcreator.js +5 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.pathinject.d.ts +5 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.pathinject.js +13 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.tapnodetools.d.ts +25 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.tapnodetools.js +81 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.testfileprovider.d.ts +6 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/classes.testfileprovider.js +16 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/index.d.ts +2 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/index.js +3 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/paths.d.ts +2 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/paths.js +4 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/plugins.d.ts +11 -0
- package/dist_ts_tapbundle_node/ts_tapbundle_node/plugins.js +14 -0
- package/package.json +11 -8
- package/readme.plan.md +253 -30
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/index.ts +8 -1
- package/ts/tstest.classes.tap.parser.ts +111 -25
- package/ts/tstest.classes.testdirectory.ts +39 -0
- package/ts/tstest.classes.tstest.ts +61 -27
|
@@ -15,6 +15,7 @@ export class TsTest {
|
|
|
15
15
|
public testDir: TestDirectory;
|
|
16
16
|
public executionMode: TestExecutionMode;
|
|
17
17
|
public logger: TsTestLogger;
|
|
18
|
+
public filterTags: string[];
|
|
18
19
|
|
|
19
20
|
public smartshellInstance = new plugins.smartshell.Smartshell({
|
|
20
21
|
executor: 'bash',
|
|
@@ -25,53 +26,81 @@ export class TsTest {
|
|
|
25
26
|
|
|
26
27
|
public tsbundleInstance = new plugins.tsbundle.TsBundle();
|
|
27
28
|
|
|
28
|
-
constructor(cwdArg: string, testPathArg: string, executionModeArg: TestExecutionMode, logOptions: LogOptions = {}) {
|
|
29
|
+
constructor(cwdArg: string, testPathArg: string, executionModeArg: TestExecutionMode, logOptions: LogOptions = {}, tags: string[] = []) {
|
|
29
30
|
this.executionMode = executionModeArg;
|
|
30
31
|
this.testDir = new TestDirectory(cwdArg, testPathArg, executionModeArg);
|
|
31
32
|
this.logger = new TsTestLogger(logOptions);
|
|
33
|
+
this.filterTags = tags;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
async run() {
|
|
35
|
-
const
|
|
37
|
+
const testGroups = await this.testDir.getTestFileGroups();
|
|
38
|
+
const allFiles = [...testGroups.serial, ...Object.values(testGroups.parallelGroups).flat()];
|
|
36
39
|
|
|
37
40
|
// Log test discovery
|
|
38
41
|
this.logger.testDiscovery(
|
|
39
|
-
|
|
42
|
+
allFiles.length,
|
|
40
43
|
this.testDir.testPath,
|
|
41
44
|
this.executionMode
|
|
42
45
|
);
|
|
43
46
|
|
|
44
47
|
const tapCombinator = new TapCombinator(this.logger); // lets create the TapCombinator
|
|
45
48
|
let fileIndex = 0;
|
|
46
|
-
|
|
49
|
+
|
|
50
|
+
// Execute serial tests first
|
|
51
|
+
for (const fileNameArg of testGroups.serial) {
|
|
47
52
|
fileIndex++;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
default:
|
|
68
|
-
const tapParserNode = await this.runInNode(fileNameArg, fileIndex, fileNamesToRun.length);
|
|
69
|
-
tapCombinator.addTapParser(tapParserNode);
|
|
70
|
-
break;
|
|
53
|
+
await this.runSingleTest(fileNameArg, fileIndex, allFiles.length, tapCombinator);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Execute parallel groups sequentially
|
|
57
|
+
const groupNames = Object.keys(testGroups.parallelGroups).sort();
|
|
58
|
+
for (const groupName of groupNames) {
|
|
59
|
+
const groupFiles = testGroups.parallelGroups[groupName];
|
|
60
|
+
|
|
61
|
+
if (groupFiles.length > 0) {
|
|
62
|
+
this.logger.sectionStart(`Parallel Group: ${groupName}`);
|
|
63
|
+
|
|
64
|
+
// Run all tests in this group in parallel
|
|
65
|
+
const parallelPromises = groupFiles.map(async (fileNameArg) => {
|
|
66
|
+
fileIndex++;
|
|
67
|
+
return this.runSingleTest(fileNameArg, fileIndex, allFiles.length, tapCombinator);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await Promise.all(parallelPromises);
|
|
71
|
+
this.logger.sectionEnd();
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
|
|
73
75
|
tapCombinator.evaluate();
|
|
74
76
|
}
|
|
77
|
+
|
|
78
|
+
private async runSingleTest(fileNameArg: string, fileIndex: number, totalFiles: number, tapCombinator: TapCombinator) {
|
|
79
|
+
switch (true) {
|
|
80
|
+
case process.env.CI && fileNameArg.includes('.nonci.'):
|
|
81
|
+
this.logger.tapOutput(`Skipping ${fileNameArg} - marked as non-CI`);
|
|
82
|
+
break;
|
|
83
|
+
case fileNameArg.endsWith('.browser.ts') || fileNameArg.endsWith('.browser.nonci.ts'):
|
|
84
|
+
const tapParserBrowser = await this.runInChrome(fileNameArg, fileIndex, totalFiles);
|
|
85
|
+
tapCombinator.addTapParser(tapParserBrowser);
|
|
86
|
+
break;
|
|
87
|
+
case fileNameArg.endsWith('.both.ts') || fileNameArg.endsWith('.both.nonci.ts'):
|
|
88
|
+
this.logger.sectionStart('Part 1: Chrome');
|
|
89
|
+
const tapParserBothBrowser = await this.runInChrome(fileNameArg, fileIndex, totalFiles);
|
|
90
|
+
tapCombinator.addTapParser(tapParserBothBrowser);
|
|
91
|
+
this.logger.sectionEnd();
|
|
92
|
+
|
|
93
|
+
this.logger.sectionStart('Part 2: Node');
|
|
94
|
+
const tapParserBothNode = await this.runInNode(fileNameArg, fileIndex, totalFiles);
|
|
95
|
+
tapCombinator.addTapParser(tapParserBothNode);
|
|
96
|
+
this.logger.sectionEnd();
|
|
97
|
+
break;
|
|
98
|
+
default:
|
|
99
|
+
const tapParserNode = await this.runInNode(fileNameArg, fileIndex, totalFiles);
|
|
100
|
+
tapCombinator.addTapParser(tapParserNode);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
75
104
|
|
|
76
105
|
public async runInNode(fileNameArg: string, index: number, total: number): Promise<TapParser> {
|
|
77
106
|
this.logger.testFileStart(fileNameArg, 'node.js', index, total);
|
|
@@ -82,6 +111,11 @@ export class TsTest {
|
|
|
82
111
|
if (process.argv.includes('--web')) {
|
|
83
112
|
tsrunOptions += ' --web';
|
|
84
113
|
}
|
|
114
|
+
|
|
115
|
+
// Set filter tags as environment variable
|
|
116
|
+
if (this.filterTags.length > 0) {
|
|
117
|
+
process.env.TSTEST_FILTER_TAGS = this.filterTags.join(',');
|
|
118
|
+
}
|
|
85
119
|
|
|
86
120
|
const execResultStreaming = await this.smartshellInstance.execStreamingSilent(
|
|
87
121
|
`tsrun ${fileNameArg}${tsrunOptions}`
|