-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrubbing out XML character in the generated test names #4
Comments
I am not sure about this. By default this code has no idea whether it is running somewhere that will parse its output and put it inside XML files unescaped. So I believe it is the fault of the software that generates XML not to escape this. Which test runner are you using? OTOH most runners probably expect this to be a method name and thus XML-safe, so they don't care. Not sure I will feel this compelling enough to do the work myself, but if you send this as a PR with a proper unit test I will merge it and release it. |
I'm using nose as my test runner. I'm not too familiar with the internals of the unittest runner to write a proper unit test for this. What's happening is the data is being used to generate the names used in the xml test results, the data is used as part of the test name, since the names in the unittest results are of the from of "name_of_the_method_THETESTDATA" so alot of my unit test results were looking like,
The XML characters in the 'name' property causes the JUnit Parser plugins on Jenkins and Bamboo to fail. |
Thanks for further illustrating the issue. Makes sense to me. Will take your PR if you send one, or else may give it some time later this week. |
This has now been addressed in #18. |
Currently if I passing in Objects using the decorator, because the "name" attribute can take on "<" and ">" characters if value passed in is an object (using default repr() ). This will cause the JUnit parser to break if you use JUnit parser in CI. Can you please add some sort of XML chracter stripping or escaping in the @DDT annotation class.
The text was updated successfully, but these errors were encountered: