Code Coverage not showing in Azure Devops after enabling options - azure-devops

I have service fabric project .net core 2.1 project and have created unite test case. I added the VSTest step after the build step and enabled "Code Coverage Enabled" but I do not see any information related code coverage after the build.

You need the test sdk's running on the agent (VS Pro or Enterprise). You can also use the Visual Studio Test Platform Installer task for this, as this will install all the necessary tools.
You need to publish the test results with a task 'Publish test results' if I am correct.

Related

How to enable Xcode Cloud code coverage report post build?

I can't find any information on Xcode Cloud code coverage. At the end of the run, the menu only shows:
Tests
Logs
Artifacts
What are the options here? Post-build script?
The workflow is setup with 2 actions:
Build
Test

How can I have robot framework test cases in Visual studio-Test Explorer

I want to link my manual test cases in Azure test plan to robot framework automation test cases( python based test case using selenium library).
Performed below steps :
Created a test project containing my robot framework automated tests.
Checked test project into an Azure DevOps repository.
Created a build pipeline for the project, ensuring that it contains the automated test.
When I executed build pipeline, it appears in Visual Studio - Solution explorer but not in Test Explorer.
enter image description here
My question is how can I get robot framework test cases to appear in VS - Test Explorer so that I can associate it to manual test cases in Azure test plan.
Can you please tell me the steps that I need to do in VS to get Test Scenarios.robot in Test Explorer ?

VSTest-Task not running .NET Core 2.1 xUnit-Tests from Test-plan

I'm trying to create a release pipeline in VSTS that runs my xUnit-tests as specified in a Test Plan.
Long story short: I can't get it to work.
What I'm using:
Azure DevOps (formerly VSTS)
Visual Studio Test task (v2.*)
Test project targeting .NET Core 2.1
xunit 2.4 with xunit.runner.visualstudio 2.4
In Azure DevOps I defined a Test Plan that contains a Test Suite which contains a Test that has an Associated Automation which points to my xUnit test.
I had to use the REST API to link the test code to the Test as described here.
I can select that Test in the visual designer for the VSTest task.
When I run the release pipeline the VSTest task fails with the following error message:
DiscoveryMessage : System.IO.FileNotFoundException: Unable to find tests for D:\a\r1\a\Foo.Tests.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
The path to the Foo.Tests.dll is correct, all required files are copied as well.
I explicitly specified the framework version in a .runsettings file (as the option Other console options doesn't work when using the Test plan option).
Specified the path to custom test adapters
used Visual Studio 2017 and Installed by Tools Installer options
Added a .NET Core Tool installer to install the correct .NET Core SDK
...and any other combination of settings I could think of.
The error message is still the same.
Any ideas what I might be missing? Your help would be greatly appreciated at this point!
After several more hours we stumbled across a web page that stated that you don't have to copy the binaries of your test project as input for the VSTest task but PUBLISH it instead. That never came to mind as vstest.console.exe runs smoothly when you point it at the binaries on a local machine.
UPDATE: We had to add a Publish Artifact task at the end of our Build Pipeline and make the Release Pipeline pick up the published artifact.

Deploy + desktop application + TFS 2017

I have a winForm application. I want to install it on the server every time the CI/CD happens. Later, after I install it(i don't know how to automate installation as well.), I want to run UI tests on it. What task should I add to my release management?
I only found web deployment when I researched. Since, mine is a desktop application, I need different build/release task. I could do it from vs2017(by right click project + publish)
I want similar one from TFS 2017.
You can try to build with the publish profile. See Publish profile.
In TFS using VS Build step with the MSBuild Arguments something like below:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.StagingDirectory)\\" /p:PublishProfile="YourPbulishProfile"
You can reference this article : Using Web Deploy in Visual Studio Team Services Release Management
To run coded UI tests from TFS.
Firstly, you need to run your agent as an interactive process. Regarding how to deploy an agent on windows, please refer to this link.
Secondly, add your coded UI tests project into TFS version control.
Last, create a build definition to use Visual Studio Test Agent Deployment task and Run Functional Tests task to run the tests.
Reference below articles:
Continuous integration, test, and deployment tutorial
Deploy a Desktop App from TFS to VM for Coded UI Test.
I found a way to publish my desktop application on to the server. below is the article which explains the build tasks needed.
Click here

Dotnet test on .NET Core 1.1 in VSTS: No Test Discoverer is Registered

I'm using VS 2017 with the new csproj in a .NET Standard class library, trying to test the library with a .NET Core 1.1 test project using MSTest testing framework with the dotnet test command. Running locally works perfectly fine; when I send the build to continuous integration, I get the error:
No test discoverer is registered to perform discovery of test cases.
How do I get this discoverer registered, and my tests running, in VSTS?
This is my build process on VSTS (detailed on my blog here)
Add a dotnet restore task.
Then a dotnet build task.
Add a dotnet test task with the arguments --no-build --logger "trx;LogFileName=tests-log.trx
Add a Publish test results task with the following settings
Test Result Format = VSTest
Test Result Files = **/tests-log.trx
Merge Test Results = (checked)
In Control Options set Run this task to run even if a previous task has failed
Refer to these steps below:
Create a new .Net Core test project with MSTest testing framework, there are MSTest.TestAdapter and MSTest.TestFramework package references, which is importance
Add .NET Core (Preview) step (Command: restore)
Add .NET Core (Preview) step (Command: build)
Add .NET Core (Preview) step (Command: test)
Queue build with Hosted VS2017 build agent.