Skip to content
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
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ updates:
exclude-patterns:
- "*Analyzer*"
- "Microsoft.NET.Test.Sdk"
- "Microsoft.Playwright"
test-dependencies:
patterns:
- "coverlet.collector"
- "Microsoft.NET.Test.Sdk"
- "Microsoft.Playwright"
- "NSubstitute"
- "*NUnit*"
exclude-patterns:
Expand All @@ -78,6 +76,5 @@ updates:
- "System.*"
- "coverlet.collector"
- "Microsoft.NET.Test.Sdk"
- "Microsoft.Playwright"
- "NSubstitute"
- "*NUnit*"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
gitlab:
# Keep in sync with the version in GitLabDockerContainer.cs
# Available tags: https://hub.docker.com/r/gitlab/gitlab-ee/tags?name=-ee.0
- "gitlab/gitlab-ee:17.1.8-ee.0"
- "gitlab/gitlab-ee:18.1.6-ee.0"
- "gitlab/gitlab-ee:19.3.1-ee.0"
configuration: [Release]
fail-fast: false
services:
Expand Down
1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.401" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageVersion Include="Microsoft.Playwright" Version="1.62.0" />
<PackageVersion Include="MinVer" Version="8.0.0" />
<PackageVersion Include="NeoSmart.AsyncLock" Version="3.2.1" />
<PackageVersion Include="NSubstitute" Version="6.2.0" />
Expand Down
8 changes: 7 additions & 1 deletion NGitLab.Tests/CommitsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using NGitLab.Models;
using NGitLab.Tests.Docker;
using NuGet.Versioning;
using NUnit.Framework;

namespace NGitLab.Tests;
Expand Down Expand Up @@ -70,9 +71,13 @@ public async Task Test_can_get_stats_in_commit()

[Test]
[NGitLabRetry]
public async Task Test_can_get_merge_request_associated_to_commit()
[TestCase("(,19.0.0)", null)] // v18 allowed empty commits by default
[TestCase("[19.0.0,)", true)] // v19 only allow empty commits if specified
public async Task Test_can_get_merge_request_associated_to_commit(string versionRange, bool? allowEmpty)
{
using var context = await GitLabTestContext.CreateAsync();
context.IgnoreTestIfGitLabVersionOutOfRange(VersionRange.Parse(versionRange));

var project = context.CreateProject();

context.Client.GetRepository(project.Id).Branches.Create(new BranchCreate { Name = "test-mr", Ref = project.DefaultBranch });
Expand All @@ -81,6 +86,7 @@ public async Task Test_can_get_merge_request_associated_to_commit()
{
Branch = "test-mr",
CommitMessage = "Test to retrieve MR from commit sha",
AllowEmpty = allowEmpty,
});

var mergeRequestTitle = "Test to retrieve MR from commit sha";
Expand Down
9 changes: 8 additions & 1 deletion NGitLab.Tests/ContributorsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Threading.Tasks;
using NGitLab.Models;
using NGitLab.Tests.Docker;
using NuGet.Versioning;
using NUnit.Framework;

namespace NGitLab.Tests;
Expand All @@ -25,9 +26,14 @@ public async Task Test_can_get_contributors()

[Test]
[NGitLabRetry]
public async Task Test_can_get_MultipleContributors()

[TestCase("(,19.0.0)", null)] // v18 allowed empty commits by default
[TestCase("[19.0.0,)", true)] // v19 only allow empty commits if specified
public async Task Test_can_get_MultipleContributors(string versionRange, bool? allowEmpty)
{
using var context = await GitLabTestContext.CreateAsync();
context.IgnoreTestIfGitLabVersionOutOfRange(VersionRange.Parse(versionRange));

var project = context.CreateProject(initializeWithCommits: true);
var contributorsClient = context.Client.GetRepository(project.Id).Contributors;
var currentUser = context.Client.Users.Current;
Expand Down Expand Up @@ -59,6 +65,7 @@ public async Task Test_can_get_MultipleContributors()
Branch = project.DefaultBranch,
StartBranch = project.DefaultBranch,
CommitMessage = "test",
AllowEmpty = allowEmpty,
});

var contributors = await GitLabTestContext.RetryUntilAsync(() => contributorsClient.All.ToList(), c => c.Count >= 2, TimeSpan.FromMinutes(2));
Expand Down
6 changes: 1 addition & 5 deletions NGitLab.Tests/Docker/GitLabCredential.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
namespace NGitLab.Tests.Docker;
namespace NGitLab.Tests.Docker;

public record GitLabCredential
{
public string AdminUserToken { get; set; }

public string AdminCookies { get; set; }

public string UserToken { get; set; }

public string ProfileToken { get; set; }
}
Loading
Loading