Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit c60df30

Browse files
Fixing tests
1 parent d3bd89e commit c60df30

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public void Run(bool firstRun)
8888

8989
var applicationDataPath = Environment.GetSpecialFolder(System.Environment.SpecialFolder.LocalApplicationData).ToNPath();
9090
var installDetails = new GitInstallDetails(applicationDataPath, true);
91-
9291
var gitInstaller = new GitInstaller(Environment, CancellationToken, installDetails);
9392
gitInstaller.SetupGitIfNeeded(new ActionTask<NPath>(CancellationToken, (b, s) => {
9493

src/tests/IntegrationTests/BasePlatformIntegrationTest.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using System;
12
using System.IO;
23
using System.Threading;
34
using System.Threading.Tasks;
45
using GitHub.Unity;
56
using NSubstitute;
7+
using Octokit;
68

79
namespace IntegrationTests
810
{
@@ -29,14 +31,38 @@ protected void InitializePlatform(NPath repoPath, NPath environmentPath, bool en
2931

3032
if (setupGit)
3133
{
34+
var autoResetEvent = new AutoResetEvent(false);
35+
3236
var applicationDataPath = Environment.GetSpecialFolder(System.Environment.SpecialFolder.LocalApplicationData).ToNPath();
3337
var installDetails = new GitInstallDetails(applicationDataPath, true);
34-
//var gitInstallTask = new PortableGitInstallTask(CancellationToken.None, Environment, installDetails);
38+
var gitInstaller = new GitInstaller(Environment, CancellationToken.None, installDetails);
39+
40+
NPath result = null;
41+
Exception ex = null;
42+
43+
gitInstaller.SetupGitIfNeeded(new ActionTask<NPath>(CancellationToken.None, (b, path) => {
44+
result = path;
45+
autoResetEvent.Set();
46+
}),
47+
new ActionTask(CancellationToken.None, (b, exception) => {
48+
ex = exception;
49+
autoResetEvent.Set();
50+
}));
51+
52+
autoResetEvent.WaitOne();
53+
54+
if (result == null)
55+
{
56+
if (ex != null)
57+
{
58+
throw ex;
59+
}
3560

36-
//var installPath = gitInstallTask.Start().Result;
37-
//Environment.GitExecutablePath = installPath;
61+
throw new Exception("Did not install git");
62+
}
3863

39-
//GitClient = new GitClient(Environment, ProcessManager, TaskManager.Token);
64+
Environment.GitExecutablePath = result;
65+
GitClient = new GitClient(Environment, ProcessManager, TaskManager.Token);
4066
}
4167
}
4268
}

0 commit comments

Comments
 (0)