I'm running some tests in an Azure Devops pipeline and I'm seeing some failures on the build agent that I don't get locally. I'm trying some low-fi debugging and want to write some chatter out to task log but I can't see how. I've tried Console.WriteLine()
, Debug.WriteLine()
and Trace.WriteLine()
but I don't see any of my messages in the log.
How can I write to the pipeline task log?
Stage: Package the extension and publish build artifacts Add "Use Node CLI for Azure DevOps (tfx-cli)" to install the tfx-cli onto your build agent. Add the "npm" task with the "install" command and target the folder with the package. json file. Add the "Bash" task to compile the TypeScript into JavaScript.
Check test status for a test suite You can check the test status for a specific test suite. Select Test Plans to open the Test Plans page, and then select a plan to view a test suite. Select New > New test result chart to create a test results pie chart. Group by Outcome.
You have to use a logger that's directed at ITestOutputHelper
. Details here: .net core 2.0 ConfigureLogging xunit test
If you are Ok with a third party here are two that will simplify the solution: https://blog.martincostello.com/writing-logs-to-xunit-test-output/ https://www.neovolve.com/2018/06/01/ilogger-for-xunit/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With