Configuration of DOTNET plugin on a TeamCity linux agent
Answered
Hello,
I ma trying to configure a Linux agent to run a .NET build step to run UT on it and have the dotCoverage information.
Unfortunately, I am not able tot make it work. I have in the log file:
[2021-02-08 15:05:30,974] INFO - .dotnet.DotnetSdksProviderImpl - Try getting the list of .NET SDK from directory </snap/bin/sdk>. [2021-02-08 15:05:30,975] WARN - rver.dotnet.DotnetToolProvider - .NET Core SDK was not found (found .NET Core runtime at path </snap/bin/dotnet>). Install .NET Core SDK into the default location or set DOTNET_HOME environment variable pointing to the installation directory.
Even after defining the environment variable DOTNET_HOME with the correct path. It does not work.
Any help is welcome.
Thanks in advance
Stephane
Please sign in to leave a comment.
Hello Stephane,
Sorry for the delay; is the issue still topical for you?
Could you please let me know if the agent was restarted after the environment variable was defined? Do you see this variable in the list of agent parameters? If yes, could I ask you to enable generic debug logging on the agent and restart it so it tries to go through the .NET Core detection process again, then upload the teamcity-agent.log file to https://uploads.jetbrains.com/ and share the Upload ID with me?
Hello Fedor,
Thanks for your answer. Finally, I managed to make it work.
My agent is installed on an Ubuntu 20.04 and the installation of the Dotnet sdk is not common on this OS. I was wrong on the path, when I modified it to be /snap/dotnet-sdk/current it worked for the Dotnet plugin.
But I am still experiencing some problems with dotnet coverage. I am using the cross platform version. But it seems that the dotcoverage plugin does not use the locales of the OS. We have some UTs that retrieve the country code from the locales of the OS. Whenever we execute the tests manually it works, but when it's executed in TeamCity using dotnet coverage that encapsulate the run of the dotnet plugin it fails.
Can we force the locales of the dotnet coverage command line tool?
Thanks in advance
Hello Stephane,
Could I ask you to share the build log covering the failed run of UT in question via https://uploads.jetbrains.com/, so I will check with the development team?
Hello Fedor,
Please find the id of the log file 2021_02_17_HJQkjR6zcwMCibvm
Thanks in advance,
Stéphane
Hello Stephane,
Sorry for the delayed response.
From what I could see, TeamCity does not pass any extra arguments to the dotCover tool which would affect the system locale somehow; could you please let me know if you see the same issue with tests if you check coverage manually on the same agent under the same user (for example, like per this article)? I suspect that the issue might be about the dotCover itself, but I could not find any related issues on our tracker; if, as per the above check, the test fails with the same "Unknown country code IV", could you please either open a new thread on the dotCover forums or submit a bug entry? If the issue does not reproduce outside of TeamCity, kindly let me know and I will look into it further.