Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
Fixing JUnit plugin (#126)
Browse files Browse the repository at this point in the history
* Fixing JUnit plugin

* Code review followup: Parameterize JUnit plugin allowEmptyResults. Add unit test for JUnit plugin
  • Loading branch information
csciuto authored and JustMcAfee committed Dec 8, 2017
1 parent 5a418b2 commit e502c08
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/jenkins_pipeline_builder/extensions/publishers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@
send('hudson.tasks.junit.JUnitResultArchiver') do
testResults params[:test_results] || ''
keepLongStdio false
testDataPublishers
healthScaleFactor 1.0
allowEmptyResults params[:allow_empty_results] || false
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/jenkins_pipeline_builder/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
#

module JenkinsPipelineBuilder
VERSION = '1.5.1'.freeze
VERSION = '1.5.2'.freeze
end
15 changes: 14 additions & 1 deletion spec/lib/jenkins_pipeline_builder/extensions/publishers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,20 @@
end

context 'junit_result' do
it 'generates a configuration'
it 'generates a configuration' do
params = { publishers: { junit_result: {} } }

JenkinsPipelineBuilder.registry.traverse_registry_path('job', params, @n_xml)

publisher = @n_xml.root.children.first
expect(publisher.name).to match 'hudson.tasks.junit.JUnitResultArchiver'
children = publisher.children.map(&:name)

expect(children).to include 'testResults'
expect(children).to include 'keepLongStdio'
expect(children).to include 'healthScaleFactor'
expect(children).to include 'allowEmptyResults'
end
end

context 'coverage_result' do
Expand Down

0 comments on commit e502c08

Please sign in to comment.