UWP unit testing with Jenkins - unit-testing

It is not really an issue I would like to ask today but I search best practices to unit testing a UWP application with Jenkins.
First, I created a Unit Test App for my main application and, on my development machine, I generated appx package using MSBuild command line tool. It works well and I can also execute unit tests with the VS Test console.
Then I tried to automate it with Jenkins on my build server. But the MSBuild command does not work. I have no issue but it produces no output. After lot of research (without any success), my question is the following:
What is the best way to make UWP unit testing with a result dashboard using Jenkins?
Thanks

In order to make MSBuild work correctly, I had to create two subsequent build steps, one with command line argument:
-t:restore
in order to make it restore all the nuget dependencies, and a second one with command line arguments:
/t:Rebuild /p:Configuration=Release
/p:UapAppxPackageBuildMode=StoreUpload
for the real release compilation and the creation of both sideload and storeUpload msix files

Related

"No test is available" when attempting to run VSTest for a GoogleTest exe

I have a C++ project that I am attempting to build and run using Azure Pipelines.
The build is working fine but I can't seem to get the unit tests to run in VSTest task using GoogleTest.
It was my understanding Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest is installed (as per https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md) so it can't be that.
Looking at the log I see:
No test is available in D:\a\1\s\Release\UnitTests.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
I also attempted a Command Line Script task but running the UnitTests.exe just yields:
'UnitTests.exe' is not recognized as an internal or external command,
operable program or batch file.
I solved this in the end by installing the Nuget package "GoogleTestAdapter" by Christian Soltenborn. All now seems to work fine but still very puzzled why this workaround is needed

Configure SpecRun in TeamCity

I have some specflow test and I have configured it to Run in Teamcity using NUnit Runner. But currently
I have a requiremenet to run all the test using SpecRun Runner in TeamCity.
I am quite clueless as how to configure to run test using specrunner in Teamcity as I didnt find a option
in the Runner dropdown in Teamcity to select SpecRun.
Can anyone please help me in giving some info on configuring specrun in Teamcity.
Thanks
I suspect that you will have to use a generic command line step in order to run SpecRun.exe to run the tests. As long as you use the command line switch /buildserver:teamcity then SpecRun should output the correct messages to allow integration with TeamCity so that it shows the tests as passed or failed.
Timothy, Teamcity Runner Dropdown does not provide a Specrun Option.
What can be done is write a .bat file to run runtests.cmd, i.e
"C:\Users\username\Documents\Visual Studio 2015\Projects\Blah_Blah_Project\Project_Name\runtests.cmd".
Now, save this .bat file in any C drive location. Select "Command Line" from TeamCity Dropdown, click on Advanced Option. Mention the Working Directory(path to .bat file) and Command Executable (name of the bat file).
I am assuming here, you have downloaded Specrun.Specflow plugin using nuget manager in Visual Studio and configured Default.srprofile file and successfully fired the specflow testcases from command line using runtests.cmd.

How to run Windows phone 8 & 8.1 Unit tests in jenkins [Visual studio 2013]

We use Jenkins as our CI, and im looking to have Jenkins run visual studio tests. Ive figured out how to have Jenkins use vstest.console.exe for desktop applications, but im not sure how to get that to work for windows phone 8.1 tests. I'm running vstest.console.exe against my unit test project's appx file, but im getting:
Error: App package ...appx does not has test executor entry point. For
running unit tests for Windows Store apps, create app package using
Windows Store app Unit Test Library project.
Any help getting the program to work thorugh command line would be of big help, but if there is a short cut to run it through jenkins that would be even better.
I found an answer to my problem. Make sure to use /InIsolation, and use /Settings:{settingsFile}. For some reason vstest.console.exe cant run the unit tests for windows phone without specifically setting a settingsfile. In jenkins/vsTestrunner there is an option to set the settings file. You will likley still get an error regarding running the test in non-interactive way on jenkins, but there are a few stackoverflow posts about this already.

Adding test cases to TeamCity

I have written some automated test cases in java (selenium IDE)for a project.The project is using ruby on rails. The project was configured in TeamCity. Now I am planning to add these test cases as a build step. How can I achieve this. Which build step should I use.
How do you run them on your local machine?
If you run them from command line you can create build configuation with Command Line runner.If you run them by running JUnit test you can create a build configuration that runs JUnit tests (using some build tools like Ant, Maven, Gradle).

How to use python build script with teamcity CI?

I am currently researching using the TeamCity CI software for our comapanies CI automation needs but have had trouble finding information about using different build scripts with TeamCity. We have C++ projects that need to have build/test automation and we currently have licenses for TeamCity. I have looked into using scons for the build automation but havent been able to find much information about using a python build script with TeamCity. If anyone could provide information about this to a CI beginner would be much appreciated.
Thanks
We use TeamCity to run our acceptance test suite (which uses Robot Framework - done in python).
Getting it to run was as simple as wrapping the python call with a very simple NAnt script. It does 2 things:
Uses an exec task to run python with the script as an argument.
Gets the xml output from the build and transforms it into something teamcity can understand.
There are probably tasks to run python scripts directly with NAnt but we've not had to use them - it was pretty easy to get up and running. You could do the same sort of thing using Ant or whatever depending on what your platform was.