Skip to content

Test Execution Logs

MarkAbrams edited this page Jan 22, 2024 · 4 revisions

The testing framework writes information to the test log so that the test author can understand what the test framework is doing and why a test is failing. The majority of the logs are the Standard Output from the Functions runtime that is executing the workflow being tested, but the framework also writes other information that is useful.

The test execution log includes:

  • Description of how the framework is updating the workflow, settings and connection files to enable isolated testing
  • Functions runtime start-up logs
  • Functions runtime workflow execution logs
  • Summary of the requests that were received by the mock HTTP server that is managed by the testing framework
  • Fluent API request matching logs - this is useful to understand how the testing framework is evaluating Request Matchers and Response Builders against a mock request.

Enable Functions runtime start-up logging

The Functions runtime start-up logs can be verbose and are not usually needed when authoring or running tests, unless the test is failing because the Functions runtime is not starting up correctly.

To reduce the volume of logging, the inclusion of the Functions runtime start-up logs is disabled by default. It can be enabled by adding the logging.writeFunctionRuntimeStartupLogs option to the testConfiguration.json file with a value of true:

"logging": {
  "writeFunctionRuntimeStartupLogs": true
}

The setting is optional. If it is not included, the default value is false.

Enable Fluent API Request Matching logging

When you are creating tests that define many mock request matchers using the Fluent API, it can be hard to understand why a mock request is not matching the expected Request Matcher. To help with debugging these types of issues, you can enable detailed logging of the evaluation of Request Matchers and Response Builders by adding the logging.writeMockRequestMatchingLogs option to the testConfiguration.json file with a value of true:

"logging": {
  "writeMockRequestMatchingLogs": true
}

The setting is optional. If it is not included, the default value is false.

Clone this wiki locally