fix: increase test timeout

This commit is contained in:
Amin Yahyaabadi 2021-09-15 02:32:16 -05:00
parent db46f34a80
commit fb4b68daca
8 changed files with 13 additions and 16 deletions

View File

@ -1,8 +1,7 @@
import { setupChocolatey } from "../chocolatey" import { setupChocolatey } from "../chocolatey"
import { spawnSync as spawn } from "child_process" import { spawnSync as spawn } from "child_process"
jest.setTimeout(100000) jest.setTimeout(200000)
describe("setup-chocolatey", () => { describe("setup-chocolatey", () => {
it("should setup chocolatey", async () => { it("should setup chocolatey", async () => {
if (process.platform !== "win32") { if (process.platform !== "win32") {

View File

@ -1,8 +1,7 @@
import { setupCmake } from "../cmake" import { setupCmake } from "../cmake"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(100000) jest.setTimeout(200000)
async function testCmake(directory: string) { async function testCmake(directory: string) {
const { binDir } = await setupCmake("3.20.2", directory) const { binDir } = await setupCmake("3.20.2", directory)
testBin("cmake", binDir) testBin("cmake", binDir)

View File

@ -1,8 +1,7 @@
import { setupConan } from "../conan" import { setupConan } from "../conan"
import { spawnSync as spawn } from "child_process" import { spawnSync as spawn } from "child_process"
jest.setTimeout(100000) jest.setTimeout(200000)
describe("setup-conan", () => { describe("setup-conan", () => {
it("should setup conan", async () => { it("should setup conan", async () => {
await setupConan("1.40.1") await setupConan("1.40.1")

View File

@ -1,8 +1,7 @@
import { setupGcovr } from "../gcovr" import { setupGcovr } from "../gcovr"
import { spawnSync as spawn } from "child_process" import { spawnSync as spawn } from "child_process"
jest.setTimeout(100000) jest.setTimeout(200000)
describe("setup-gcovr", () => { describe("setup-gcovr", () => {
it("should setup gcovr", async () => { it("should setup gcovr", async () => {
await setupGcovr("5.0") await setupGcovr("5.0")

View File

@ -5,8 +5,7 @@ import { addBinExtension } from "../../utils/setup/setupBin"
import { join } from "path" import { join } from "path"
import { spawnSync as spawn } from "child_process" import { spawnSync as spawn } from "child_process"
jest.setTimeout(100000) jest.setTimeout(200000)
async function testUrl(version: string) { async function testUrl(version: string) {
const [specificVersion, url] = await getSpecificVersionAndUrl(process.platform, version) const [specificVersion, url] = await getSpecificVersionAndUrl(process.platform, version)

View File

@ -1,8 +1,7 @@
import { setupMeson } from "../meson" import { setupMeson } from "../meson"
import { spawnSync as spawn } from "child_process" import { spawnSync as spawn } from "child_process"
jest.setTimeout(100000) jest.setTimeout(200000)
describe("setup-meson", () => { describe("setup-meson", () => {
it("should setup meson", async () => { it("should setup meson", async () => {
await setupMeson("0.59.1") await setupMeson("0.59.1")

View File

@ -1,8 +1,7 @@
import { setupNinja } from "../ninja" import { setupNinja } from "../ninja"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(100000) jest.setTimeout(200000)
async function testNinja(directory: string) { async function testNinja(directory: string) {
const { binDir } = await setupNinja("1.10.2", directory) const { binDir } = await setupNinja("1.10.2", directory)
testBin("ninja", binDir) testBin("ninja", binDir)

View File

@ -7,8 +7,12 @@ import { join } from "path"
export async function setupTmpDir(testName: string) { export async function setupTmpDir(testName: string) {
const tempDirectory = path.join(tmpdir(), "setup-cpp", testName) const tempDirectory = path.join(tmpdir(), "setup-cpp", testName)
try {
await io.rmRF(tempDirectory) await io.rmRF(tempDirectory)
await io.mkdirP(tempDirectory) await io.mkdirP(tempDirectory)
} catch {
console.log("Failed to remove test directories")
}
process.env.SETUP_CPP_DIR = tempDirectory process.env.SETUP_CPP_DIR = tempDirectory
const toolCache = path.join(tmpdir(), "setup-cpp", "ToolCache") const toolCache = path.join(tmpdir(), "setup-cpp", "ToolCache")