-
Notifications
You must be signed in to change notification settings - Fork 153
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
TeamCity Mode cannot be turned off #535
Comments
As far as I can tell the only way to stop the messages from being written is to "undeclare" the environment variable TEAMCITY_PROJECT_NAME, e.g. removing it - or setting it to the empty string - before calling the console. Why the behaviour is like this I don't know.
|
Yeah, my current workaround in my fake script is to grab the environment variable, set to empty, call nunit, set value back after. And very much like a bug (or accidental feature) |
IIRC the current behavior was requested by the TeamCity folks. |
@NikolayPianikov - can you help with this one? 🙂 |
I essentially get 2 reports of tests. |
Unfortunately, none of us who worked on the nunit side of this are users of teamcity. Our understanding from the JetBrains folks was that their integration of test status could only work through the special messages. It sounds like you run under teamcity but don't actually want that integration. Is that the case? |
That is correct, I do not want TeamCity messages from the console. |
We would have to introduce an option like --teamcity:off and only use the environment variable if nothing was specified. What do people think about that? |
I like that, means I don't need to hack about with variables maybe "--no-teamcity" the same as no-restore on the dotnet cli? |
Personally, I find it a bit strange that we need to both have the option |
@BlythMeister The most simple way is to remove TeamCity extension from your NUnit bin directory or install NUnit via NUnit.ConsoleRunner and all required extensions without TeamCity |
@NikolayPianikov That would definitely do it. I guess I assumed they couldn't because of other applications. |
I could add an environment variable to forcibly turn off TeamCity reporting in the extension |
@NikolayPianikov Currently i use NUnit.Console |
@BlythMeister Most of them are quite obvious like NUnit.Extension.NUnitV2Driver, but |
@BlythMeister As follows (all prefixed with
|
@NikolayPianikov The general idea with extensions is that once they are installed and enabled by the runner, they do there job. IOW "policy" decisions about whether to use the extension are made at a higher level. In any case, in practice, it would be messy if the extension were self-enabling/disabling in addition to having it done by the runner through the engine API. You could end up with a race. |
@mikkelbu I agree entirely. We implemented it first as an option but then got the request for allowing the environment variable to turn it on as well as a way of making it easier for users. It probably does for most users, but it ain't pretty. 😄 Issue #148 as discussed ended up dealing with allowing extensions to access information the runner and engine already have. That's not necessary here, first because the engine doesn't have the info (i.e. user really doesn't want to enable teamcity extensions under teamcity) and second because it doesn't really need that info because it's the runner's job to enable / disable the extension for whatever reason. I do think we need a more general way to add command-line arguments, by first allowing the console to define extension points and second by creating an option interpreter extension point. That's kind of big, however. 😸 |
I actually think this is a solved problem. This is my mistake. I'm happy for this issue to be closed. For my use case, i didn't actually need any of the extensions! |
When you do not pass the --teamcity argument NUnit console still detects that it's running on teamcity and sends the service messages.
This makes the --teamcity parameter pointless (unless you want services messages when not on teamcity)
How can i stop the teamcity service messages from being written to the console.
The text was updated successfully, but these errors were encountered: