Option to skipSysTests since they dont change branch to branch and ca… (#59025)

This commit is contained in:
Sheetal Nandi 2024-06-26 09:41:01 -07:00 committed by GitHub
parent ef339af128
commit 15f67e0b48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 21 additions and 6 deletions

View File

@ -68,6 +68,7 @@ export default options;
* @property {boolean} fix
* @property {string} browser
* @property {string} tests
* @property {boolean} skipSysTests
* @property {string | boolean} break
* @property {string | boolean} inspect
* @property {string} runners

View File

@ -31,6 +31,7 @@ export const coverageDir = "coverage";
export async function runConsoleTests(runJs, defaultReporter, runInParallel, options = {}) {
const testTimeout = cmdLineOptions.timeout;
const tests = cmdLineOptions.tests;
const skipSysTests = cmdLineOptions.skipSysTests;
const inspect = cmdLineOptions.break || cmdLineOptions.inspect;
const runners = cmdLineOptions.runners;
const light = cmdLineOptions.light;
@ -74,8 +75,8 @@ export async function runConsoleTests(runJs, defaultReporter, runInParallel, opt
console.log(chalk.yellowBright(`[watch] running tests...`));
}
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || shards || shardId) {
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
if (tests || skipSysTests || runners || light || testTimeout || taskConfigsFolder || keepFailed || shards || shardId) {
writeTestConfigFile(tests, skipSysTests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
}
const colors = cmdLineOptions.colors;
@ -180,6 +181,7 @@ export async function cleanTestDirs() {
/**
* used to pass data from command line directly to run.js
* @param {string} tests
* @param {boolean} skipSysTests
* @param {string} runners
* @param {boolean} light
* @param {string} [taskConfigsFolder]
@ -190,9 +192,10 @@ export async function cleanTestDirs() {
* @param {number | undefined} [shards]
* @param {number | undefined} [shardId]
*/
export function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
export function writeTestConfigFile(tests, skipSysTests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
const testConfigContents = JSON.stringify({
test: tests ? [tests] : undefined,
skipSysTests: skipSysTests ? skipSysTests : undefined,
runners: runners ? runners.split(",") : undefined,
light,
workerCount,

View File

@ -88,6 +88,7 @@ const testConfigContent = customConfig && IO.fileExists(customConfig)
export let taskConfigsFolder: string;
export let workerCount: number;
export let runUnitTests: boolean | undefined;
export let skipSysTests: boolean | undefined;
export let stackTraceLimit: number | "full" | undefined;
export let noColors = false;
export let keepFailed = false;
@ -101,6 +102,7 @@ export interface TestConfig {
test?: string[];
runners?: string[];
runUnitTests?: boolean;
skipSysTests?: boolean;
noColors?: boolean;
timeout?: number;
keepFailed?: boolean;
@ -143,6 +145,9 @@ function handleTestConfig() {
if (testConfig.shards) {
setShards(testConfig.shards);
}
if (testConfig.skipSysTests) {
skipSysTests = true;
}
if (testConfig.stackTraceLimit === "full") {
(Error as any).stackTraceLimit = Infinity;

View File

@ -1,6 +1,9 @@
import * as fs from "fs";
import { IO } from "../../_namespaces/Harness.js";
import {
IO,
skipSysTests,
} from "../../_namespaces/Harness.js";
import * as ts from "../../_namespaces/ts.js";
import {
defer,
@ -30,6 +33,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
watchOptions: Pick<ts.WatchOptions, "watchFile">,
getFileName?: (file: string) => string,
) {
if (skipSysTests) return;
it(scenario, async () => {
const fileResult = watchFile(file);
const linkResult = watchFile(link);
@ -191,6 +195,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
link: string,
osFlavor: TestServerHostOsFlavor,
) {
if (skipSysTests) return;
it(`watchDirectory using fsEvents ${osFlavorToString(osFlavor)}`, async () => {
const tableOfEvents: FsEventsForWatchDirectory = osFlavor === TestServerHostOsFlavor.MacOs ?
{
@ -355,6 +360,7 @@ describe("unittests:: sys:: symlinkWatching::", () => {
link: string,
osFlavor: TestServerHostOsFlavor.Windows | TestServerHostOsFlavor.MacOs,
) {
if (skipSysTests) return;
const tableOfEvents: RecursiveFsEventsForWatchDirectory = osFlavor === TestServerHostOsFlavor.MacOs ?
{
fileCreate: [

View File

@ -8,7 +8,7 @@ import {
File,
} from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: services:: findAllReferences", () => {
describe("unittests:: tsserver:: services:: findAllReferences", () => {
it("does not try to open a file in a project that was updated and no longer has the file", () => {
const files: File[] = [
{

View File

@ -8,7 +8,7 @@ import {
File,
} from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: services:: goToDefinition", () => {
describe("unittests:: tsserver:: services:: goToDefinition", () => {
it("does not issue errors on jsdoc in TS", () => {
const files: File[] = [
{