Adding Unit test to ContainerOperationProvider

This commit is contained in:
JoannaaKL
2022-08-31 10:05:44 +00:00
parent 3b4406161b
commit 2e8d8a74ab
3 changed files with 90 additions and 27 deletions

View File

@@ -396,7 +396,7 @@ namespace GitHub.Runner.Worker
}
}
private async Task<string> Healthcheck(IExecutionContext executionContext, ContainerInfo container){
public async Task<string> Healthcheck(IExecutionContext executionContext, ContainerInfo container){
string healthCheck = "--format=\"{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{end}}\"";
string serviceHealth = (await _dockerManager.DockerInspect(context: executionContext, dockerObject: container.ContainerId, options: healthCheck)).FirstOrDefault();
if (string.IsNullOrEmpty(serviceHealth))
@@ -416,7 +416,7 @@ namespace GitHub.Runner.Worker
return serviceHealth;
}
private async Task ContainerHealthcheckLogs(IExecutionContext executionContext, ContainerInfo container, string serviceHealth)
public async Task ContainerHealthcheckLogs(IExecutionContext executionContext, ContainerInfo container, string serviceHealth)
{
if (string.Equals(serviceHealth, "healthy", StringComparison.OrdinalIgnoreCase))