From fb4b68daca03df6127e7ea6f3c788394c91ce10a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Wed, 15 Sep 2021 02:32:16 -0500 Subject: [PATCH] fix: increase test timeout --- src/chocolatey/__tests__/chocolatey.test.ts | 3 +-- src/cmake/__tests__/cmake.test.ts | 3 +-- src/conan/__tests__/conan.test.ts | 3 +-- src/gcovr/__tests__/gcovr.test.ts | 3 +-- src/llvm/__tests__/llvm.test.ts | 3 +-- src/meson/__tests__/meson.test.ts | 3 +-- src/ninja/__tests__/ninja.test.ts | 3 +-- src/utils/tests/test-helpers.ts | 8 ++++++-- 8 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/chocolatey/__tests__/chocolatey.test.ts b/src/chocolatey/__tests__/chocolatey.test.ts index b6ba4329..aa7fe87c 100644 --- a/src/chocolatey/__tests__/chocolatey.test.ts +++ b/src/chocolatey/__tests__/chocolatey.test.ts @@ -1,8 +1,7 @@ import { setupChocolatey } from "../chocolatey" import { spawnSync as spawn } from "child_process" -jest.setTimeout(100000) - +jest.setTimeout(200000) describe("setup-chocolatey", () => { it("should setup chocolatey", async () => { if (process.platform !== "win32") { diff --git a/src/cmake/__tests__/cmake.test.ts b/src/cmake/__tests__/cmake.test.ts index bcd97d3b..d3e76789 100644 --- a/src/cmake/__tests__/cmake.test.ts +++ b/src/cmake/__tests__/cmake.test.ts @@ -1,8 +1,7 @@ import { setupCmake } from "../cmake" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" -jest.setTimeout(100000) - +jest.setTimeout(200000) async function testCmake(directory: string) { const { binDir } = await setupCmake("3.20.2", directory) testBin("cmake", binDir) diff --git a/src/conan/__tests__/conan.test.ts b/src/conan/__tests__/conan.test.ts index 88e5b1e2..7def5a79 100644 --- a/src/conan/__tests__/conan.test.ts +++ b/src/conan/__tests__/conan.test.ts @@ -1,8 +1,7 @@ import { setupConan } from "../conan" import { spawnSync as spawn } from "child_process" -jest.setTimeout(100000) - +jest.setTimeout(200000) describe("setup-conan", () => { it("should setup conan", async () => { await setupConan("1.40.1") diff --git a/src/gcovr/__tests__/gcovr.test.ts b/src/gcovr/__tests__/gcovr.test.ts index 83f31f8e..197de9c6 100644 --- a/src/gcovr/__tests__/gcovr.test.ts +++ b/src/gcovr/__tests__/gcovr.test.ts @@ -1,8 +1,7 @@ import { setupGcovr } from "../gcovr" import { spawnSync as spawn } from "child_process" -jest.setTimeout(100000) - +jest.setTimeout(200000) describe("setup-gcovr", () => { it("should setup gcovr", async () => { await setupGcovr("5.0") diff --git a/src/llvm/__tests__/llvm.test.ts b/src/llvm/__tests__/llvm.test.ts index a7fb9ee5..54f6c18c 100644 --- a/src/llvm/__tests__/llvm.test.ts +++ b/src/llvm/__tests__/llvm.test.ts @@ -5,8 +5,7 @@ import { addBinExtension } from "../../utils/setup/setupBin" import { join } from "path" import { spawnSync as spawn } from "child_process" -jest.setTimeout(100000) - +jest.setTimeout(200000) async function testUrl(version: string) { const [specificVersion, url] = await getSpecificVersionAndUrl(process.platform, version) diff --git a/src/meson/__tests__/meson.test.ts b/src/meson/__tests__/meson.test.ts index d3ca9061..7e02062e 100644 --- a/src/meson/__tests__/meson.test.ts +++ b/src/meson/__tests__/meson.test.ts @@ -1,8 +1,7 @@ import { setupMeson } from "../meson" import { spawnSync as spawn } from "child_process" -jest.setTimeout(100000) - +jest.setTimeout(200000) describe("setup-meson", () => { it("should setup meson", async () => { await setupMeson("0.59.1") diff --git a/src/ninja/__tests__/ninja.test.ts b/src/ninja/__tests__/ninja.test.ts index 5df2fd30..954a44e6 100644 --- a/src/ninja/__tests__/ninja.test.ts +++ b/src/ninja/__tests__/ninja.test.ts @@ -1,8 +1,7 @@ import { setupNinja } from "../ninja" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" -jest.setTimeout(100000) - +jest.setTimeout(200000) async function testNinja(directory: string) { const { binDir } = await setupNinja("1.10.2", directory) testBin("ninja", binDir) diff --git a/src/utils/tests/test-helpers.ts b/src/utils/tests/test-helpers.ts index 389d06d1..e6a98031 100644 --- a/src/utils/tests/test-helpers.ts +++ b/src/utils/tests/test-helpers.ts @@ -7,8 +7,12 @@ import { join } from "path" export async function setupTmpDir(testName: string) { const tempDirectory = path.join(tmpdir(), "setup-cpp", testName) - await io.rmRF(tempDirectory) - await io.mkdirP(tempDirectory) + try { + await io.rmRF(tempDirectory) + await io.mkdirP(tempDirectory) + } catch { + console.log("Failed to remove test directories") + } process.env.SETUP_CPP_DIR = tempDirectory const toolCache = path.join(tmpdir(), "setup-cpp", "ToolCache")