TFS 2015 Build - Run functional tests - Failed to obtain durationInMs field - selenium

The step "Run functional tests" in a build lauched with TFS 2015 ends with this error message :
DistributedTests: Test run is aborted. Logging details of the run logs.
DistributedTests: Une nouvelle série de tests a été créée.
Série de tests mise en file d\'attente pour Project Collection Build Service (TEAM FOUNDATION).
DistributedTests: Test discovery started.
DistributedTests: Test Run Discovery Completed . Test run id : 14886
DistributedTests: 2 test cases discovered.
DistributedTests: Test execution started. Test run id : 14886
DistributedTests: UnExpected error occured during test execution. Try again.
DistributedTests: Error : Une ou plusieurs erreurs se sont produites.--->Failed to obtain durationInMs field.
DistributedTests: Test run aborted. Test run id: 14886
Any ideas to fix it?

There is a known issue on vsts-tasks github, check you are not having the following:
System is expected to throw “Failed to obtain durationInMs” error if TFS/Build Agent is Update 1, but Test Agent is higher than Update 1 viz Update 2. The reason is that we have done changes around durationInMs in Test Agent 2015 Update 2 and also in TFS 2015 Update 2, hence Test Agent 2015 Update 2 and higher versions are not backward compatible with lower versions of TFS.
Also both from the linked issue and from here it seems that the reason can be that the system is in French.

Related

Unable to Publish NUnit test result report getting error message stating, Could not read the XSL XML file

While publishing NUnit report in Jenkin getting an exception "ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author". I am using
.Net Core MVC App in C#
NUnit project
Jenkin
Using command "dotnet test ".\WebApp2nUnit\WebApp2nUnit.csproj" --logger:"trx;logFileName=Report.xml""
in freestyle jenkin project.
Although build success along with I could see test result report is forming but at the time of publishing this report getting below exception. I am using the NUnit plugin to publish this. Provided is the compete error message:
Test Run Successful.
Total tests: 3
Passed: 3
Total time: 5.3879 Seconds
C:\Program Files (x86)\Jenkins\workspace\WebApp2>exit 0
Recording NUnit tests results
Error in NUnit processing: Could not transform the NUnit report. Please report this issue to the plugin author
ERROR: Step ‘Publish NUnit test result report’ failed: Could not read the XSL XML file. Please report this issue to the plugin author
Finished: FAILURE
Please suggest.
Nishant
I added this package to my solution: https://www.nuget.org/packages/NunitXml.TestLogger/
Then the command used is:
dotnet test folder/project.csproj --filter "TestCategory=category" --results-directory ./folder/ --test-adapter-path:. --logger:"nunit;LogFilePath=TestResult.xml"
and to publish:
nunit testResultsPattern: 'folder/TestResult.xml'

TFS 2017 Test Task Version 2 unable to get Feature Flag warnings

Recently started getting the following warnings from my VsTest task Version 2 (Version 1 does NOT produce the warnings) after the build machine completes a (TFS2017) build:
Unable to get feature flag: TestExecution.EnableTranslationApi
Unable to get feature flag: TestExecution.EnableDiagnostics
I created a simple build definition that has a VsTest task, but doesn't even have any tests and i get the same issue. Here's its log:
2019-05-15T17:42:14.4932509Z ##[section]Starting: VsTest - testAssemblies
2019-05-15T17:42:14.4943225Z ==============================================================================
2019-05-15T17:42:14.4943357Z Task : Visual Studio Test
2019-05-15T17:42:14.4943570Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2019-05-15T17:42:14.4943768Z Version : 2.145.0
2019-05-15T17:42:14.4943871Z Author : Microsoft Corporation
2019-05-15T17:42:14.4943976Z Help : [More information](https://go.microsoft.com/fwlink/?LinkId=835764)
2019-05-15T17:42:14.4944089Z ==============================================================================
2019-05-15T17:42:21.2906431Z SystemVssConnection exists true
2019-05-15T17:42:21.3711041Z ##[warning]Unable to get feature flag: TestExecution.EnableTranslationApi
2019-05-15T17:42:21.5124738Z SystemVssConnection exists true
2019-05-15T17:42:21.5301824Z ##[warning]Unable to get feature flag: TestExecution.EnableDiagnostics
2019-05-15T17:42:21.6498462Z Running tests using vstest.console.exe runner.
2019-05-15T17:42:21.6608055Z ======================================================
2019-05-15T17:42:21.6783692Z Test selector : Test assemblies
2019-05-15T17:42:21.6811412Z Test filter criteria : null
2019-05-15T17:42:21.7076165Z Search folder : D:\Agent02\_work\5\s
2019-05-15T17:42:21.8323849Z VisualStudio version selected for test execution : latest
2019-05-15T17:42:25.9981965Z Run in parallel : false
2019-05-15T17:42:25.9982368Z Run in isolation : false
2019-05-15T17:42:25.9982730Z Path to custom adapters : null
2019-05-15T17:42:25.9983384Z Other console options : null
2019-05-15T17:42:25.9983727Z Code coverage enabled : false
2019-05-15T17:42:25.9983845Z Diagnostics enabled : false
2019-05-15T17:42:25.9984208Z SystemVssConnection exists true
2019-05-15T17:42:25.9985363Z Run the tests locally using vstest.console.exe
2019-05-15T17:42:25.9985487Z ========================================================
2019-05-15T17:42:25.9985644Z Test selector : Test assemblies
2019-05-15T17:42:25.9985820Z Test assemblies : **\release\*test*.dll,!**\obj\**
2019-05-15T17:42:25.9985973Z Test filter criteria : null
2019-05-15T17:42:25.9986123Z Search folder : D:\Agent02\_work\5\s
2019-05-15T17:42:25.9986291Z Run settings file : D:\Agent02\_work\5\s
2019-05-15T17:42:25.9986492Z Run in parallel : false
2019-05-15T17:42:25.9986654Z Run in isolation : false
2019-05-15T17:42:25.9988401Z Path to custom adapters : null
2019-05-15T17:42:25.9988814Z Other console options : null
2019-05-15T17:42:25.9989201Z Code coverage enabled : false
2019-05-15T17:42:25.9989420Z Diagnostics enabled : false
2019-05-15T17:42:25.9990350Z Rerun failed tests: false
2019-05-15T17:42:25.9990938Z VisualStudio version selected for test execution : latest
2019-05-15T17:42:26.0399542Z ========================================================
2019-05-15T17:42:32.5917477Z ##[warning]No test assemblies found matching the pattern: **\release\*test*.dll,!**\obj\**.
2019-05-15T17:42:32.5917841Z ======================================================
2019-05-15T17:42:32.7510424Z ##[section]Finishing: VsTest - testAssemblies
What is this warning trying to tell me, and how can i fix it?

Jenkins 1.647 - PhpUnit Test fail but build succesfull

I have a Jenkins that run several task, included my tests with phpunit. Everything is working, the test are running but when a test fail the build is set like Succesfull and I don't get my notifications. I wanna that when a test fail, the build fail to notificate github and the developer too.
The notification system works OK when a build fail because I have migrations too that are working ok.
My phpunit.xml file look like this:
<phpunit
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="bootstrap.php"
cacheTokens="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
mapTestClassNameToCoveredClassName="false"
processIsolation="false"
stopOnError="true"
stopOnFailure="true"
stopOnIncomplete="true"
stopOnSkipped="true"
stopOnRisky="true"
strict="false"
timeoutForSmallTests="1"
timeoutForMediumTests="10"
timeoutForLargeTests="60"
verbose="true"
And this is one of the outputs of Jenkins.
There was 1 error:
Undefined index: payroll
/tmp/app/test/unit/payroll/PayrollTest.php:24
FAILURES!
Tests: 311, Assertions: 392, Errors: 1.
BUILD FINISHED
Total time: 2 minutes 17.89 seconds
[INFO] HipChat notification sent to the following rooms: app
Finished: SUCCESS
Hints ? Best regards.

What might be the reason of the 53 exception during 'Visual Studio Test Agent Deployment' step

Currently I'm trying to use tfs 2015 and vNext build system. There is this exception during 'Visual Studio Test Agent Deployment' step, and I'm not really sure what to do.
What might cause this exception:
Executing the powershell script: ...\DeployTestAgent.ps1
DistributedTests: Starting to deploy and configure test agent on test machines.
DistributedTests: Inputs provided are:
DistributedTests: Machines:
DistributedTests: Username: ...\...
DistributedTests: Machine Group name: Tracker Test Machines
DistributedTests: Run as process: False
DistributedTests: Login Automatically: False
DistributedTests: Disable Screen saver: False
DistributedTests: Agent location: C:\Distr\vstf_testagent.exe
DistributedTests: Update test agent: True
DistributedTests: Run test agent as DataCollection only : False
DistributedTests: Path to script that installs test agent on remote machine: ...\TestAgentInstall.ps1
DistributedTests: Path to script that configures test agent on remote machine: ...\TestAgentConfiguration.ps1
DistributedTests: Path to script that downloads test agent on azure remote machines : ...\DownloadTestAgent.ps1
DistributedTests: Path to script that checks if test agent is installed on remote machine: ...\CheckTestAgentInstallation.ps1
DistributedTests: Test Agent is being copied to: ...\Temp\3bc272a1-3cc0-479e-aff8-84483e1f6ad8\vstf_testagent.exe
DistributedTests: Task 'CopyFilesToTestAgent' on machine '...:5985' is being run
DistributedTests: Task 'CopyFilesToTestAgent' on machine '...:5985' completed.
DistributedTests: Task 'CopyFilesToTestAgent' for machine ...:5985's Error : System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
Failed to connect to the path \\... with the user .\... for copying.System error 53 has occurred.
The network path was not found.
---> System.Management.Automation.RuntimeException: Failed to connect to the path \\... with the user .\... for copying.System error 53 has occurred.
The network path was not found.
---> System.Management.Automation.RuntimeException: Failed to connect to the path \\... with the user .\... for copying.System error 53 has occurred.
The network path was not found.
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.<>c__DisplayClass26_0.<Invoke>b__0()
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.RetryExecutor.<>c__DisplayClass19_0`1.<Execute>b__0()
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.RetryExecutor.Execute(Action action)
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.RetryExecutor.Execute[T](Func`1 action)
at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable)
--- End of inner exception stack trace ---
...
Other remote powershell scripts seem to run without troubles. Not sure what it might be.
As usual, don't hesitate to ask for additional information.
Looks like you need to enable file sharing:
In this specific situation the RoboCopy tool is complaining that the
network path was not found, because I forgot to enable file sharing on
the target machine. Once I enabled file sharing an running again the
build everything was green, and I can verify that all files were
correctly copied on target machines.
http://www.codewrecks.com/blog/index.php/2015/06/20/build-vnext-support-for-deploying-bits-to-windows-machines/
I just had a similar issue and the problem was that I had to enable certain rules in the Windows Firewall that the Filesharing works.
I tested it by disabling the firewall completly and then just try to connect through the Windows Explorer to this FileShare via "\MachineName"
As soon as this worked, this error was gone as well.
After this I reenabled the Firewall again and tried to figure out the rules that have to be added.
In the Advanced Firewall settings are some rules regarding File and Printer Sharing that are disabled, I enabled those and that made it work.
Hope this helps

HttpHostConnectException let Apache Stanbol Integration Tests fail

I tried to install the Stanbol version from branch "release-0.12" from github.
On my system I have:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
When I start the command:
mvn install
I get the following error for the Apache Stanbol Integration Tests => error-log
The first lines of the error are:
06.08.2014 15:47:02.025 *INFO * [main] Setting org.osgi.service.http.port=8765
06.08.2014 15:47:02.026 *INFO * [main] Starting launcher ...
06.08.2014 15:47:02.030 *INFO * [main] HTTP server port: 8765
15:47:03,614 INFO StanbolTestBase:163 - Got HttpHostConnectException at
http://localhost:8765/ - will retry
When I skiped the test I also got no response from the server...
I already tried it with java-version 1.6, but there I got the error:
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireJavaVersion failed
with message:
Java 7 or higher is required to compile this module
Has someone an idea what I made wrong (does it need some further software requirements)? Or how can I get the server running correctly?
The integration test starts a Stanbol Server (actually the full launcher) in its own JVM. The tests waits for up to 180 seconds for this server to start. During that time the test resends some test requests to check if the server is up and running.
Based on the provided log this period starts at about "15:47" so the test should wait until about "15:50" before it gives up.
Because of the line
^C15:48:42,236 INFO StanbolTestBase:146 - Got 404 at http://localhost:8765/entityhub - will retry
in the log my guess is that the build process was manually canceled with ^C before the server was fully started.
The server side logs of the test run are available at target/launchdir/stanbol/logs/error.log. If the integration tests do fail one will usually find the reason in this log file.