I've created NUnit Runner task, but it failes all the time.
As an executable I'm using nunit3-console.exe
My tests in .net 4.6.1 test project use NUnit3
This is how the job is configured:
nunit job configuration
After plan run I've got error:
Could not find test result reports in the C:\Users\dw\bamboo-home\xml- data\build-dir\DWT-BW-JOB1 directory.
Invalid argument: -xml=BW\14\TestResult.xml
I've found that is because NUnit runner task on Bamboo is designed to work with NUnit2. The "-xml" argument is not supported in NUnit3 console runner.
I've found somebody found a solution, but it does not work for me: http://vijayshinva.github.io/devops/bamboo/nunit/tdd/ci/2016/02/25/configure-atlassian-bamboo-nunit-runner-to-execute-nunit-3-tests.html
In my case I've got another error:
Could not find test result reports in the C:\Users\dw\bamboo-home\xml- data\build-dir\DWT-BW-JOB1 directory.
'nunit3-console.exe' is not recognized as an internal or external command, operable program or batch file.
Please, help resolve this issue. Thank you
Related
I'm trying to run SoapUI tests as unit tests as described here:
http://blog.simplecode.eu/post/Soap-UI-testing-with-MsTest
Everything works nice when I'm running test locally in visual studio.
But when I'm trying to run those tests during the build process on tfs2015 i get "Error: Could not create the Java Virtual Machine":
My other unit tests during that build are performed correctly.
Anyone had similar issue?
It's not a really build error in TFS. You can see the result in your screenshot, build partially succeeded.
Currently, by default the build result is "Failed" if anything failed to compile, "Partially Succeeded" if there are any unit test failures, and "Succeeded" otherwise.
Build is reported as "Partially Succeeded" when the "Test Success" property is set to "False" and "CompilationSuccess"="True"
So your error is more like something in your code fails the test or some configuration related to test in the build definition or build agent environment. Since everything works nice when you are running test locally in visual studio.
Seems disable code coverage fixed the issue.
Manage, to fix that - problem was enabled code coverage. Disabling it fixed to problem.
So I've managed to get jasmine maven plugin to work with maven and our js unit test.
All is running well, but i found when there's a test that failed, bamboo will say it failed, but the error is "No failed tests found, possible compilation error ocurred".
I've tried to get it to parse TEST-jasmine.xml result by specifically specify the folder JUnit parser needed, and get jasmine to write to that folder using jasmineTargetDir tag in pom.xml, but it's still not finding the right result. Jasmine faithfully write the test result to the folder, but seemingly JUnit is not parsing it?
Any clue as to why and how to solve the issue?
Running on Bamboo v 5.14.3.1 I've configured the Maven task of Default Stage to search for test result files:
And then produced fake failing test. After that the build failed with failing test:
Hope this helps
I have used Maven project with Selenium & TestNG to create automated scripts which I want to execute from Jenkins. In Jenkins I have added the TestNG plugin to publish the TestNG report. But it is not getting displayed. I'm getting the below mentioned error.
Error:
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: /target/surefire-reports/testng-results.xml
Did not find any matching files.
Finished: SUCCESS
Actual path of the TestNG report file:
E:\STUDY_MATERIAL\JAVA\WORKSPACE\SeleneniumFrameWork\target\surefire-reports\testng-results.xml
I have tried the following options but didn't work out for me.
Tried giving the full path of the TestNG report. Forward ans backward slash in the pattern.
I have tried different other options by changing the TestNG result file path but it's working for me.
Please share some inputs on how to resolve this issue.
"testng-results.xml" file is available in workspace. But it's failed to display the report. I have attached screenshot of Jenkins workspace and Console Output.
Note: I am using Jenkins 2.7.0 in Windows 10.
Jenkins Workspace
I have attached the Job configuration details of Jenkins.
Job Configuration Details
Few checkpoints :
1. Check if testng is producing this file at the specified location : /target/surefire-reports/testng-results.xml
2. TestNG needs to be configured to generate xml report
If this file is there, pass path in file locator as :
target/surefire-reports/testng-results.xml
Hopefully, you will get results on jenkins if everything mentioned above is correct.
So my situation is that I finally finished configuring TeamCity for CI. I got it to run my unit tests with some friendly help on SO.
However, many unit tests fail because there needs to be a config file alongside the unittests.dll once it's built and ready to run.
I've written a simple Command Line step with:
copy %system.teamcity.build.checkoutDir%\xx.configfile <destination>
The destination is the problem, I need it to be the Out directory teamcity creates.
TC creates SYSTEM_<machinename> <datetime>\OUT. An example:
C:\TeamCity\buildAgent\temp\buildTmp\SYSTEM_GIDEON 2015-07-02 16_51_09\Out
In there is my unittests.dll and I want to copy my config file there. What environment var or (anything else) can I use in the command line script?
The (1) Build Tests is a Step then I want to run the (2) Copy Config Step Then (3) Run Tests. After step (1) I have that xxx\xxx\Out directory and I need that directory from some variable.
I'm using Teamcity 9.0.2
Your problem is not to do with TeamCity I don't think, it's to do with the way that MSTest works. You need your .config file to be a DeploymentItem and have your tests deploy it to the directory that MSTest will run the tests in.
To be honest I'm surprised that you don't have this problem running locally, and it makes me think that you must be using some other test runner (like ReSharper) to run the tests if you have not seen this problem on your local machines.
I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests, I guess it starts with:
MSTest.exe /testmetadata:%SolutionName%.vsmdi /testlist:
But I couldn't figure out how to fill the testlist parameter, because both the test list name and id get the following error:
The test list path 8c43105b-9dc1-4917-a39f-aa66a61bf5b6 cannot be found.
An error occurred while executing the /testlist switch.
I'm trying to figure out which is the command line arguments used by
Visual Studio when you run the MsTest tests
It depends on how do you run your tests from Visual Studio. See the following examples:
You are selecting some tests from the Test View window and run them
MSTest.exe /testcontainer:TestProject.dll /test:TestMethod1 /test:TestMethod2 ...
Your are running all the tests from the Test View window
MSTest.exe /testcontainer:TestProject.dll
You have filtered your tests by a category through Test View window and run this category
MSTest.exe /testcontainer:TestProject.dll /category:CategoryName
You have opened the *.vsmdi file and selected some TestLists to run
MSTest.exe /testmetadata:*.vsmdi /testlist:TestList1 /testlist:TestList2 ...
You are running Load or Ordered tests
MSTest.exe /testcontainer:LoadTest1.loadtest /testcontainer:OrderedTest1.orderedtest
You can combine the above examples (arguments) to create the MSTest command that suits on your case. The only restriction you have is that you cannot use the /testmetada and /testcontainer arguments together.
As for the TestList argument you just need to give as parameter the name of the list. If it is not found then your test list does not exist or it does not belong to the *.vsmdi you have defined on the /testmetadata argument.
I am sure that you have already done it, but you can check the following link:
MSTest.exe Command-Line Options
See following link. Even though this post is about msbuild. It uses exec task for calling mstest.
If you use /testlist you need to give metadata file.
You can use /testcontainer and give dll for your test project. It will run all of your tests.
/testcontainer:[file name] Load a file that contains tests. You can
Specify this option more than once to
load multiple test files.
Examples:
/testcontainer:mytestproject.dll
/testcontainer:loadtest1.loadtest