UWP Continuous Integration: How to automatically execute my test part inside of my Unit Test APP by MSTest commandline - unit-testing

My Universal Windows Application now is able to deploy and I try to associate my gitlab CI service to it,But failed to execute the test part automatically with MSTest commandline, which is separated from UWP and work as an Unit Test Application.
I had found so many solutions,telling me such as: Package my app Firstly before using the vstest.console command line to test(Cannot continuous integrate I guess), Making my Test APP and use the project's .dllfiles ,as the testcontainer, to test(Actually I cannot found out the .dll file)
What should I do next If I want to integrate APP with automatically testing part?
Here is the environment:
Windows 10 OS
Visual Stdio 2017(Includes Windows_10_14393 SDK)
GitLab + Windows Runner(same environment as PC)
Test Execution Command Line Tool Version 15.0.27309.0
And my DOM in Solution:
--+-- APP Solution
------+---APP1(University Windows Application)
------+---TestAPP1(Unit Test Application)

You have to just build the test pan p in Release mode and use the .appxreciepe as argument to run vstest.console. no need to build an appx package

Related

UWP unit testing with Jenkins

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

Enable Log TeamCity Tests - UWP

I have a problem when I try to write in console application of TeamCity.
In a Unit Test Project (classic) if I use Trace.WriteLine, TeamCity recognized that and write value in her console. Unique case when TeamCity write in her console are test Fail and I send a message, such as:
Assert.IsTrue(false, "My message");
In my project, Unit Test(Windows Universal), I try to use Trace, but this does not exist, I try to user System.Diagnostic.Debug.Writeline, but this only write in Visual Studio console when I run my tests in Debug mode.
Someone help me to write logs, when I execute my tests in my Unit Test (Windows Universal)?
Notes:
TeamCity Professional 10.0.3 (build 42434)
Agent: Windows 10
Project: Unit Test App (Windows Universal)
Framework Tests: MSTestFramework.Universal
Thanks in Advance

Xamarin Android unit test automation

I am using NUnitLite for unit tests in Xamarin android project. I can run the unit tests in debug mode on device or emulator by starting the project in VS, which will install the application and I can run tests on device/emulator.
I need to automate this in build process. How to automate this NUnitLite Testcases?
I am following the approach below:
Create a class extending from Xamarin.Android.NUnitLite.TestSuiteInstrumentation, and add the test assembly in OnCreate method.
Install the app in device.
Run the test cases using below command from ABD:
adb shell am instrument -w com.package,mypackage/app.tests.TestInstrumentation
Is this approach correct? Or can this be done any simpler way from NUnitLite itself?

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.

Jetty runner is not executing the war file

I have a project named as test using spring,hibernate and struts.It is running when am using eclipse.But when i export this project as war and execute it using jetty runner in command prompt it just extracted the project and listed the contents in the browser.But i want the project to be executed.I have tried with some other simple web application war using the same procedure and it works fine.But in my project its not working with jetty.
here is my code for jetty
D:\>java -jar jetty-runner-7.0.0.v20091005.jar test.war
i just listing some console output of jetty
INFO::RUNNER
NO tx manager found
deploying file:D:/test.war #/[webAppContext#86f241#86f241/,null,file:D:/test.war
can any one tell me a solution for my problem
1) use a newer version of runner, 7.6.3.v20120416
2) what context are you trying to navigate to, you might want to experiment with some of the other cli options on the runner to set the context and whatnot from the command line and experiment with that. This site has some good information on using this artifact as well.