Skip to content

Commit

Permalink
test: speed up by avoiding hashing files in temp project directories
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jun 16, 2023
1 parent d5176dc commit 72e8734
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 72e8734

Please sign in to comment.