-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration of XUnit and TeamCity is broken #1590
Comments
@smadala, @martincostello please take a look at this problem. In SDK 2.1.104 all works fine, since 2.1.200 we're able to reproduce it. |
@mayankbansal018, any progress on it? |
@singhsarab , can you please take a look at this issue |
@singhsarab, @smadala, we're getting more and more tickets about this breaking change. Please arrange the priority of this issue. |
@dtretyakov This is by design as verbosity minimal and quiet, the expectation is that no informational logs should be shown for these levels. Recommendation is use normal or detailed verbosity for full detailed logs. |
Using normal or verbose logging is not working. I can see the additional log messages, but nothing that is picked up by teamcity. |
Passing |
@singhsarab Verbosity level should not make any influence on CI integration. We should take in account that not only people run tests (they can use some IDE for this), vice versa in the most cases a CI runs tests via a command line. Now
It seems to be a breaking change, the very confusing behavior, thus the only thing we can recommend: "to not use these modes" by large red letters. |
To illustrate this change, here is a screenshot from my application's CI build in TeamCity. Build From the perspective of a TeamCity user, #1396 was a breaking change. |
@martincostello Your work around is not working for me. Are you using anything else in your setup? Any preview nuget packages? The verbosity change is not a work around to the problem, unless I'm missing something. Created a new build configuration with the dotnet CLI runner using DebugTestReporting_Tests_attempt-1.log |
@zone117x I'm not using the built-in .NET Core TeamCity runner - I'm using a vanilla PowerShell step that calls into my own |
Just created a custom script build step with |
What about if your put an equals between the parameter name and value like in my example above? Otherwise, I’m not sure why it would work for me but not for you. |
Wow. I tried @NikolayPianikov In the mean time, Teamcity .NET build agent needs to use lowercase variables for the verbosity option. |
@zone117x @martincostello thank you for info, done. Try updating to new version |
@NikolayPianikov which version specifically? |
@akatz0813 from this page for appropriate TeamCity version |
FYI I've found that using this argument instead means that test verbosity is increased to that required but build verbosity isn't, so then the behaviour is actually like-for-like: --logger:"console;verbosity=normal" |
@NikolayPianikov May I go ahead and close the issue? |
@singhsarab we just found some workaround for (JetBrains/teamcity-dotnet-plugin#127), but I hoped it is temporary solution. Also some related issues (like https://github.com/JetBrains/TeamCity.VSTest.TestAdapter#visual-studio-test-platform) have only partially workaround. |
@NikolayPianikov Unfortunate that this came as a breaking change for you guys, but glad that you have a solution in place now. As I mentioned earlier, this change in behavior is actually a fix we made to ensure we are consistent. The current behavior is by design. The solution you guys have now seems appropriate for specification. |
@martincostello I just bumped into the same issue! Saw your other tickets as well. I just upgraded from |
@NikolayPianikov @dtretyakov Can you please consider printing messages to console in teamcity logger? |
@smadala Yes but the test information will be duplicated depending on verbosity level |
@NikolayPianikov Can we add
Console logger behavior has been changing almost in every release as per different requirements of We really don't want to change the behavior of vstest console logger until it is very much required. I think teamcity CI integration can be achieved without depending on console logger behavior. |
TeamCity has a lot of clients and we treat them with respect. Many of them have already established CI processes and we must not allow any things to make their lives more difficult. When developers creating their products they are using VS Studio or Rider or something else and I know few of them who are really running tests from the command line after that. Of course console tools should be comfortable for users in the command line but we should not forget about an automation of build/test/deploy process. Thus CI services are no less important customers. Yes we thought about using pipes to reliable send an information about tests to CI. But this scenarion is not so transparent. In the case of stdOut customers can control and trace information exchange between all parts of CI and to solve a lot of issues independently. For pipes all this is much more difficult. Another thing what we could do is to the remove direct TeamCity support in xunit, because of this is not working reliably now. In this case TeamCity and xunit will avoid conflicts with information about tests. From my point of view your team and xunit team could discuss it. |
We all are on same page here. Can you please provide more details about your scenarios? We will work on a solution which will have little or no impact on Teamcity customers. If you are using |
With the console, TeamCity streams the test results to CI jobs in real time as they run. With |
TeamCity service messages are useful for a set of scenarios like gathering statistics, code coverage, code inspections, attaching artifacts, build process's flow control. And as @martincostello mentioned it provides real-time feedback to the TeamCity server and users can save a lot of time. TeamCity sends service messages when:
xunit (for dotnet core version only) sends TeamCity service messages when it finds the There is an intresting moment: when verbosity level is Summarizing, TeamCity cannot process the case with xunit for dotnet core properly, meanwhile other cases are working as expected. To minimize the consequences we have made verbosity levels as 'normal' by default for .NET CLI Plugin For TeamCity.VSTest.TestAdapter we have made verbosity levels as 'normal' by default using the paramer But anyway it does not look very good |
@NikolayPianikov Thanks for detail info. I will get back to you. |
@NikolayPianikov The verbosity levels of quiet and minimal shouldn't log information for successful tests. It was a bug that was fixed. Unfortunately the dependency has been taken on it and it is better to correct rather than let it remain for perpetuity. |
Hi, our team has just hit this problem. I agree with @joaopgrassi, this is a breaking change for users. |
@JamesFenton, did you tried using logging verbosity parameter mentioned above? #1590 (comment) |
@dtretyakov I did try it, and it does work. Its just annoying that |
Description
XUnit has built-in integration with TeamCity
Steps to reproduce
dotnet new xunit
SET TEAMCITY_PROJECT_NAME
to some value to simulate running under TeamCity, for instance:SET TEAMCITY_PROJECT_NAME=my
dotnet test --verbosity Minimal
ordotnet test --verbosity quiet
Expected behavior
You should find messages like
##teamcity[testStarted
in stdOutfor all verbosity levels
Actual behavior
There are no any messages like
##teamcity[testStarted
in stdOutEnvironment
dotnet --version:
2.1.200
2.1.300-rc1-008673
The text was updated successfully, but these errors were encountered: