I have some tests I would like to run with nosetests and generate junit xml results. As far as I know, this is not possible by the default installation of nosetests, as it only produced xunit xml files.
However, nose plugins exist which can do various things, among them a code snippet to be use to create junit xml output.
My questions:
What are the differences between junit and xunit xml results? Are they basically different and incompatible?
How to install or use the junitxml plugin code in the link I mentioned above? Maybe there is a different way to create junit output?
Nose supports xunit natively, now.
nose supports xunit output with built-in plugin, just try --with-xunit
~ From Oleksiy, https://stackoverflow.com/a/20750012/311901
This is a nose plugin; You can install it by
pip install NoseXUnit
Read the documentation for it here: http://nosexunit.sourceforge.net/. This will help you run the plugin
Related
I'm using NUnitLite runner in console application (according to this example) to run my test on linux/mac.
I need to transform the results into JUnit format. I haven't found any flag/option how I can do the transformation only by using NUnitLite runner.
Another way would be to transform the results after the test run. I found xslt transformation here, but I'm not sure, how to use it on linux/mac (I don't want to use mono in this case).
Did I miss something in NUniteLite runner or is there a simple way to run xslt transformation on linux/mac I could use?
Thanks a lot
OK, it's not universal, but worked for me on linux(Ubuntu)/mac:
xsltproc -o PATH_TO/JUNIT_FILE.xml PATH_TO/nunit3-junit.xslt PATH_TO/TestResult.xml
Where "nunit3-junit.xslt" comes from nunit /
nunit-transforms
and for more info about xsltproc see here.
I'm using sonar for quite a long time and for me it is really great tool. Nowadays with plsql based project I have decided to use utplsql maven plugin to watch plsql tests results. Utplsql plugin outputs reports in junit like xml format. Unfortunately sonar is not presenting data from utplsql reports. This is plsql so there is no coverage or real java test classes - just an xml report. How to feed sonar just to view tests results, only main statistics like failed, success, all.
You might want to have a look at the Generic Test Coverage plugin. It will not be able to import directly xUnit type reports, but a bit of XSLT should allow you to convert to the correct format.
I've been using cucumber for awhile and I've stumbled upon a problem:
Actual question:
Is there a solution to import the examples from a single file/db using cucumber specifically as examples?
Or alternatively is there a way to define a variable while already in-step to be an example?
Or alternatively again, is there an option to send the examples as variables when I launch the feature file/scenario?
The Problem:
I have a couple of scenarios where I would like to use exactly the same examples, over and over again.
It sounds rather easy, but the examples table is very large (more specifically it contains all the countries in the world and their appropriate continents). Thus repeating it would be very troublesome, especially if the table needs changing (I will need to change all the instances of the table separately)
Complication:
I have a rerun function that knows when a specific example failed and reruns it after the test is done.
Restrictions:
I do not want to edit my rerun file
Related:
I've noticed that there is already an open discussion about importing it from csv here:
Importing CSV as test data in Cucumber?
However that discussion is invalid to me because I have the rerun function that only knows to work only with examples, and the solution suggested there ruins that.
Thank you!
You can use CSV and other external file systems with QAF using different BDD syntax.
If you want to use cucumber steps or cucumber runner, you can use QAF-cucumber and BDD2 (preferred) or Gherkin syntax. QAF-cucumber will enable external test data and other qaf features with cucumber.
Below is the example feature file uses BDD2 syntax can be run using TestNG or Cucumber runner.
Feature: feature uses external data file
#datafie:resources/${env}/testdata.csv
#regression
Scenario: Another scenario exploring different combination using data-provider
Given a "${precondition}"
When an event occurs
Then the outcome should "${be-captured}"
testdata.csv file may look like:
TestcaseId,precondition,be-captured
123461,abc,be captured
123462,xyz,not be captured
You can run using TestNG or Cucumber runner. You can use any of inbuilt data provider or custom as well.
I need an example (in some console tool) to convert generated gtest XML report to HTML.
A solution mast be without using ant or Maven.
you should use xslt to transform xml into html.
you could use the xsltproc tool from the command line under linux. I guess there are equivalent tools for other OSes.
I did it for myself with programming language, which is Python 2.*: https://github.com/burlachenkok/gtest_report
Also this gtest_report supports comparision of 2 or more google test results.
If to be honest it was the prime goal.
I would like to write a junit test for my Checkstyle extension. Can someone show me how to do it? I know there is a project in github called JUnit-Checkstyle-Test-Wrapper. However, I don't see how using this tool would help me get to my extension and verify its values.
thanks.
Probably the best reference for how to test your checkstyle extension (I assume you've added a checker) is to look at the checkstyle source code, and just copy & change one of the existing tests. For example, here is the test for HeaderCheck. This is probably the best way to start. Remember you can actually extend the Checkstyle test classes.
take a look at a lot of examples for custom Checkstyle checks and UTs for them https://github.com/sevntu-checkstyle/sevntu.checkstyle/tree/master/sevntu-checks