From 72e8734b2399a2aa3cb6f37e4a41f21292333f96 Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Fri, 16 Jun 2023 01:03:53 -0700 Subject: [PATCH] test: speed up by avoiding hashing files in temp project directories --- core/test/helpers.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/test/helpers.ts b/core/test/helpers.ts index 3cc039ebb9..d1bf662964 100644 --- a/core/test/helpers.ts +++ b/core/test/helpers.ts @@ -75,6 +75,7 @@ import { baseServiceSpecSchema } from "../src/config/service" import { localConfigFilename } from "../src/config-store/local" import { GraphResultMapWithoutTask } from "../src/graph/results" import { dumpYaml } from "../src/util/serialization" +import { exec } from "../src/util/util" export { TempDirectory, makeTempDir } from "../src/util/fs" export { TestGarden, TestError, TestEventBus, expectError, expectFuzzyMatch } from "../src/util/testing" @@ -502,6 +503,11 @@ export const makeTestGarden = profileAsync(async function _makeTestGarden( }, }) + // Add files to git to avoid having to hash all the files + await exec("git", ["add", "."], { cwd: targetRoot }) + // Note: This will error if there are no files added, hence reject=false + await exec("git", ["commit", "-m", "copied"], { cwd: targetRoot, reject: false }) + if (opts.config?.path) { opts.config.path = targetRoot }