Skip to content

Commit

Permalink
Fix ambiguity about runner mock's active vs paused status
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-z committed Jan 10, 2025
1 parent 888b279 commit cf95c5a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion NGitLab.Mock/Clients/RunnerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public Models.Runner Register(RunnerRegister request)
var project = Server.AllProjects.SingleOrDefault(p => string.Equals(p.RunnersToken, request.Token, StringComparison.Ordinal));
if (project != null)
{
var runner = project.AddRunner(null, request.Description, request.IsActive() ?? true, request.Locked ?? true, false, request.RunUntagged ?? false);
var runner = project.AddRunner(null, request.Description, request.Paused ?? false, request.Locked ?? true, false, request.RunUntagged ?? false);
return runner.ToClientRunner(Context.User);
}

Expand Down
8 changes: 4 additions & 4 deletions NGitLab.Mock/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,14 @@ public Runner AddRunner(string name, string description, bool paused, bool locke
return runner;
}

public Runner AddRunner(string name, string description, bool active, bool locked, bool isShared)
public Runner AddRunner(string name, string description, bool paused, bool locked, bool isShared)
{
return AddRunner(name, description, active, locked, isShared, runUntagged: false, default);
return AddRunner(name, description, paused, locked, isShared, runUntagged: false, default);
}

public Runner AddRunner(string name, string description, bool active, bool locked, bool isShared, bool runUntagged)
public Runner AddRunner(string name, string description, bool paused, bool locked, bool isShared, bool runUntagged)
{
return AddRunner(name, description, active, locked, isShared, runUntagged, default);
return AddRunner(name, description, paused, locked, isShared, runUntagged, default);
}

public Project Fork(User user)
Expand Down
6 changes: 3 additions & 3 deletions NGitLab.Mock/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,8 @@ NGitLab.Mock.PipelineScheduleCollection.PipelineScheduleCollection(NGitLab.Mock.
NGitLab.Mock.Project
NGitLab.Mock.Project.AccessibleMergeRequests.get -> bool
NGitLab.Mock.Project.AccessibleMergeRequests.set -> void
NGitLab.Mock.Project.AddRunner(string name, string description, bool active, bool locked, bool isShared) -> NGitLab.Mock.Runner
NGitLab.Mock.Project.AddRunner(string name, string description, bool active, bool locked, bool isShared, bool runUntagged) -> NGitLab.Mock.Runner
NGitLab.Mock.Project.AddRunner(string name, string description, bool paused, bool locked, bool isShared) -> NGitLab.Mock.Runner
NGitLab.Mock.Project.AddRunner(string name, string description, bool paused, bool locked, bool isShared, bool runUntagged) -> NGitLab.Mock.Runner
NGitLab.Mock.Project.AddRunner(string name, string description, bool paused, bool locked, bool isShared, bool runUntagged, long id) -> NGitLab.Mock.Runner
NGitLab.Mock.Project.AllThreadsMustBeResolvedToMerge.get -> bool
NGitLab.Mock.Project.AllThreadsMustBeResolvedToMerge.set -> void
Expand Down Expand Up @@ -1375,4 +1375,4 @@ static NGitLab.Mock.TemporaryDirectory.Create() -> NGitLab.Mock.TemporaryDirecto
static NGitLab.Mock.TemporaryDirectory.DeleteDirectory(string path) -> void
static NGitLab.Mock.TemporaryDirectory.DeleteFile(string path) -> void
static NGitLab.Mock.UserRef.implicit operator NGitLab.Mock.UserRef(NGitLab.Mock.User user) -> NGitLab.Mock.UserRef
virtual NGitLab.Mock.Collection<T>.Add(T item) -> void
virtual NGitLab.Mock.Collection<T>.Add(T item) -> void
21 changes: 0 additions & 21 deletions NGitLab.Mock/RunnersExtensions.cs

This file was deleted.

0 comments on commit cf95c5a

Please sign in to comment.