Skip to content

Commit

Permalink
Merge pull request #589 from desktop/remove-trampoline-tests
Browse files Browse the repository at this point in the history
Remove trampoline-related tests
  • Loading branch information
niik authored Oct 21, 2024
2 parents ca11a32 + 180ea77 commit 4df7225
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 102 deletions.
6 changes: 0 additions & 6 deletions test/auth/ask-pass.bat

This file was deleted.

3 changes: 0 additions & 3 deletions test/auth/ask-pass.sh

This file was deleted.

28 changes: 0 additions & 28 deletions test/auth/main.ts

This file was deleted.

7 changes: 1 addition & 6 deletions test/fast/git-process-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
} from '../helpers'

import { gitVersion } from '../helpers'
import { setupNoAuth } from '../slow/auth'
import { pathToFileURL } from 'url'
import { track } from 'temp'
import assert from 'assert'
Expand All @@ -30,9 +29,6 @@ describe('git-process', () => {
it('can cancel in-progress git command', async () => {
const sourceRepoPath = temp.mkdirSync('desktop-git-clone-source')
const destinationRepoPath = temp.mkdirSync('desktop-git-clone-destination')
const options = {
env: setupNoAuth(),
}

await GitProcess.exec(['init'], sourceRepoPath)
await GitProcess.exec(
Expand All @@ -42,8 +38,7 @@ describe('git-process', () => {

const task = GitProcess.execTask(
['clone', '--', pathToFileURL(sourceRepoPath).toString(), '.'],
destinationRepoPath,
options
destinationRepoPath
)

const cancelResult = await task.cancel()
Expand Down
42 changes: 0 additions & 42 deletions test/slow/auth.ts

This file was deleted.

26 changes: 9 additions & 17 deletions test/slow/git-process-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as Path from 'path'

import { GitProcess, GitError } from '../../lib'
import { initialize, verify } from '../helpers'
import { setupAskPass, setupNoAuth } from './auth'
import { pathToFileURL } from 'url'
import { resolve } from 'path'
import { createServer } from 'http'
Expand All @@ -17,9 +16,6 @@ describe('git-process', () => {
describe('clone', () => {
it("returns exit code when repository doesn't exist", async () => {
const testRepoPath = temp.mkdirSync('desktop-git-test-blank')
const options = {
env: setupNoAuth(),
}

const result = await GitProcess.exec(
[
Expand All @@ -28,8 +24,7 @@ describe('git-process', () => {
pathToFileURL(resolve('i-for-sure-donut-exist')).toString(),
'.',
],
testRepoPath,
options
testRepoPath
)

verify(result, r => {
Expand All @@ -40,7 +35,11 @@ describe('git-process', () => {
it('returns exit code and error when repository requires credentials', async () => {
const testRepoPath = temp.mkdirSync('desktop-git-test-blank')
const options = {
env: setupAskPass('error', 'error'),
env: {
GIT_CONFIG_PARAMETERS: "'credential.helper='",
GIT_TERMINAL_PROMPT: '0',
GIT_ASKPASS: undefined,
},
}

const server = createServer((req, res) => {
Expand All @@ -64,13 +63,14 @@ describe('git-process', () => {

try {
const result = await GitProcess.exec(
['clone', '--', `http://127.0.0.1:${port}/`, '.'],
['clone', '--', `http://foo:bar@127.0.0.1:${port}/`, '.'],
testRepoPath,
options
)
verify(result, r => {
assert.equal(r.exitCode, 128)
})

const error = GitProcess.parseError(result.stderr)
assert.equal(error, GitError.HTTPSAuthenticationFailed)
} finally {
Expand All @@ -95,15 +95,7 @@ describe('git-process', () => {
verify(addRemote, r => {
assert.equal(r.exitCode, 0)
})

const options = {
env: setupNoAuth(),
}
const result = await GitProcess.exec(
['fetch', 'origin'],
testRepoPath,
options
)
const result = await GitProcess.exec(['fetch', 'origin'], testRepoPath)
verify(result, r => {
assert.equal(r.exitCode, 128)
})
Expand Down

0 comments on commit 4df7225

Please sign in to comment.