![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
jenkins_junit_builder
Advanced tools
When you have your own home brewed testing framework but still want to use Jenkins CI with it's standard JUnit plugin, you may find yourself searching for a valid and recent documentation on how to create such XML documents. It's hard. Harder for newbies who want to learn how to set up/use Jenkins and make it useful to their projects.
The XSD schema that serves as a base of the XMLs generated can be found here.
I have put together a blog entry on describing how the XML is interpreted and presented by Jenkins.
Add this line to your application's Gemfile:
gem 'jenkins_junit_builder'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jenkins_junit_builder
Since it uses Nokogiri to build report XMLs, please refer to Nokogiri's documentation for more installation instructions if you run into build errors.
Please note that understanding how to read an XSD schema (which is not that hard) will really help navigating and understanding what properties are available and how to structure them. Again, Jenkins looks like to work by this XSD schema.
Since we are building our own testing system, I did something that is not soooo magical as a DSL with raibows and Unikitties.
Require the lib:
require 'jenkins_junit_builder'
Let's report a pass:
t_passed = JenkinsJunitBuilder::Case.new
t_passed.name = 'My first test case'
t_passed.time = 65
t_passed.classname = 'FirstTestSuite'
t_passed.result = JenkinsJunitBuilder::Case::RESULT_PASSED
Then a failure:
t_failed = JenkinsJunitBuilder::Case.new
t_failed.name = 'My failing functionality'
t_failed.classname = 'FirstTestSuite'
t_failed.result = JenkinsJunitBuilder::Case::RESULT_FAILURE
t_failed.message = 'timeout reached'
t_failed.system_out.message = 'some thing went wrong'
t_failed.system_err.message = 'give me a stacktrace or something'
Add those to the suite:
t_suite = JenkinsJunitBuilder::Suite.new
t_suite.name = 'Testing some cases'
t_suite.package = 'Mytest'
t_suite.add_case t_passed
t_suite.add_case t_failed
And bake them:
xml_report = t_suite.build_report
Into this:
<testsuites>
<testsuite name="Testing some cases" package="Mytest">
<testcase name="My first test case" time="65" classname="Mytest.FirstTestSuite"/>
<testcase name="My failing functionality" classname="Mytest.FirstTestSuite">
<failure message="timeout reached"/>
<system-out>some thing went wrong</system-out>
<system-err>give me a stacktrace or something</system-err>
</testcase>
</testsuite>
</testsuites>
Please refer to the tests and code for more guidance for the time being.
##Changelog 0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Written with StackEdit.
FAQs
Unknown package
We found that jenkins_junit_builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.