Closed Sebazzz closed 7 months ago
@Sebazzz hi!
The attachment reporting supported via VSTest was added in TeamCity 2018.2. So, this condition is a guard to ensure that TeamCity.VSTest.TestAdapter is compatible with the TeamCity version and a couple of feature toggles – again just for the sake of compatibility. There were a number of possibilities to use these test adapters with TC version, which doesn't support attachments. We should probably remove feature toggles at least after checking if it is safe since it looks like right now the modern TeamCity version is able to support
To pass this condition and send attachments to the TeamCity server, you need the following:
TEAMCITY_LOGGER_ALLOW_EXPERIMENTAL
environment variable set to true
value (or don't pass it into the build process at all since the default version is true
)TEAMCITY_DOTNET_TEST_METADATA_ENABLE
environment variable set to true
value (or don't pass it into the build process at all since the default version is true
)TEAMCITY_VERSION
environment variable set to the actual TeamCity version greater or equal than 2018.2
.So, if you have an issue with the behavior, perhaps one or several of these env vars in the wrong state in dotnet test ...
process. I'd suggest you logging the values of these env vars before the dotnet test
running or/and inside a test. Just for debugging purposes and to be sure about values.
@mchechulnikov Thanks, if figured it out inserts facepalm
Our TeamCity installation is years old, at least since 2013 but probably earlier. At some point someone, me probably, added the TEAMCITY_VERSION environment variable as set it to 10
, probably to trigger Cake or Nunit back then to detect TeamCity properly. We never deleted the variable.
Using this test adapter, attachments are not reported via service messages but via stdout, like this:
Going by
Options
:https://github.com/JetBrains/TeamCity.VSTest.TestAdapter/blob/b5d4df3102946616dcfca033d0a42756fa1c990f/TeamCity.VSTest.TestLogger/Options.cs#L58-L59
And going by
Attachments
:https://github.com/JetBrains/TeamCity.VSTest.TestAdapter/blob/b5d4df3102946616dcfca033d0a42756fa1c990f/TeamCity.VSTest.TestLogger/Attachments.cs#L37-L41
Everything should, by default, be reported through service messages.
Running
dotnet test
through a build script (Cake). Am I missing any settings?