mirror of
https://github.com/actions/runner.git
synced 2025-12-12 14:17:46 +00:00
Add filetable to testing file, remove ? since we know filetable should never be non null
This commit is contained in:
@@ -75,7 +75,7 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
// Add this file to the FileTable in executionContext if it hasn't been added already
|
// Add this file to the FileTable in executionContext if it hasn't been added already
|
||||||
// we use > since fileID is 1 indexed
|
// we use > since fileID is 1 indexed
|
||||||
if (fileId > executionContext.FileTable?.Count)
|
if (fileId > executionContext.FileTable.Count)
|
||||||
{
|
{
|
||||||
executionContext.FileTable.Add(fileRelativePath);
|
executionContext.FileTable.Add(fileRelativePath);
|
||||||
}
|
}
|
||||||
@@ -298,13 +298,10 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the file table from the Execution Context
|
// Add the file table from the Execution Context
|
||||||
if (executionContext.FileTable?.Count > 0)
|
|
||||||
{
|
|
||||||
for (var i = 0; i < executionContext.FileTable.Count; i++)
|
for (var i = 0; i < executionContext.FileTable.Count; i++)
|
||||||
{
|
{
|
||||||
result.GetFileId(executionContext.FileTable[i]);
|
result.GetFileId(executionContext.FileTable[i]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
_ec.Setup(x => x.ExpressionFunctions).Returns(new List<IFunctionInfo>());
|
_ec.Setup(x => x.ExpressionFunctions).Returns(new List<IFunctionInfo>());
|
||||||
_ec.Setup(x => x.IntraActionState).Returns(new Dictionary<string, string>());
|
_ec.Setup(x => x.IntraActionState).Returns(new Dictionary<string, string>());
|
||||||
_ec.Setup(x => x.EnvironmentVariables).Returns(new Dictionary<string, string>());
|
_ec.Setup(x => x.EnvironmentVariables).Returns(new Dictionary<string, string>());
|
||||||
|
_ec.Setup(x => x.FileTable).Returns(new List<String>());
|
||||||
_ec.Setup(x => x.SetGitHubContext(It.IsAny<string>(), It.IsAny<string>()));
|
_ec.Setup(x => x.SetGitHubContext(It.IsAny<string>(), It.IsAny<string>()));
|
||||||
_ec.Setup(x => x.GetGitHubContext(It.IsAny<string>())).Returns("{\"foo\":\"bar\"}");
|
_ec.Setup(x => x.GetGitHubContext(It.IsAny<string>())).Returns("{\"foo\":\"bar\"}");
|
||||||
_ec.Setup(x => x.CancellationToken).Returns(_ecTokenSource.Token);
|
_ec.Setup(x => x.CancellationToken).Returns(_ecTokenSource.Token);
|
||||||
|
|||||||
Reference in New Issue
Block a user