-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
66 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { exec } from '../../../test/childProcessHelper'; | ||
import { getDevAccessToken } from '../../../test/private/getDevAccessToken'; | ||
import { getSandboxPath, resetSandbox } from '../../../test/sandbox'; | ||
import * as childProcess from '../../child-process-promisified'; | ||
import { getRepoOwnerAndNameFromGitRemotes } from './getRepoOwnerAndNameFromGitRemotes'; | ||
|
||
const sandboxPath = getSandboxPath({ filename: __filename }); | ||
|
@@ -11,8 +11,8 @@ describe('fetchRemoteProjectConfig', () => { | |
it('retrives the original owner from github', async () => { | ||
await resetSandbox(sandboxPath); | ||
const execOpts = { cwd: sandboxPath }; | ||
await childProcess.exec(`git init`, execOpts); | ||
await childProcess.exec( | ||
await exec(`git init`, execOpts); | ||
await exec( | ||
`git remote add sorenlouv [email protected]:sorenlouv/kibana.git`, | ||
execOpts, | ||
); | ||
|
@@ -33,16 +33,10 @@ describe('fetchRemoteProjectConfig', () => { | |
it('swallows the error and returns empty', async () => { | ||
await resetSandbox(sandboxPath); | ||
const execOpts = { cwd: sandboxPath }; | ||
await childProcess.exec(`git init`, execOpts); | ||
await childProcess.exec( | ||
`git remote add foo [email protected]:foo/kibana.git`, | ||
execOpts, | ||
); | ||
await exec(`git init`, execOpts); | ||
await exec(`git remote add foo [email protected]:foo/kibana.git`, execOpts); | ||
|
||
await childProcess.exec( | ||
`git remote add bar [email protected]:bar/kibana.git`, | ||
execOpts, | ||
); | ||
await exec(`git remote add bar [email protected]:bar/kibana.git`, execOpts); | ||
|
||
expect( | ||
await getRepoOwnerAndNameFromGitRemotes({ | ||
|
@@ -57,7 +51,7 @@ describe('fetchRemoteProjectConfig', () => { | |
it('returns empty', async () => { | ||
await resetSandbox(sandboxPath); | ||
const execOpts = { cwd: sandboxPath }; | ||
await childProcess.exec(`git init`, execOpts); | ||
await exec(`git init`, execOpts); | ||
|
||
expect( | ||
await getRepoOwnerAndNameFromGitRemotes({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import childProcess from 'child_process'; | ||
import { promisify } from 'util'; | ||
const execPromisified = promisify(childProcess.exec); | ||
|
||
export async function exec( | ||
cmd: string, | ||
options: childProcess.ExecOptions & { cwd: string }, | ||
) { | ||
const res = await execPromisified(cmd, { | ||
maxBuffer: 100 * 1024 * 1024, | ||
...options, | ||
|
||
// ensure that git commands return english error messages | ||
env: { ...process.env, LANG: 'en_US' }, | ||
}); | ||
|
||
return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/test/e2e/cli/gracefully-handles-corrupt-repo.private.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters