Search code examples
azure-devopsazure-pipelinesvstest

Azure pipeline- VsTest - testAssemblies does not captures TestMethod log


Is there anyway where we can capture test method's logs For example: - I wrote a test method which compares the same data type lists from database A and database B. And then , Assert.AreEqual(listA.count, listB.count)

List has thousands of records and take while to run.. let say it takes 1 minute time to run the test method.. and VsTest-testAssemblies does not capture log of that 1 minute.. Is there anyway we can record those logs.


Solution

  • What log do you want to capture? If it refers to the process of the test method, I am afraid this is impossible to achieve. The "Assert.AreEqual" method is a built-in method of VsTest. If you want to output some specific logs, you can try to write a custom test method . If it refer to list the records of the database, you can echo these records in script.

    it takes 1 minute time to run the test method I think this one minute is used to execute the test method, during this period there could be no log generated. This is an expected behavior. If I have any misunderstandings, please point out.