Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trampoline-related tests #589

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -17,7 +17,6 @@ import {
} from '../helpers'

import { gitVersion } from '../helpers'
import { setupNoAuth } from '../slow/auth'
import { pathToFileURL } from 'url'

const temp = require('temp').track()
Expand All @@ -26,9 +25,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 @@ -38,8 +34,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 @@ -14,9 +13,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 @@ -25,8 +21,7 @@ describe('git-process', () => {
pathToFileURL(resolve('i-for-sure-donut-exist')).toString(),
'.',
],
testRepoPath,
options
testRepoPath
)

verify(result, r => {
Expand All @@ -37,7 +32,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 @@ -61,13 +60,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 => {
expect(r.exitCode).toBe(128)
})

const error = GitProcess.parseError(result.stderr)
expect(error).toBe(GitError.HTTPSAuthenticationFailed)
} finally {
Expand All @@ -92,15 +92,7 @@ describe('git-process', () => {
verify(addRemote, r => {
expect(r.exitCode).toBe(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 => {
expect(r.exitCode).toBe(128)
})
Expand Down