mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Compare commits
1 Commits
yaananth-p
...
feature/do
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a3abd6814 |
@@ -4,7 +4,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:1": {},
|
||||
"ghcr.io/devcontainers/features/dotnet": {
|
||||
"version": "6.0.421"
|
||||
"version": "6.0.422"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "16"
|
||||
|
||||
@@ -22,4 +22,4 @@ Runner releases:
|
||||
|
||||
## Contribute
|
||||
|
||||
We accept contributions in the form of issues and pull requests. The runner typically requires changes across the entire system and we aim for issues in the runner to be entirely self contained and fixable here. Therefore, we will primarily handle bug issues opened in this repo and we kindly request you to create all feature and enhancement requests on the [GitHub Feedback](https://github.com/community/community/discussions/categories/actions-and-packages) page. [Read more about our guidelines here](docs/contribute.md) before contributing.,
|
||||
We accept contributions in the form of issues and pull requests. The runner typically requires changes across the entire system and we aim for issues in the runner to be entirely self contained and fixable here. Therefore, we will primarily handle bug issues opened in this repo and we kindly request you to create all feature and enhancement requests on the [GitHub Feedback](https://github.com/community/community/discussions/categories/actions-and-packages) page. [Read more about our guidelines here](docs/contribute.md) before contributing.
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
trace.Info("Parsed");
|
||||
|
||||
trace.Info("Commands: {0}", clp.Commands.Count);
|
||||
Assert.Equal(2, clp.Commands.Count);
|
||||
Assert.True(clp.Commands.Count == 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
trace.Info("Parsed");
|
||||
|
||||
trace.Info("Args: {0}", clp.Args.Count);
|
||||
Assert.Equal(2, clp.Args.Count);
|
||||
Assert.True(clp.Args.Count == 2);
|
||||
Assert.True(clp.Args.ContainsKey("arg1"));
|
||||
Assert.Equal("arg1val", clp.Args["arg1"]);
|
||||
Assert.True(clp.Args.ContainsKey("arg2"));
|
||||
@@ -112,7 +112,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
trace.Info("Parsed");
|
||||
|
||||
trace.Info("Args: {0}", clp.Flags.Count);
|
||||
Assert.Equal(2, clp.Flags.Count);
|
||||
Assert.True(clp.Flags.Count == 2);
|
||||
Assert.Contains("flag1", clp.Flags);
|
||||
Assert.Contains("flag2", clp.Flags);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
"osx-arm64"
|
||||
};
|
||||
|
||||
Assert.Equal(40, BuildConstants.Source.CommitHash.Length);
|
||||
Assert.True(BuildConstants.Source.CommitHash.Length == 40, $"CommitHash should be SHA-1 hash {BuildConstants.Source.CommitHash}");
|
||||
Assert.True(validPackageNames.Contains(BuildConstants.RunnerPackage.PackageName), $"PackageName should be one of the following '{string.Join(", ", validPackageNames)}', current PackageName is '{BuildConstants.RunnerPackage.PackageName}'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
"test runner" });
|
||||
|
||||
// Assert.
|
||||
Assert.Equal(0, command.Validate().Count);
|
||||
Assert.True(command.Validate().Count == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
var command = new CommandSettings(hc, args: new string[] { validCommand, $"--{flag}" });
|
||||
|
||||
// Assert.
|
||||
Assert.Equal(0, command.Validate().Count);
|
||||
Assert.True(command.Validate().Count == 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
var command = new CommandSettings(hc, args: new string[] { validCommand, $"--{arg}", argValue });
|
||||
|
||||
// Assert.
|
||||
Assert.Equal(0, command.Validate().Count);
|
||||
Assert.True(command.Validate().Count == 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,11 +190,11 @@ namespace GitHub.Runner.Common.Tests.Listener.Configuration
|
||||
trace.Info("Configured, verifying all the parameter value");
|
||||
var s = configManager.LoadSettings();
|
||||
Assert.NotNull(s);
|
||||
Assert.Equal(_expectedServerUrl, s.ServerUrl);
|
||||
Assert.Equal(_expectedAgentName, s.AgentName);
|
||||
Assert.Equal(_secondRunnerGroupId, s.PoolId);
|
||||
Assert.Equal(_expectedWorkFolder, s.WorkFolder);
|
||||
Assert.True(s.Ephemeral);
|
||||
Assert.True(s.ServerUrl.Equals(_expectedServerUrl));
|
||||
Assert.True(s.AgentName.Equals(_expectedAgentName));
|
||||
Assert.True(s.PoolId.Equals(_secondRunnerGroupId));
|
||||
Assert.True(s.WorkFolder.Equals(_expectedWorkFolder));
|
||||
Assert.True(s.Ephemeral.Equals(true));
|
||||
|
||||
// validate GetAgentPoolsAsync gets called twice with automation pool type
|
||||
_runnerServer.Verify(x => x.GetAgentPoolsAsync(It.IsAny<string>(), It.Is<TaskAgentPoolType>(p => p == TaskAgentPoolType.Automation)), Times.Exactly(2));
|
||||
@@ -292,11 +292,11 @@ namespace GitHub.Runner.Common.Tests.Listener.Configuration
|
||||
trace.Info("Configured, verifying all the parameter value");
|
||||
var s = configManager.LoadSettings();
|
||||
Assert.NotNull(s);
|
||||
Assert.Equal(_expectedServerUrl, s.ServerUrl);
|
||||
Assert.Equal(_expectedAgentName, s.AgentName);
|
||||
Assert.Equal(_secondRunnerGroupId, s.PoolId);
|
||||
Assert.Equal(_expectedWorkFolder, s.WorkFolder);
|
||||
Assert.True(s.Ephemeral);
|
||||
Assert.True(s.ServerUrl.Equals(_expectedServerUrl));
|
||||
Assert.True(s.AgentName.Equals(_expectedAgentName));
|
||||
Assert.True(s.PoolId.Equals(_secondRunnerGroupId));
|
||||
Assert.True(s.WorkFolder.Equals(_expectedWorkFolder));
|
||||
Assert.True(s.Ephemeral.Equals(true));
|
||||
|
||||
// validate GetAgentPoolsAsync gets called twice with automation pool type
|
||||
_runnerServer.Verify(x => x.GetAgentPoolsAsync(It.IsAny<string>(), It.Is<TaskAgentPoolType>(p => p == TaskAgentPoolType.Automation)), Times.Exactly(2));
|
||||
|
||||
@@ -734,10 +734,7 @@ namespace GitHub.Runner.Common.Tests.Listener
|
||||
await jobDispatcher.WaitAsync(CancellationToken.None);
|
||||
|
||||
Assert.True(jobDispatcher.RunOnceJobCompleted.Task.IsCompleted, "JobDispatcher should set task complete token for one time agent.");
|
||||
if (jobDispatcher.RunOnceJobCompleted.Task.IsCompleted)
|
||||
{
|
||||
Assert.True(await jobDispatcher.RunOnceJobCompleted.Task, "JobDispatcher should set task complete token to 'TRUE' for one time agent.");
|
||||
}
|
||||
Assert.True(jobDispatcher.RunOnceJobCompleted.Task.Result, "JobDispatcher should set task complete token to 'TRUE' for one time agent.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace GitHub.Runner.Common.Tests.Listener
|
||||
//wait for the runner to run one job
|
||||
if (!await signalWorkerComplete.WaitAsync(2000))
|
||||
{
|
||||
Assert.Fail($"{nameof(_messageListener.Object.GetNextMessageAsync)} was not invoked.");
|
||||
Assert.True(false, $"{nameof(_messageListener.Object.GetNextMessageAsync)} was not invoked.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -305,11 +305,8 @@ namespace GitHub.Runner.Common.Tests.Listener
|
||||
await Task.WhenAny(runnerTask, Task.Delay(30000));
|
||||
|
||||
Assert.True(runnerTask.IsCompleted, $"{nameof(runner.ExecuteCommand)} timed out.");
|
||||
Assert.False(runnerTask.IsFaulted, runnerTask.Exception?.ToString());
|
||||
if (runnerTask.IsCompleted)
|
||||
{
|
||||
Assert.Equal(Constants.Runner.ReturnCode.Success, await runnerTask);
|
||||
}
|
||||
Assert.True(!runnerTask.IsFaulted, runnerTask.Exception?.ToString());
|
||||
Assert.True(runnerTask.Result == Constants.Runner.ReturnCode.Success);
|
||||
|
||||
_jobDispatcher.Verify(x => x.Run(It.IsAny<Pipelines.AgentJobRequestMessage>(), true), Times.Once(),
|
||||
$"{nameof(_jobDispatcher.Object.Run)} was not invoked.");
|
||||
@@ -409,10 +406,7 @@ namespace GitHub.Runner.Common.Tests.Listener
|
||||
|
||||
Assert.True(runnerTask.IsCompleted, $"{nameof(runner.ExecuteCommand)} timed out.");
|
||||
Assert.True(!runnerTask.IsFaulted, runnerTask.Exception?.ToString());
|
||||
if (runnerTask.IsCompleted)
|
||||
{
|
||||
Assert.Equal(Constants.Runner.ReturnCode.Success, await runnerTask);
|
||||
}
|
||||
Assert.True(runnerTask.Result == Constants.Runner.ReturnCode.Success);
|
||||
|
||||
_jobDispatcher.Verify(x => x.Run(It.IsAny<Pipelines.AgentJobRequestMessage>(), true), Times.Once(),
|
||||
$"{nameof(_jobDispatcher.Object.Run)} was not invoked.");
|
||||
@@ -498,10 +492,7 @@ namespace GitHub.Runner.Common.Tests.Listener
|
||||
|
||||
Assert.True(runnerTask.IsCompleted, $"{nameof(runner.ExecuteCommand)} timed out.");
|
||||
Assert.True(!runnerTask.IsFaulted, runnerTask.Exception?.ToString());
|
||||
if (runnerTask.IsCompleted)
|
||||
{
|
||||
Assert.Equal(Constants.Runner.ReturnCode.RunOnceRunnerUpdating, await runnerTask);
|
||||
}
|
||||
Assert.True(runnerTask.Result == Constants.Runner.ReturnCode.RunOnceRunnerUpdating);
|
||||
|
||||
_updater.Verify(x => x.SelfUpdate(It.IsAny<AgentRefreshMessage>(), It.IsAny<IJobDispatcher>(), false, It.IsAny<CancellationToken>()), Times.Once);
|
||||
_jobDispatcher.Verify(x => x.Run(It.IsAny<Pipelines.AgentJobRequestMessage>(), true), Times.Never());
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
trace.Error(ex);
|
||||
}
|
||||
|
||||
Assert.Fail("Failed to retrieve process environment variable.");
|
||||
Assert.True(false, "Fail to retrive process environment variable.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -65,14 +65,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
}
|
||||
}
|
||||
|
||||
if (badCode.Count > 0)
|
||||
{
|
||||
Assert.Fail($"The following code is using Raw HttpClientHandler() which will not follow the proxy setting agent have. Please use HostContext.CreateHttpClientHandler() instead.\n {string.Join("\n", badCode)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.True(true);
|
||||
}
|
||||
Assert.True(badCode.Count == 0, $"The following code is using Raw HttpClientHandler() which will not follow the proxy setting agent have. Please use HostContext.CreateHttpClientHandler() instead.\n {string.Join("\n", badCode)}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -119,14 +112,7 @@ namespace GitHub.Runner.Common.Tests
|
||||
}
|
||||
}
|
||||
|
||||
if (badCode.Count > 0)
|
||||
{
|
||||
Assert.Fail($"The following code is using Raw HttpClient() which will not follow the proxy setting agent have. Please use New HttpClient(HostContext.CreateHttpClientHandler()) instead.\n {string.Join("\n", badCode)}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.True(true);
|
||||
}
|
||||
Assert.True(badCode.Count == 0, $"The following code is using Raw HttpClient() which will not follow the proxy setting agent have. Please use New HttpClient(HostContext.CreateHttpClientHandler()) instead.\n {string.Join("\n", badCode)}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -460,7 +460,7 @@ runs:
|
||||
//Act
|
||||
var steps = (await _actionManager.PrepareActionsAsync(_ec.Object, actions)).ContainerSetupSteps;
|
||||
|
||||
Assert.Equal(0, steps.Count);
|
||||
Assert.True(steps.Count == 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -915,7 +915,7 @@ runs:
|
||||
var steps = (await _actionManager.PrepareActionsAsync(_ec.Object, actions)).ContainerSetupSteps;
|
||||
|
||||
// node.js based action doesn't need any extra steps to build/pull containers.
|
||||
Assert.Equal(0, steps.Count);
|
||||
Assert.True(steps.Count == 0);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -1051,7 +1051,7 @@ runs:
|
||||
var steps = (await _actionManager.PrepareActionsAsync(_ec.Object, actions)).ContainerSetupSteps;
|
||||
|
||||
// node.js based action doesn't need any extra steps to build/pull containers.
|
||||
Assert.Equal(0, steps.Count);
|
||||
Assert.True(steps.Count == 0);
|
||||
var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), "TingluoHuang/runner_L0", "CompositeBasic.completed");
|
||||
Assert.True(File.Exists(watermarkFile));
|
||||
// Comes from the composite action
|
||||
@@ -1245,7 +1245,7 @@ runs:
|
||||
// Assert.
|
||||
Assert.NotNull(definition);
|
||||
Assert.NotNull(definition.Data);
|
||||
Assert.Equal(ActionExecutionType.Script, definition.Data.Execution.ExecutionType);
|
||||
Assert.True(definition.Data.Execution.ExecutionType == ActionExecutionType.Script);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="xunit" Version="2.7.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.1" />
|
||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
|
||||
|
||||
@@ -17,7 +17,7 @@ LAYOUT_DIR="$SCRIPT_DIR/../_layout"
|
||||
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
|
||||
PACKAGE_DIR="$SCRIPT_DIR/../_package"
|
||||
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
|
||||
DOTNETSDK_VERSION="6.0.421"
|
||||
DOTNETSDK_VERSION="6.0.422"
|
||||
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
|
||||
RUNNER_VERSION=$(cat runnerversion)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "6.0.421"
|
||||
"version": "6.0.422"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user