Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"logging": {
"writeFunctionRuntineStartupLogs": false,
"WriteFunctionRuntimeStartupLogs": false,
"WriteMockRequestMatchingLogs": true
},

Expand Down
8 changes: 4 additions & 4 deletions LogicAppUnit/Hosting/WorkflowTestHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ internal class WorkflowTestHost : IDisposable

/// <c>true</c> if the Functions runtime start-up logs are to be written to the console, otherwise <c>false</c>.
/// The start-up logs can be rather verbose so we don't always went to include this information in the test execution logs.
private readonly bool WriteFunctionRuntineStartupLogsToConsole;
private readonly bool WriteFunctionRuntimeStartupLogsToConsole;

/// <summary>
/// Initializes a new instance of the <see cref="WorkflowTestHost"/> class.
/// </summary>
public WorkflowTestHost(
WorkflowTestInput[] inputs = null,
string localSettings = null, string parameters = null, string connectionDetails = null, string host = null, DirectoryInfo artifactsDirectory = null,
bool writeFunctionRuntineStartupLogsToConsole = false)
bool WriteFunctionRuntimeStartupLogsToConsole = false)
{
this.WorkingDirectory = Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid().ToString());
this.OutputData = new List<string>();
this.ErrorData = new List<string>();
this.WriteFunctionRuntineStartupLogsToConsole = writeFunctionRuntineStartupLogsToConsole;
this.WriteFunctionRuntimeStartupLogsToConsole = WriteFunctionRuntimeStartupLogsToConsole;

this.StartFunctionRuntime(inputs, localSettings, parameters, connectionDetails, host, artifactsDirectory);
}
Expand Down Expand Up @@ -137,7 +137,7 @@ protected void StartFunctionRuntime(WorkflowTestInput[] inputs, string localSett
{
var outputData = args.Data;

if (WriteFunctionRuntineStartupLogsToConsole || processStarted.Task.IsCompleted)
if (WriteFunctionRuntimeStartupLogsToConsole || processStarted.Task.IsCompleted)
{
Console.WriteLine(outputData);
}
Expand Down
2 changes: 1 addition & 1 deletion LogicAppUnit/InternalHelper/WorkflowApiHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public CallbackUrlDefinition GetWorkflowCallbackDefinition(string triggerName)
}
catch (HttpRequestException hrex) when (hrex.StatusCode == HttpStatusCode.NotFound)
{
throw new TestException($"The callback endpoint for workflow '{_workflowName}' was not found. This indicates that the Function runtime could not start the workflow. Enable the Function runtime start-up logging using the 'logging.writeFunctionRuntineStartupLogs' option in 'testConfiguration.json'. Then check the logs for any errors.", hrex);
throw new TestException($"The callback endpoint for workflow '{_workflowName}' was not found. This indicates that the Function runtime could not start the workflow. Enable the Function runtime start-up logging using the 'logging.WriteFunctionRuntimeStartupLogs' option in 'testConfiguration.json'. Then check the logs for any errors.", hrex);
}
catch (AggregateException ae)
{
Expand Down
2 changes: 1 addition & 1 deletion LogicAppUnit/TestConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class TestConfigurationLogging
/// <remarks>
/// Default value is <c>false</c>.
/// </remarks>
public bool WriteFunctionRuntineStartupLogs { get; set; } = false;
public bool WriteFunctionRuntimeStartupLogs { get; set; } = false;

/// <summary>
/// <c>true</c> if the mock request matching logs are to be written to the test execution logs, otherwise <c>false</c>.
Expand Down
6 changes: 3 additions & 3 deletions LogicAppUnit/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ internal TestRunner(
LoggingHelper.LogBanner("Starting test runner");
//Console.WriteLine($"Max workflow duration: {runnerConfig.MaxWorkflowExecutionDuration} seconds");

if (!loggingConfig.WriteFunctionRuntineStartupLogs)
Console.WriteLine("Logging of the Function runtime startup logs is disabled. This can be enabled using the 'logging.writeFunctionRuntineStartupLogs' option in 'testConfiguration.json'.");
if (!loggingConfig.WriteFunctionRuntimeStartupLogs)
Console.WriteLine("Logging of the Function runtime startup logs is disabled. This can be enabled using the 'logging.WriteFunctionRuntimeStartupLogs' option in 'testConfiguration.json'.");

_client = client;
_workflowDefinition = workflowDefinition;
_runnerConfig = runnerConfig;

var workflowTestInput = new WorkflowTestInput[] { new WorkflowTestInput(workflowDefinition.WorkflowName, workflowDefinition.ToString()) };
_workflowTestHost = new WorkflowTestHost(workflowTestInput, localSettings.ToString(), parameters, connections.ToString(), host, artifactsDirectory, loggingConfig.WriteFunctionRuntineStartupLogs);
_workflowTestHost = new WorkflowTestHost(workflowTestInput, localSettings.ToString(), parameters, connections.ToString(), host, artifactsDirectory, loggingConfig.WriteFunctionRuntimeStartupLogs);
_apiHelper = new WorkflowApiHelper(client, workflowDefinition.WorkflowName);

// Create the mock definition and mock HTTP host
Expand Down