mirror of
https://github.com/actions/runner.git
synced 2025-12-12 05:37:01 +00:00
Compare commits
10 Commits
fhammerl/s
...
remove-use
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac7f83f61d | ||
|
|
d061d61093 | ||
|
|
3f3d9b0d99 | ||
|
|
af485fb660 | ||
|
|
9e3e57ff90 | ||
|
|
ac89b31d2f | ||
|
|
65201ff6be | ||
|
|
661b261959 | ||
|
|
8a25302ba3 | ||
|
|
c7d65c42d6 |
1
.github/workflows/close-bugs-bot.yml
vendored
1
.github/workflows/close-bugs-bot.yml
vendored
@@ -15,4 +15,3 @@ jobs:
|
|||||||
only-labels: "actions-bug"
|
only-labels: "actions-bug"
|
||||||
days-before-stale: 0
|
days-before-stale: 0
|
||||||
days-before-close: 1
|
days-before-close: 1
|
||||||
close-issue-reason: "completed"
|
|
||||||
|
|||||||
1
.github/workflows/close-features-bot.yml
vendored
1
.github/workflows/close-features-bot.yml
vendored
@@ -15,4 +15,3 @@ jobs:
|
|||||||
only-labels: "actions-feature"
|
only-labels: "actions-feature"
|
||||||
days-before-stale: 0
|
days-before-stale: 0
|
||||||
days-before-close: 1
|
days-before-close: 1
|
||||||
close-issue-reason: "completed"
|
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ Make sure the runner has access to actions service for GitHub.com or GitHub Ente
|
|||||||
|
|
||||||
- For GitHub.com
|
- For GitHub.com
|
||||||
- The runner needs to access `https://api.github.com` for downloading actions.
|
- The runner needs to access `https://api.github.com` for downloading actions.
|
||||||
|
- The runner needs to access `https://codeload.github.com` for downloading actions tar.gz/zip.
|
||||||
- The runner needs to access `https://vstoken.actions.githubusercontent.com/_apis/.../` for requesting an access token.
|
- The runner needs to access `https://vstoken.actions.githubusercontent.com/_apis/.../` for requesting an access token.
|
||||||
- The runner needs to access `https://pipelines.actions.githubusercontent.com/_apis/.../` for receiving workflow jobs.
|
- The runner needs to access `https://pipelines.actions.githubusercontent.com/_apis/.../` for receiving workflow jobs.
|
||||||
|
- The runner needs to access `https://results-receiver.actions.githubusercontent.com/.../` for reporting progress and uploading logs during a workflow job execution.
|
||||||
---
|
---
|
||||||
**NOTE:** for the full list of domains that are required to be in the firewall allow list refer to the [GitHub self-hosted runners requirements documentation](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github).
|
**NOTE:** for the full list of domains that are required to be in the firewall allow list refer to the [GitHub self-hosted runners requirements documentation](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#communication-between-self-hosted-runners-and-github).
|
||||||
|
|
||||||
@@ -16,12 +18,15 @@ Make sure the runner has access to actions service for GitHub.com or GitHub Ente
|
|||||||
|
|
||||||
```
|
```
|
||||||
curl -v https://api.github.com/zen
|
curl -v https://api.github.com/zen
|
||||||
|
curl -v https://codeload.github.com/_ping
|
||||||
curl -v https://vstoken.actions.githubusercontent.com/_apis/health
|
curl -v https://vstoken.actions.githubusercontent.com/_apis/health
|
||||||
curl -v https://pipelines.actions.githubusercontent.com/_apis/health
|
curl -v https://pipelines.actions.githubusercontent.com/_apis/health
|
||||||
|
curl -v https://results-receiver.actions.githubusercontent.com/health
|
||||||
```
|
```
|
||||||
|
|
||||||
- For GitHub Enterprise Server
|
- For GitHub Enterprise Server
|
||||||
- The runner needs to access `https://[hostname]/api/v3` for downloading actions.
|
- The runner needs to access `https://[hostname]/api/v3` for downloading actions.
|
||||||
|
- The runner needs to access `https://codeload.[hostname]/_ping` for downloading actions tar.gz/zip.
|
||||||
- The runner needs to access `https://[hostname]/_services/vstoken/_apis/.../` for requesting an access token.
|
- The runner needs to access `https://[hostname]/_services/vstoken/_apis/.../` for requesting an access token.
|
||||||
- The runner needs to access `https://[hostname]/_services/pipelines/_apis/.../` for receiving workflow jobs.
|
- The runner needs to access `https://[hostname]/_services/pipelines/_apis/.../` for receiving workflow jobs.
|
||||||
|
|
||||||
@@ -29,6 +34,7 @@ Make sure the runner has access to actions service for GitHub.com or GitHub Ente
|
|||||||
|
|
||||||
```
|
```
|
||||||
curl -v https://[hostname]/api/v3/zen
|
curl -v https://[hostname]/api/v3/zen
|
||||||
|
curl -v https://codeload.[hostname]/_ping
|
||||||
curl -v https://[hostname]/_services/vstoken/_apis/health
|
curl -v https://[hostname]/_services/vstoken/_apis/health
|
||||||
curl -v https://[hostname]/_services/pipelines/_apis/health
|
curl -v https://[hostname]/_services/pipelines/_apis/health
|
||||||
```
|
```
|
||||||
@@ -44,6 +50,10 @@ Make sure the runner has access to actions service for GitHub.com or GitHub Ente
|
|||||||
- Ping api.github.com or myGHES.com using dotnet
|
- Ping api.github.com or myGHES.com using dotnet
|
||||||
- Make HTTP GET to https://api.github.com or https://myGHES.com/api/v3 using dotnet, check response headers contains `X-GitHub-Request-Id`
|
- Make HTTP GET to https://api.github.com or https://myGHES.com/api/v3 using dotnet, check response headers contains `X-GitHub-Request-Id`
|
||||||
---
|
---
|
||||||
|
- DNS lookup for codeload.github.com or codeload.myGHES.com using dotnet
|
||||||
|
- Ping codeload.github.com or codeload.myGHES.com using dotnet
|
||||||
|
- Make HTTP GET to https://codeload.github.com/_ping or https://codeload.myGHES.com/_ping using dotnet, check response headers contains `X-GitHub-Request-Id`
|
||||||
|
---
|
||||||
- DNS lookup for vstoken.actions.githubusercontent.com using dotnet
|
- DNS lookup for vstoken.actions.githubusercontent.com using dotnet
|
||||||
- Ping vstoken.actions.githubusercontent.com using dotnet
|
- Ping vstoken.actions.githubusercontent.com using dotnet
|
||||||
- Make HTTP GET to https://vstoken.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/vstoken/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
- Make HTTP GET to https://vstoken.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/vstoken/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
||||||
@@ -52,6 +62,10 @@ Make sure the runner has access to actions service for GitHub.com or GitHub Ente
|
|||||||
- Ping pipelines.actions.githubusercontent.com using dotnet
|
- Ping pipelines.actions.githubusercontent.com using dotnet
|
||||||
- Make HTTP GET to https://pipelines.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/pipelines/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
- Make HTTP GET to https://pipelines.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/pipelines/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
||||||
- Make HTTP POST to https://pipelines.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/pipelines/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
- Make HTTP POST to https://pipelines.actions.githubusercontent.com/_apis/health or https://myGHES.com/_services/pipelines/_apis/health using dotnet, check response headers contains `x-vss-e2eid`
|
||||||
|
---
|
||||||
|
- DNS lookup for results-receiver.actions.githubusercontent.com using dotnet
|
||||||
|
- Ping results-receiver.actions.githubusercontent.com using dotnet
|
||||||
|
- Make HTTP GET to https://results-receiver.actions.githubusercontent.com/health using dotnet, check response headers contains `X-GitHub-Request-Id`
|
||||||
|
|
||||||
## How to fix the issue?
|
## How to fix the issue?
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ If you are having trouble connecting, try these steps:
|
|||||||
- https://api.github.com/
|
- https://api.github.com/
|
||||||
- https://vstoken.actions.githubusercontent.com/_apis/health
|
- https://vstoken.actions.githubusercontent.com/_apis/health
|
||||||
- https://pipelines.actions.githubusercontent.com/_apis/health
|
- https://pipelines.actions.githubusercontent.com/_apis/health
|
||||||
|
- https://results-receiver.actions.githubusercontent.com/health
|
||||||
- For GHES/GHAE
|
- For GHES/GHAE
|
||||||
- https://myGHES.com/_services/vstoken/_apis/health
|
- https://myGHES.com/_services/vstoken/_apis/health
|
||||||
- https://myGHES.com/_services/pipelines/_apis/health
|
- https://myGHES.com/_services/pipelines/_apis/health
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
## Supported Distributions and Versions
|
## Supported Distributions and Versions
|
||||||
|
|
||||||
x64
|
x64
|
||||||
- Red Hat Enterprise Linux 7
|
- Red Hat Enterprise Linux 7+
|
||||||
- CentOS 7
|
- CentOS 7+
|
||||||
- Oracle Linux 7
|
- Oracle Linux 7+
|
||||||
- Fedora 29+
|
- Fedora 29+
|
||||||
- Debian 9+
|
- Debian 9+
|
||||||
- Ubuntu 16.04+
|
- Ubuntu 16.04+
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy as build
|
|||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG RUNNER_VERSION
|
ARG RUNNER_VERSION
|
||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.4.0
|
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.5.0
|
||||||
ARG DOCKER_VERSION=24.0.6
|
ARG DOCKER_VERSION=24.0.6
|
||||||
ARG BUILDX_VERSION=0.11.2
|
ARG BUILDX_VERSION=0.11.2
|
||||||
|
|
||||||
@@ -37,6 +37,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV RUNNER_MANUALLY_TRAP_SIG=1
|
ENV RUNNER_MANUALLY_TRAP_SIG=1
|
||||||
ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1
|
ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1
|
||||||
|
ENV ImageOS=ubuntu22
|
||||||
|
|
||||||
RUN apt-get update -y \
|
RUN apt-get update -y \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
|||||||
@@ -200,6 +200,10 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
_trace.Info($"No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)");
|
_trace.Info($"No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_userAgents.Add(new ProductInfoHeaderValue("HttpProxyConfigured", bool.TrueString));
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
|
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,13 +19,6 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
DefaultTraceLevel = TraceLevel.Verbose;
|
DefaultTraceLevel = TraceLevel.Verbose;
|
||||||
}
|
}
|
||||||
else if (int.TryParse(Environment.GetEnvironmentVariable("ACTIONS_RUNNER_TRACE_LEVEL"), out var traceLevel))
|
|
||||||
{
|
|
||||||
// force user's TraceLevel to comply with runner TraceLevel enums
|
|
||||||
traceLevel = Math.Clamp(traceLevel, 0, 5);
|
|
||||||
|
|
||||||
DefaultTraceLevel = (TraceLevel)traceLevel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DataMember(EmitDefaultValue = false)]
|
[DataMember(EmitDefaultValue = false)]
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace GitHub.Runner.Listener.Check
|
|||||||
string githubApiUrl = null;
|
string githubApiUrl = null;
|
||||||
string actionsTokenServiceUrl = null;
|
string actionsTokenServiceUrl = null;
|
||||||
string actionsPipelinesServiceUrl = null;
|
string actionsPipelinesServiceUrl = null;
|
||||||
|
string resultsReceiverServiceUrl = null;
|
||||||
var urlBuilder = new UriBuilder(url);
|
var urlBuilder = new UriBuilder(url);
|
||||||
if (UrlUtil.IsHostedServer(urlBuilder))
|
if (UrlUtil.IsHostedServer(urlBuilder))
|
||||||
{
|
{
|
||||||
@@ -47,6 +48,7 @@ namespace GitHub.Runner.Listener.Check
|
|||||||
githubApiUrl = urlBuilder.Uri.AbsoluteUri;
|
githubApiUrl = urlBuilder.Uri.AbsoluteUri;
|
||||||
actionsTokenServiceUrl = "https://vstoken.actions.githubusercontent.com/_apis/health";
|
actionsTokenServiceUrl = "https://vstoken.actions.githubusercontent.com/_apis/health";
|
||||||
actionsPipelinesServiceUrl = "https://pipelines.actions.githubusercontent.com/_apis/health";
|
actionsPipelinesServiceUrl = "https://pipelines.actions.githubusercontent.com/_apis/health";
|
||||||
|
resultsReceiverServiceUrl = "https://results-receiver.actions.githubusercontent.com/health";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -56,13 +58,31 @@ namespace GitHub.Runner.Listener.Check
|
|||||||
actionsTokenServiceUrl = urlBuilder.Uri.AbsoluteUri;
|
actionsTokenServiceUrl = urlBuilder.Uri.AbsoluteUri;
|
||||||
urlBuilder.Path = "_services/pipelines/_apis/health";
|
urlBuilder.Path = "_services/pipelines/_apis/health";
|
||||||
actionsPipelinesServiceUrl = urlBuilder.Uri.AbsoluteUri;
|
actionsPipelinesServiceUrl = urlBuilder.Uri.AbsoluteUri;
|
||||||
|
resultsReceiverServiceUrl = string.Empty; // we don't have Results service in GHES yet.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var codeLoadUrlBuilder = new UriBuilder(url);
|
||||||
|
codeLoadUrlBuilder.Host = $"codeload.{codeLoadUrlBuilder.Host}";
|
||||||
|
codeLoadUrlBuilder.Path = "_ping";
|
||||||
|
|
||||||
// check github api
|
// check github api
|
||||||
checkTasks.Add(CheckUtil.CheckDns(githubApiUrl));
|
checkTasks.Add(CheckUtil.CheckDns(githubApiUrl));
|
||||||
checkTasks.Add(CheckUtil.CheckPing(githubApiUrl));
|
checkTasks.Add(CheckUtil.CheckPing(githubApiUrl));
|
||||||
checkTasks.Add(HostContext.CheckHttpsGetRequests(githubApiUrl, pat, expectedHeader: "X-GitHub-Request-Id"));
|
checkTasks.Add(HostContext.CheckHttpsGetRequests(githubApiUrl, pat, expectedHeader: "X-GitHub-Request-Id"));
|
||||||
|
|
||||||
|
// check github codeload
|
||||||
|
checkTasks.Add(CheckUtil.CheckDns(codeLoadUrlBuilder.Uri.AbsoluteUri));
|
||||||
|
checkTasks.Add(CheckUtil.CheckPing(codeLoadUrlBuilder.Uri.AbsoluteUri));
|
||||||
|
checkTasks.Add(HostContext.CheckHttpsGetRequests(codeLoadUrlBuilder.Uri.AbsoluteUri, pat, expectedHeader: "X-GitHub-Request-Id"));
|
||||||
|
|
||||||
|
// check results-receiver service
|
||||||
|
if (!string.IsNullOrEmpty(resultsReceiverServiceUrl))
|
||||||
|
{
|
||||||
|
checkTasks.Add(CheckUtil.CheckDns(resultsReceiverServiceUrl));
|
||||||
|
checkTasks.Add(CheckUtil.CheckPing(resultsReceiverServiceUrl));
|
||||||
|
checkTasks.Add(HostContext.CheckHttpsGetRequests(resultsReceiverServiceUrl, pat, expectedHeader: "X-GitHub-Request-Id"));
|
||||||
|
}
|
||||||
|
|
||||||
// check actions token service
|
// check actions token service
|
||||||
checkTasks.Add(CheckUtil.CheckDns(actionsTokenServiceUrl));
|
checkTasks.Add(CheckUtil.CheckDns(actionsTokenServiceUrl));
|
||||||
checkTasks.Add(CheckUtil.CheckPing(actionsTokenServiceUrl));
|
checkTasks.Add(CheckUtil.CheckPing(actionsTokenServiceUrl));
|
||||||
|
|||||||
@@ -1134,6 +1134,15 @@ namespace GitHub.Runner.Listener
|
|||||||
jobRecord.ErrorCount++;
|
jobRecord.ErrorCount++;
|
||||||
jobRecord.Issues.Add(unhandledExceptionIssue);
|
jobRecord.Issues.Add(unhandledExceptionIssue);
|
||||||
|
|
||||||
|
if (message.Variables.TryGetValue("DistributedTask.MarkJobAsFailedOnWorkerCrash", out var markJobAsFailedOnWorkerCrash) &&
|
||||||
|
StringUtil.ConvertToBoolean(markJobAsFailedOnWorkerCrash?.Value))
|
||||||
|
{
|
||||||
|
Trace.Info("Mark the job as failed since the worker crashed");
|
||||||
|
jobRecord.Result = TaskResult.Failed;
|
||||||
|
// mark the job as completed so service will pickup the result
|
||||||
|
jobRecord.State = TimelineRecordState.Completed;
|
||||||
|
}
|
||||||
|
|
||||||
await jobServer.UpdateTimelineRecordsAsync(message.Plan.ScopeIdentifier, message.Plan.PlanType, message.Plan.PlanId, message.Timeline.Id, new TimelineRecord[] { jobRecord }, CancellationToken.None);
|
await jobServer.UpdateTimelineRecordsAsync(message.Plan.ScopeIdentifier, message.Plan.PlanType, message.Plan.PlanId, message.Timeline.Id, new TimelineRecord[] { jobRecord }, CancellationToken.None);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -183,18 +183,15 @@ namespace GitHub.Runner.Listener
|
|||||||
|
|
||||||
public void OnJobStatus(object sender, JobStatusEventArgs e)
|
public void OnJobStatus(object sender, JobStatusEventArgs e)
|
||||||
{
|
{
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("USE_BROKER_FLOW")))
|
Trace.Info("Received job status event. JobState: {0}", e.Status);
|
||||||
|
runnerStatus = e.Status;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Trace.Info("Received job status event. JobState: {0}", e.Status);
|
_getMessagesTokenSource?.Cancel();
|
||||||
runnerStatus = e.Status;
|
}
|
||||||
try
|
catch (ObjectDisposedException)
|
||||||
{
|
{
|
||||||
_getMessagesTokenSource?.Cancel();
|
Trace.Info("_getMessagesTokenSource is already disposed.");
|
||||||
}
|
|
||||||
catch (ObjectDisposedException)
|
|
||||||
{
|
|
||||||
Trace.Info("_getMessagesTokenSource is already disposed.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,11 +62,6 @@ namespace GitHub.Runner.Sdk
|
|||||||
settings.SendTimeout = TimeSpan.FromSeconds(Math.Min(Math.Max(httpRequestTimeoutSeconds, 100), 1200));
|
settings.SendTimeout = TimeSpan.FromSeconds(Math.Min(Math.Max(httpRequestTimeoutSeconds, 100), 1200));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("USE_BROKER_FLOW")))
|
|
||||||
{
|
|
||||||
settings.AllowAutoRedirectForBroker = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove Invariant from the list of accepted languages.
|
// Remove Invariant from the list of accepted languages.
|
||||||
//
|
//
|
||||||
// The constructor of VssHttpRequestSettings (base class of VssClientHttpRequestSettings) adds the current
|
// The constructor of VssHttpRequestSettings (base class of VssClientHttpRequestSettings) adds the current
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ namespace GitHub.Services.Common
|
|||||||
// SyncronizationContext (such as ASP.NET's) which keeps things from deadlocking...
|
// SyncronizationContext (such as ASP.NET's) which keeps things from deadlocking...
|
||||||
|
|
||||||
var tmpResponse = await m_messageInvoker.SendAsync(request, tokenSource.Token).ConfigureAwait(false);
|
var tmpResponse = await m_messageInvoker.SendAsync(request, tokenSource.Token).ConfigureAwait(false);
|
||||||
if (Settings.AllowAutoRedirectForBroker && tmpResponse.StatusCode == HttpStatusCode.Redirect)
|
if (tmpResponse.StatusCode == HttpStatusCode.Redirect)
|
||||||
{
|
{
|
||||||
//Dispose of the previous response
|
//Dispose of the previous response
|
||||||
tmpResponse?.Dispose();
|
tmpResponse?.Dispose();
|
||||||
|
|||||||
@@ -110,16 +110,6 @@ namespace GitHub.Services.Common
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets a value indicating whether or not HttpClientHandler should follow redirect on outgoing broker requests
|
|
||||||
/// This is special since this also sends token in the request, where as default AllowAutoRedirect does not
|
|
||||||
/// </summary>
|
|
||||||
public Boolean AllowAutoRedirectForBroker
|
|
||||||
{
|
|
||||||
get;
|
|
||||||
set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether or not compression should be used on outgoing requests.
|
/// Gets or sets a value indicating whether or not compression should be used on outgoing requests.
|
||||||
/// The default value is true.
|
/// The default value is true.
|
||||||
|
|||||||
@@ -172,43 +172,6 @@ namespace GitHub.Runner.Common.Tests
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData("randomString", "0", "VERB", "FALSELEVEL")]
|
|
||||||
[InlineData("", "-1", "", "INFO")]
|
|
||||||
[InlineData("", "6", "VERB", "FALSELEVEL")]
|
|
||||||
[InlineData("", "99", "VERB", "FALSELEVEL")]
|
|
||||||
[Trait("Level", "L0")]
|
|
||||||
[Trait("Category", "Common")]
|
|
||||||
public void TraceLevel(string trace, string traceLevel, string mustContainTraceLevel, string mustNotContainTraceLevel)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TRACE", trace);
|
|
||||||
Environment.SetEnvironmentVariable("ACTIONS_RUNNER_TRACE_LEVEL", traceLevel);
|
|
||||||
|
|
||||||
// Arrange.
|
|
||||||
Setup();
|
|
||||||
_hc.SetDefaultCulture("hu-HU"); // logs [VERB] if traceLevel allows it
|
|
||||||
|
|
||||||
// Assert.
|
|
||||||
var logFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), $"trace_{nameof(HostContextL0)}_{nameof(TraceLevel)}.log");
|
|
||||||
var tempFile = Path.GetTempFileName();
|
|
||||||
File.Delete(tempFile);
|
|
||||||
File.Copy(logFile, tempFile);
|
|
||||||
|
|
||||||
var content = File.ReadAllText(tempFile);
|
|
||||||
Assert.Contains($"{mustContainTraceLevel}", content);
|
|
||||||
Assert.DoesNotContain($"{mustNotContainTraceLevel}", content);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Environment.SetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TRACE", null);
|
|
||||||
Environment.SetEnvironmentVariable("ACTIONS_RUNNER_TRACE_LEVEL", null);
|
|
||||||
// Cleanup.
|
|
||||||
Teardown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Setup([CallerMemberName] string testName = "")
|
private void Setup([CallerMemberName] string testName = "")
|
||||||
{
|
{
|
||||||
_tokenSource = new CancellationTokenSource();
|
_tokenSource = new CancellationTokenSource();
|
||||||
|
|||||||
Reference in New Issue
Block a user