How does TeamCity know when the xUnit.net test runs?

I always wondered how TeamCity admits that it runs xUnit.net tests and how it knows to add a separate Test tab to the build overview after completing the build phase. Is the xUnit console console somehow responsible for this?

+6
source share
1 answer

Finally found what is actually happening. TeamCity has its own API. I dug this piece of code from xUnit source code and it becomes clear:

https://github.com/xunit/xunit/blob/v1/src/xunit.console/RunnerCallbacks/TeamCityRunnerCallback.cs

public override void AssemblyStart(TestAssembly testAssembly) { Console.WriteLine( "##teamcity[testSuiteStarted name='{0}']", Escape(Path.GetFileName(testAssembly.AssemblyFilename)) ); } 

... code omitted for clarity

+6
source

Source: https://habr.com/ru/post/969890/


All Articles