Skip to content

Commit

Permalink
fix(integ-tests): only checkout example dir when running locally
Browse files Browse the repository at this point in the history
To prevent ".git/index.lock: File exists." errors.
  • Loading branch information
eysi09 committed Jun 13, 2019
1 parent 85c80f2 commit 0a1b3a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions garden-service/test/integ/src/pre-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const prereleaseSequences: ProjectName[] = [
]

export const sequencesToRun = parsedArgs["only"] ? [parsedArgs["only"]] : prereleaseSequences
// We assume tests are running remotely in CI if env is passed, otherwise locally.
const env = parsedArgs["env"]

export function getProjectNamespace(project: ProjectName) {
Expand Down Expand Up @@ -86,8 +87,11 @@ describe("PreReleaseTests", () => {
// This adds a lot of time to the test run.
// tslint:disable-next-line: no-floating-promises
deleteExampleNamespaces(namespaces)
mlog.log("Checking out example project directories to HEAD")
await execa("git", ["checkout", examplesDir])
// Checkout changes to example dir when running locally
if (!env) {
mlog.log("Checking out example project directories to HEAD")
await execa("git", ["checkout", examplesDir])
}
})

if (sequencesToRun.includes("demo-project")) {
Expand Down

0 comments on commit 0a1b3a2

Please sign in to comment.