-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add git note for commits created from studio (#11693)
* add git note on commit * push notes * git notes integration test * Git note test for commit and push * Fetch notes when clonning * format * after reset git note tests * Fetch notes when in clone overload * format fix * add new test * More tests * add Integration tests trait
- Loading branch information
1 parent
1617738
commit a93087b
Showing
5 changed files
with
359 additions
and
101 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
56 changes: 56 additions & 0 deletions
56
...Designer.Tests/GiteaIntegrationTests/RepositoryController/CopyAppGiteaIntegrationTests.cs
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,56 @@ | ||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using Designer.Tests.Fixtures; | ||
using Designer.Tests.Utils; | ||
using FluentAssertions; | ||
using Microsoft.AspNetCore.Mvc.Testing; | ||
using Polly; | ||
using Polly.Retry; | ||
using Xunit; | ||
|
||
namespace Designer.Tests.GiteaIntegrationTests.RepositoryController | ||
{ | ||
public class CopyAppGiteaIntegrationTests : GiteaIntegrationTestsBase<CopyAppGiteaIntegrationTests>, IClassFixture<WebApplicationFactory<Program>> | ||
{ | ||
|
||
private string CopyRepoName { get; set; } | ||
|
||
public CopyAppGiteaIntegrationTests(WebApplicationFactory<Program> factory, GiteaFixture giteaFixture) : base(factory, giteaFixture) | ||
{ | ||
} | ||
|
||
[Theory] | ||
[Trait("Category", "GiteaIntegrationTest")] | ||
[InlineData(GiteaConstants.TestOrgUsername)] | ||
public async Task Copy_Repo_Should_Return_Created(string org) | ||
{ | ||
string targetRepo = TestDataHelper.GenerateTestRepoName("-gitea"); | ||
await CreateAppUsingDesigner(org, targetRepo); | ||
|
||
CopyRepoName = TestDataHelper.GenerateTestRepoName("-gitea-copy"); | ||
|
||
// Copy app | ||
using HttpResponseMessage commitResponse = await HttpClient.PostAsync($"designer/api/repos/repo/{org}/copy-app?sourceRepository={targetRepo}&targetRepository={CopyRepoName}", null); | ||
commitResponse.StatusCode.Should().Be(HttpStatusCode.Created); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
{ | ||
return; | ||
} | ||
if (string.IsNullOrEmpty(CopyRepoName)) | ||
{ | ||
return; | ||
} | ||
|
||
string copyRepoPath = Path.Combine(TestRepositoriesLocation, "testUser", "ttd", CopyRepoName); | ||
DeleteDirectoryIfExists(copyRepoPath); | ||
} | ||
} | ||
} |
Oops, something went wrong.