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?
Related
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'
I have let gradle generate a gradle app for me (gradle init --type=kotlin-application).
It users kotlin-test (org.jetbrains.kotlin:kotlin-test) as test framework.
However, when I invoke "./gradlew build" and a test fails, I get output where the actual failed test assertion is missing, for example
de.eekboom.eeksv.SimplestTest > testStreaming FAILED
java.lang.AssertionError at SimplestTest.kt:48
5 tests completed, 1 failed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///D:/dev/eeksv/build> /reports/tests/test/index.html
I can of course, open the linked index.html for test results, but that is a bit annoying.
Only when I run that specific test (from within IDEA) I get more helpful output like
expected:<3> but was:<2>
java.lang.AssertionError: expected:<3> but was:<2>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:834)
...
at de.eekboom.eeksv.SimplestTest.testStreaming(SimplestTest.kt:48)
When I use Java and the gradle groovy DSL, I can fix this by configuring the test task:
testLogging {
events TestLogEvent.FAILED // Show specific test failures in output
exceptionFormat = TestExceptionFormat.FULL // Output full failure details
}
How can I do the same for kotlin?
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.
I have been using SonarQube for code analyzing at a basic level however now I would like to measure the code against FX-COP rules. Hence I am attempting to use MSBuild SonarQube scanner. I read the documentation thoroughly and have setup my project likewise however when I execute it gives me error.
Below is the extract from the log:
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\....\1c36691bf5270463\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
Checking for updates...
MSBuild SonarQube Runner Pre-processor 1.0.2.0
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Updating build integration targets...
Fetching analysis configuration settings...
Generating rulesets...
Pre-processing succeeded.
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34209]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 11/20/2015 1:46:41 PM.
Project "C:\Project1.sln" on node 1 (rebuild target(s)).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Build succeeded.
9 Warning(s)
0 Error(s)
Time Elapsed 00:01:07.86
MSBuild SonarQube Runner Bootstrapper 1.0.2.0
Default properties file was found at C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Loading analysis properties from C:\...\1c36691bf5270463\SonarQube.Analysis.xml
Post-processing started.
MSBuild SonarQube Runner Post-processor 1.0.2.0 gives several warnings similar to one below:
WARNING: File is not under the project directory and cannot currently be analysed
by SonarQube.
File: C:\Users\...\AppData\Local\Temp\2\.NETFramework,Version=v4.0.AssemblyAttributes.cs,
project: C:\...\1c36691bf5270463\SOURCE\x\y.csproj**
Calling the sonar-runner:
SONAR_RUNNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..
SonarQube Runner 2.4
Java 1.8.0_51 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
SONAR_RUNNER_OPTS=-Xmx1024m
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\...\1c36691bf5270463\.sonarqube\bin\sonar-runner\bin\..\conf\sonar-runner.properties
INFO: Project configuration file: C:\TeamCity\buildAgent\work\1c36691bf5270463\.sonarqube\out\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\...\1c36691bf5270463\.sonarqube\out\.sonar
INFO: SonarQube Server 5.1.1
13:47:51.150 INFO - Load global repositories
13:47:51.743 INFO - Load global repositories (done) | time=593ms
13:47:51.758 INFO - Server id: 20151120125423
13:47:51.758 INFO - User cache: C:\...\cache
13:47:51.758 INFO - Install plugins
13:47:51.836 INFO - Install JDBC driver
.
.
.
13:47:55.518 INFO - ------------- Scan file1
13:47:55.534 INFO - Load module settings
13:47:55.658 INFO - Load rules
13:47:56.017 INFO - Base dir: C:\...\1c36691bf5270463\SOURCE\xxx
13:47:56.017 INFO - Working dir: C:\...\1c36691bf5270463\.sonarqube\out\.sonar\AC1_AC1_497EBFF2-C710-4843-8263-F534AF803D3E
13:47:56.017 INFO - Source encoding: UTF-8, default locale: en_US
13:47:56.532 INFO - Quality profile for cs: Sonar way
13:48:00.635 INFO - Sensor org.sonar.plugins.csharp.CSharpFxCopProvider$CSharpFxCopSensor#73c82ec1
INFO: -----------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: -----------------------------------------------------------------
Total time: 10.156s
Final Memory: 16M/306M
INFO: -----------------------------------------------------------------
13:48:00.791 Creating a summary markdown file...
Press any key to continue . . .
You need to run all your commands in a Developer Command Prompt for Visual Studio 2013 or higher and:
use at least MSBuild 12.0
have .NET 4.5.2+ installed
You have this error because the FxCop Results are not generated.
Do you see in the MSBuild's logs, execution of FxCop? This is visible inside the RunCodeAnalysis section of MSBuild's logs.
You need to run this from command line and use the "-X" flag on your command, this will give you verbose debugging, I would highly reccomend doing the following for troubleshooting.
sonar-runner.exe <arg> <arg> -X > sonar-runnerLog.txt
Then read or dump that log back here. either way you'll know a lot more about what the actual problem is.
You can get Visual Studio Express 2013 (or 15) for free and both of those come with their respective developer command prompts.
I launched the tests IDE (selenium) from jenkins and I uploaded the XUNIT plugin for having a nice report of test but at the end I obtained this message of ERROR :
Tests failed, see result file for details:
D:\FTP\stm_atos_automatisation\rapports\ff39\rapport_ff39.html ERROR: Build step failed with exception java.lang.NullPointerException: The types section is required.
at org.jenkinsci.plugins.xunit.XUnitProcessor.<init>(XUnitProcessor.java:65)
at org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:111)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381) Build step 'Publish xUnit test result report' marked build as failure Finished: FAILURE
Is there any way to solve this problem?
I was getting this error too when I first enabled the XUnit plugin.
I hadn't realized (or had forgotten) that I needed to add a report type to the XUnit build step configuration. To do so, click Add and then select the type of report you want parsed (for me it was PHPUnit-3.x). See this screenshot. You'll also have to specify the path to the XML report files that you want parsed. (I'm using Codeception, so it was tests/_log/*.xml.)