Skip to content

Commit 4731263

Browse files
committed
Comment out Bitbucket tests
1 parent 6490ff1 commit 4731263

File tree

2 files changed

+75
-77
lines changed

2 files changed

+75
-77
lines changed

LibGit2Sharp.Tests/CloneFixture.cs

+23-23
Original file line numberDiff line numberDiff line change
@@ -208,29 +208,29 @@ static Credentials CreateUsernamePasswordCredentials(string user, string pass, b
208208
};
209209
}
210210

211-
[Theory]
212-
[InlineData("https://[email protected]/libgit2/testgitrepository.git", "libgit3", "libgit3", true)]
213-
[InlineData("https://[email protected]/libgit2/testgitrepository.git", "libgit3", "libgit3", false)]
214-
public void CanCloneFromBBWithCredentials(string url, string user, string pass, bool secure)
215-
{
216-
var scd = BuildSelfCleaningDirectory();
217-
218-
string clonedRepoPath = Repository.Clone(url, scd.DirectoryPath, new CloneOptions()
219-
{
220-
CredentialsProvider = (_url, _user, _cred) => CreateUsernamePasswordCredentials(user, pass, secure)
221-
});
222-
223-
using (var repo = new Repository(clonedRepoPath))
224-
{
225-
string dir = repo.Info.Path;
226-
Assert.True(Path.IsPathRooted(dir));
227-
Assert.True(Directory.Exists(dir));
228-
229-
Assert.NotNull(repo.Info.WorkingDirectory);
230-
Assert.Equal(Path.Combine(scd.RootedDirectoryPath, ".git" + Path.DirectorySeparatorChar), repo.Info.Path);
231-
Assert.False(repo.Info.IsBare);
232-
}
233-
}
211+
//[Theory]
212+
//[InlineData("https://[email protected]/libgit2/testgitrepository.git", "libgit3", "libgit3", true)]
213+
//[InlineData("https://[email protected]/libgit2/testgitrepository.git", "libgit3", "libgit3", false)]
214+
//public void CanCloneFromBBWithCredentials(string url, string user, string pass, bool secure)
215+
//{
216+
// var scd = BuildSelfCleaningDirectory();
217+
218+
// string clonedRepoPath = Repository.Clone(url, scd.DirectoryPath, new CloneOptions()
219+
// {
220+
// CredentialsProvider = (_url, _user, _cred) => CreateUsernamePasswordCredentials(user, pass, secure)
221+
// });
222+
223+
// using (var repo = new Repository(clonedRepoPath))
224+
// {
225+
// string dir = repo.Info.Path;
226+
// Assert.True(Path.IsPathRooted(dir));
227+
// Assert.True(Directory.Exists(dir));
228+
229+
// Assert.NotNull(repo.Info.WorkingDirectory);
230+
// Assert.Equal(Path.Combine(scd.RootedDirectoryPath, ".git" + Path.DirectorySeparatorChar), repo.Info.Path);
231+
// Assert.False(repo.Info.IsBare);
232+
// }
233+
//}
234234

235235
[SkippableTheory]
236236
[InlineData("https://github.com/libgit2/TestGitRepository.git", "github.com", typeof(CertificateX509))]

LibGit2Sharp.Tests/desktop/SmartSubtransportFixture.cs

+52-54
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
using System.Net;
55
using System.Net.Security;
66
using LibGit2Sharp.Tests.TestHelpers;
7-
using LibGit2Sharp.Core;
87
using Xunit;
9-
using Xunit.Extensions;
108

119
namespace LibGit2Sharp.Tests
1210
{
@@ -79,58 +77,58 @@ public void CustomSmartSubtransportTest(string scheme, string url)
7977
}
8078
}
8179

82-
[Theory]
83-
[InlineData("https", "https://bitbucket.org/libgit2/testgitrepository.git", "libgit3", "libgit3")]
84-
public void CanUseCredentials(string scheme, string url, string user, string pass)
85-
{
86-
string remoteName = "testRemote";
87-
88-
var scd = BuildSelfCleaningDirectory();
89-
Repository.Init(scd.RootedDirectoryPath);
90-
91-
SmartSubtransportRegistration<MockSmartSubtransport> registration = null;
92-
93-
try
94-
{
95-
// Disable server certificate validation for testing.
96-
// Do *NOT* enable this in production.
97-
ServicePointManager.ServerCertificateValidationCallback = certificateValidationCallback;
98-
99-
registration = GlobalSettings.RegisterSmartSubtransport<MockSmartSubtransport>(scheme);
100-
Assert.NotNull(registration);
101-
102-
using (var repo = new Repository(scd.DirectoryPath))
103-
{
104-
repo.Network.Remotes.Add(remoteName, url);
105-
106-
// Set up structures for the expected results
107-
// and verifying the RemoteUpdateTips callback.
108-
TestRemoteInfo expectedResults = TestRemoteInfo.TestRemoteInstance;
109-
ExpectedFetchState expectedFetchState = new ExpectedFetchState(remoteName);
110-
111-
// Add expected branch objects
112-
foreach (KeyValuePair<string, ObjectId> kvp in expectedResults.BranchTips)
113-
{
114-
expectedFetchState.AddExpectedBranch(kvp.Key, ObjectId.Zero, kvp.Value);
115-
}
116-
117-
// Perform the actual fetch
118-
Commands.Fetch(repo, remoteName, new string[0], new FetchOptions {
119-
OnUpdateTips = expectedFetchState.RemoteUpdateTipsHandler, TagFetchMode = TagFetchMode.Auto,
120-
CredentialsProvider = (_user, _valid, _hostname) => new UsernamePasswordCredentials() { Username = user, Password = pass },
121-
}, null);
122-
123-
// Verify the expected
124-
expectedFetchState.CheckUpdatedReferences(repo);
125-
}
126-
}
127-
finally
128-
{
129-
GlobalSettings.UnregisterSmartSubtransport(registration);
130-
131-
ServicePointManager.ServerCertificateValidationCallback -= certificateValidationCallback;
132-
}
133-
}
80+
//[Theory]
81+
//[InlineData("https", "https://bitbucket.org/libgit2/testgitrepository.git", "libgit3", "libgit3")]
82+
//public void CanUseCredentials(string scheme, string url, string user, string pass)
83+
//{
84+
// string remoteName = "testRemote";
85+
86+
// var scd = BuildSelfCleaningDirectory();
87+
// Repository.Init(scd.RootedDirectoryPath);
88+
89+
// SmartSubtransportRegistration<MockSmartSubtransport> registration = null;
90+
91+
// try
92+
// {
93+
// // Disable server certificate validation for testing.
94+
// // Do *NOT* enable this in production.
95+
// ServicePointManager.ServerCertificateValidationCallback = certificateValidationCallback;
96+
97+
// registration = GlobalSettings.RegisterSmartSubtransport<MockSmartSubtransport>(scheme);
98+
// Assert.NotNull(registration);
99+
100+
// using (var repo = new Repository(scd.DirectoryPath))
101+
// {
102+
// repo.Network.Remotes.Add(remoteName, url);
103+
104+
// // Set up structures for the expected results
105+
// // and verifying the RemoteUpdateTips callback.
106+
// TestRemoteInfo expectedResults = TestRemoteInfo.TestRemoteInstance;
107+
// ExpectedFetchState expectedFetchState = new ExpectedFetchState(remoteName);
108+
109+
// // Add expected branch objects
110+
// foreach (KeyValuePair<string, ObjectId> kvp in expectedResults.BranchTips)
111+
// {
112+
// expectedFetchState.AddExpectedBranch(kvp.Key, ObjectId.Zero, kvp.Value);
113+
// }
114+
115+
// // Perform the actual fetch
116+
// Commands.Fetch(repo, remoteName, new string[0], new FetchOptions {
117+
// OnUpdateTips = expectedFetchState.RemoteUpdateTipsHandler, TagFetchMode = TagFetchMode.Auto,
118+
// CredentialsProvider = (_user, _valid, _hostname) => new UsernamePasswordCredentials() { Username = user, Password = pass },
119+
// }, null);
120+
121+
// // Verify the expected
122+
// expectedFetchState.CheckUpdatedReferences(repo);
123+
// }
124+
// }
125+
// finally
126+
// {
127+
// GlobalSettings.UnregisterSmartSubtransport(registration);
128+
129+
// ServicePointManager.ServerCertificateValidationCallback -= certificateValidationCallback;
130+
// }
131+
//}
134132

135133
[Fact]
136134
public void CannotReregisterScheme()

0 commit comments

Comments
 (0)