Skip to content

Commit 15f67e0

Browse files
authored
Option to skipSysTests since they dont change branch to branch and ca… (#59025)
1 parent ef339af commit 15f67e0

6 files changed

Lines changed: 21 additions & 6 deletions

File tree

scripts/build/options.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default options;
6868
* @property {boolean} fix
6969
* @property {string} browser
7070
* @property {string} tests
71+
* @property {boolean} skipSysTests
7172
* @property {string | boolean} break
7273
* @property {string | boolean} inspect
7374
* @property {string} runners

scripts/build/tests.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const coverageDir = "coverage";
3131
export async function runConsoleTests(runJs, defaultReporter, runInParallel, options = {}) {
3232
const testTimeout = cmdLineOptions.timeout;
3333
const tests = cmdLineOptions.tests;
34+
const skipSysTests = cmdLineOptions.skipSysTests;
3435
const inspect = cmdLineOptions.break || cmdLineOptions.inspect;
3536
const runners = cmdLineOptions.runners;
3637
const light = cmdLineOptions.light;
@@ -74,8 +75,8 @@ export async function runConsoleTests(runJs, defaultReporter, runInParallel, opt
7475
console.log(chalk.yellowBright(`[watch] running tests...`));
7576
}
7677

77-
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || shards || shardId) {
78-
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
78+
if (tests || skipSysTests || runners || light || testTimeout || taskConfigsFolder || keepFailed || shards || shardId) {
79+
writeTestConfigFile(tests, skipSysTests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
7980
}
8081

8182
const colors = cmdLineOptions.colors;
@@ -180,6 +181,7 @@ export async function cleanTestDirs() {
180181
/**
181182
* used to pass data from command line directly to run.js
182183
* @param {string} tests
184+
* @param {boolean} skipSysTests
183185
* @param {string} runners
184186
* @param {boolean} light
185187
* @param {string} [taskConfigsFolder]
@@ -190,9 +192,10 @@ export async function cleanTestDirs() {
190192
* @param {number | undefined} [shards]
191193
* @param {number | undefined} [shardId]
192194
*/
193-
export function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
195+
export function writeTestConfigFile(tests, skipSysTests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
194196
const testConfigContents = JSON.stringify({
195197
test: tests ? [tests] : undefined,
198+
skipSysTests: skipSysTests ? skipSysTests : undefined,
196199
runners: runners ? runners.split(",") : undefined,
197200
light,
198201
workerCount,

src/testRunner/runner.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const testConfigContent = customConfig && IO.fileExists(customConfig)
8888
export let taskConfigsFolder: string;
8989
export let workerCount: number;
9090
export let runUnitTests: boolean | undefined;
91+
export let skipSysTests: boolean | undefined;
9192
export let stackTraceLimit: number | "full" | undefined;
9293
export let noColors = false;
9394
export let keepFailed = false;
@@ -101,6 +102,7 @@ export interface TestConfig {
101102
test?: string[];
102103
runners?: string[];
103104
runUnitTests?: boolean;
105+
skipSysTests?: boolean;
104106
noColors?: boolean;
105107
timeout?: number;
106108
keepFailed?: boolean;
@@ -143,6 +145,9 @@ function handleTestConfig() {
143145
if (testConfig.shards) {
144146
setShards(testConfig.shards);
145147
}
148+
if (testConfig.skipSysTests) {
149+
skipSysTests = true;
150+
}
146151

147152
if (testConfig.stackTraceLimit === "full") {
148153
(Error as any).stackTraceLimit = Infinity;

src/testRunner/unittests/sys/symlinkWatching.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import * as fs from "fs";
22

3-
import { IO } from "../../_namespaces/Harness.js";
3+
import {
4+
IO,
5+
skipSysTests,
6+
} from "../../_namespaces/Harness.js";
47
import * as ts from "../../_namespaces/ts.js";
58
import {
69
defer,
@@ -30,6 +33,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
3033
watchOptions: Pick<ts.WatchOptions, "watchFile">,
3134
getFileName?: (file: string) => string,
3235
) {
36+
if (skipSysTests) return;
3337
it(scenario, async () => {
3438
const fileResult = watchFile(file);
3539
const linkResult = watchFile(link);
@@ -191,6 +195,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
191195
link: string,
192196
osFlavor: TestServerHostOsFlavor,
193197
) {
198+
if (skipSysTests) return;
194199
it(`watchDirectory using fsEvents ${osFlavorToString(osFlavor)}`, async () => {
195200
const tableOfEvents: FsEventsForWatchDirectory = osFlavor === TestServerHostOsFlavor.MacOs ?
196201
{
@@ -355,6 +360,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
355360
link: string,
356361
osFlavor: TestServerHostOsFlavor.Windows | TestServerHostOsFlavor.MacOs,
357362
) {
363+
if (skipSysTests) return;
358364
const tableOfEvents: RecursiveFsEventsForWatchDirectory = osFlavor === TestServerHostOsFlavor.MacOs ?
359365
{
360366
fileCreate: [

src/testRunner/unittests/tsserver/findAllReferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
File,
99
} from "../helpers/virtualFileSystemWithWatch.js";
1010

11-
describe("unittests:: services:: findAllReferences", () => {
11+
describe("unittests:: tsserver:: services:: findAllReferences", () => {
1212
it("does not try to open a file in a project that was updated and no longer has the file", () => {
1313
const files: File[] = [
1414
{

src/testRunner/unittests/tsserver/goToDefinition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
File,
99
} from "../helpers/virtualFileSystemWithWatch.js";
1010

11-
describe("unittests:: services:: goToDefinition", () => {
11+
describe("unittests:: tsserver:: services:: goToDefinition", () => {
1212
it("does not issue errors on jsdoc in TS", () => {
1313
const files: File[] = [
1414
{

0 commit comments

Comments
 (0)