rubyjobbuilderdsl 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/Gemfile +6 -6
- data/Gemfile.lock +41 -41
- data/LICENSE +18 -18
- data/Rakefile +12 -12
- data/docs/common.md +313 -313
- data/docs/flow.md +17 -17
- data/docs/freestyle.md +100 -100
- data/docs/gerrit.md +70 -70
- data/docs/git.md +88 -88
- data/docs/multi.md +26 -26
- data/docs/overview.md +74 -74
- data/docs/postbuild.md +266 -266
- data/docs/view.md +13 -13
- data/lib/rubyjobbuilderdsl.rb +2 -2
- data/lib/rubyjobbuilderdsl/buildstep/ant.rb +29 -29
- data/lib/rubyjobbuilderdsl/buildstep/copyartifact.rb +23 -23
- data/lib/rubyjobbuilderdsl/buildstep/inject_env.rb +18 -18
- data/lib/rubyjobbuilderdsl/buildstep/phase.rb +19 -19
- data/lib/rubyjobbuilderdsl/buildstep/phase_job.rb +26 -26
- data/lib/rubyjobbuilderdsl/buildstep/shell.rb +24 -24
- data/lib/rubyjobbuilderdsl/buildstep/xvfb.rb +46 -46
- data/lib/rubyjobbuilderdsl/common.rb +140 -140
- data/lib/rubyjobbuilderdsl/common/artifactory.rb +33 -33
- data/lib/rubyjobbuilderdsl/common/blocking_job.rb +11 -11
- data/lib/rubyjobbuilderdsl/common/build_timeout.rb +23 -23
- data/lib/rubyjobbuilderdsl/common/gerrit.rb +53 -53
- data/lib/rubyjobbuilderdsl/common/git.rb +76 -76
- data/lib/rubyjobbuilderdsl/common/logrotate.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/parameter.rb +22 -22
- data/lib/rubyjobbuilderdsl/common/password.rb +12 -12
- data/lib/rubyjobbuilderdsl/common/pollscm.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/scms.rb +18 -18
- data/lib/rubyjobbuilderdsl/common/throttle.rb +24 -24
- data/lib/rubyjobbuilderdsl/common/timed.rb +10 -10
- data/lib/rubyjobbuilderdsl/common/timestamps.rb +6 -6
- data/lib/rubyjobbuilderdsl/deployer.rb +95 -95
- data/lib/rubyjobbuilderdsl/flow.rb +14 -14
- data/lib/rubyjobbuilderdsl/freestyle.rb +65 -65
- data/lib/rubyjobbuilderdsl/jenkins_client.rb +203 -203
- data/lib/rubyjobbuilderdsl/multijob.rb +24 -24
- data/lib/rubyjobbuilderdsl/postbuild.rb +160 -160
- data/lib/rubyjobbuilderdsl/postbuild/archive.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/chucknorris_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/claim_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/cloverphp_publisher.rb +36 -36
- data/lib/rubyjobbuilderdsl/postbuild/cucumber_json_publisher.rb +20 -20
- data/lib/rubyjobbuilderdsl/postbuild/email_publisher.rb +23 -23
- data/lib/rubyjobbuilderdsl/postbuild/game_publisher.rb +6 -6
- data/lib/rubyjobbuilderdsl/postbuild/groovy.rb +10 -10
- data/lib/rubyjobbuilderdsl/postbuild/html_publisher.rb +27 -27
- data/lib/rubyjobbuilderdsl/postbuild/javadoc_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/logparser.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/nunit_publisher.rb +21 -21
- data/lib/rubyjobbuilderdsl/postbuild/pmd_publisher.rb +19 -19
- data/lib/rubyjobbuilderdsl/postbuild/script.rb +14 -14
- data/lib/rubyjobbuilderdsl/postbuild/tap_publisher.rb +44 -44
- data/lib/rubyjobbuilderdsl/postbuild/trigger.rb +38 -38
- data/lib/rubyjobbuilderdsl/postbuild/xunit_publisher.rb +35 -35
- data/lib/rubyjobbuilderdsl/view.rb +14 -14
- data/lib/rubyjobbuilderdsl/xml_generator.rb +1 -1
- data/rubyjobbuilderdsl.gemspec +2 -2
- data/rubyjobbuilderdsl.sublime-project +14 -14
- data/run_tests.sh +7 -7
- data/sample/hello_mars.rb +27 -27
- data/sample/hello_mars.xml +18 -0
- data/sample/hello_world-post.xml +40 -0
- data/sample/local.ini +4 -4
- data/sample/test.xml +21 -0
- data/test/test_ant.rb +38 -38
- data/test/test_archive.rb +24 -24
- data/test/test_artifactory.rb +26 -26
- data/test/test_blocking_job.rb +18 -18
- data/test/test_chucknorris_publisher.rb +17 -17
- data/test/test_claim_publisher.rb +17 -17
- data/test/test_cloverphp.rb +33 -33
- data/test/test_concurrent.rb +44 -44
- data/test/test_copyartifact.rb +45 -45
- data/test/test_cucumber_json_publisher.rb +30 -30
- data/test/test_default_setting.rb +29 -29
- data/test/test_email_publisher.rb +44 -44
- data/test/test_flow.rb +19 -19
- data/test/test_freestyle.rb +52 -52
- data/test/test_game_publisher.rb +17 -17
- data/test/test_gerrit.rb +117 -117
- data/test/test_git.rb +80 -80
- data/test/test_html_publisher.rb +57 -57
- data/test/test_inject.rb +23 -23
- data/test/test_javadoc.rb +22 -22
- data/test/test_logparser.rb +24 -24
- data/test/test_logrotate.rb +22 -22
- data/test/test_multijob.rb +50 -50
- data/test/test_nunit_publisher.rb +20 -20
- data/test/test_parameter.rb +44 -44
- data/test/test_password.rb +17 -17
- data/test/test_pmd.rb +22 -22
- data/test/test_pollscm.rb +15 -15
- data/test/test_postbuild_groovy.rb +21 -21
- data/test/test_postbuild_script.rb +24 -24
- data/test/test_postbuild_trigger.rb +170 -170
- data/test/test_scms.rb +31 -31
- data/test/test_tap_publisher.rb +25 -25
- data/test/test_timed.rb +15 -15
- data/test/test_timeout.rb +20 -20
- data/test/test_timestamps.rb +14 -14
- data/test/test_xml_generator.rb +28 -28
- data/test/test_xunit_publisher.rb +22 -22
- data/test/test_xvfb.rb +35 -35
- metadata +11 -10
- data/rubyjobbuilderdsl-0.0.3.gem +0 -0
- data/sample/Schedule-sample-pipeline.xml +0 -32
data/test/test_multijob.rb
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlMultiJob < Test::Unit::TestCase
|
|
4
|
-
PHASE = './com.tikal.jenkins.plugins.multijob.MultiJobProject' \
|
|
5
|
-
'/builders/com.tikal.jenkins.plugins.multijob.MultiJobBuilder'
|
|
6
|
-
|
|
7
|
-
def test_multi_job
|
|
8
|
-
builder = JenkinsJob::Builder.new
|
|
9
|
-
|
|
10
|
-
builder.multi 'foo' do
|
|
11
|
-
phase 'db' do
|
|
12
|
-
job 'foo_a'
|
|
13
|
-
|
|
14
|
-
job 'foo_b' do
|
|
15
|
-
ignore_result true
|
|
16
|
-
abort_others true
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
phase 'service' do
|
|
21
|
-
job 'foo_c' do
|
|
22
|
-
retries 1
|
|
23
|
-
abort_others false
|
|
24
|
-
end
|
|
25
|
-
job 'foo_d'
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
actual = builder.config_as_xml_node('foo')
|
|
30
|
-
|
|
31
|
-
assert_equal %w(db service),
|
|
32
|
-
actual.xpath("#{PHASE}/phaseName").map(&:text)
|
|
33
|
-
|
|
34
|
-
jobs = actual.xpath("#{PHASE}/phaseJobs/com.tikal.jenkins.plugins.multijob.PhaseJobsConfig")
|
|
35
|
-
|
|
36
|
-
assert_equal %w(foo_a foo_b foo_c foo_d),
|
|
37
|
-
jobs.xpath('./jobName').map(&:text)
|
|
38
|
-
|
|
39
|
-
foo_b = jobs.find { |x| x.children.find { |y| y.text == 'foo_b' } }
|
|
40
|
-
assert_equal 'NEVER', foo_b.xpath('./killPhaseOnJobResultCondition').text
|
|
41
|
-
assert_equal 'true', foo_b.xpath('./abortAllJob').text
|
|
42
|
-
|
|
43
|
-
foo_c = jobs.find { |x| x.children.find { |y| y.text == 'foo_c' } }
|
|
44
|
-
assert_equal '1', foo_c.xpath('./maxRetries').text
|
|
45
|
-
assert_equal 'false', foo_c.xpath('./abortAllJob').text
|
|
46
|
-
|
|
47
|
-
assert_equal %w(FAILURE NEVER FAILURE FAILURE),
|
|
48
|
-
actual.xpath("#{PHASE}/phaseJobs/com.tikal.jenkins.plugins.multijob.PhaseJobsConfig/killPhaseOnJobResultCondition").map(&:text)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlMultiJob < Test::Unit::TestCase
|
|
4
|
+
PHASE = './com.tikal.jenkins.plugins.multijob.MultiJobProject' \
|
|
5
|
+
'/builders/com.tikal.jenkins.plugins.multijob.MultiJobBuilder'
|
|
6
|
+
|
|
7
|
+
def test_multi_job
|
|
8
|
+
builder = JenkinsJob::Builder.new
|
|
9
|
+
|
|
10
|
+
builder.multi 'foo' do
|
|
11
|
+
phase 'db' do
|
|
12
|
+
job 'foo_a'
|
|
13
|
+
|
|
14
|
+
job 'foo_b' do
|
|
15
|
+
ignore_result true
|
|
16
|
+
abort_others true
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
phase 'service' do
|
|
21
|
+
job 'foo_c' do
|
|
22
|
+
retries 1
|
|
23
|
+
abort_others false
|
|
24
|
+
end
|
|
25
|
+
job 'foo_d'
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
actual = builder.config_as_xml_node('foo')
|
|
30
|
+
|
|
31
|
+
assert_equal %w(db service),
|
|
32
|
+
actual.xpath("#{PHASE}/phaseName").map(&:text)
|
|
33
|
+
|
|
34
|
+
jobs = actual.xpath("#{PHASE}/phaseJobs/com.tikal.jenkins.plugins.multijob.PhaseJobsConfig")
|
|
35
|
+
|
|
36
|
+
assert_equal %w(foo_a foo_b foo_c foo_d),
|
|
37
|
+
jobs.xpath('./jobName').map(&:text)
|
|
38
|
+
|
|
39
|
+
foo_b = jobs.find { |x| x.children.find { |y| y.text == 'foo_b' } }
|
|
40
|
+
assert_equal 'NEVER', foo_b.xpath('./killPhaseOnJobResultCondition').text
|
|
41
|
+
assert_equal 'true', foo_b.xpath('./abortAllJob').text
|
|
42
|
+
|
|
43
|
+
foo_c = jobs.find { |x| x.children.find { |y| y.text == 'foo_c' } }
|
|
44
|
+
assert_equal '1', foo_c.xpath('./maxRetries').text
|
|
45
|
+
assert_equal 'false', foo_c.xpath('./abortAllJob').text
|
|
46
|
+
|
|
47
|
+
assert_equal %w(FAILURE NEVER FAILURE FAILURE),
|
|
48
|
+
actual.xpath("#{PHASE}/phaseJobs/com.tikal.jenkins.plugins.multijob.PhaseJobsConfig/killPhaseOnJobResultCondition").map(&:text)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlNUnitPublisher < Test::Unit::TestCase
|
|
4
|
-
def test_postbuild_nunit_publisher
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
postbuild do
|
|
9
|
-
publish_nunit_report 'a\\b'
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
actual = builder.config_as_xml_node('foo')
|
|
14
|
-
|
|
15
|
-
{ 'testResultsPattern' => 'a\\b' }.each do |k, v|
|
|
16
|
-
assert_equal v, actual.xpath(
|
|
17
|
-
"./project/publishers/hudson.plugins.nunit.NUnitPublisher/#{k}").text, k
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlNUnitPublisher < Test::Unit::TestCase
|
|
4
|
+
def test_postbuild_nunit_publisher
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
postbuild do
|
|
9
|
+
publish_nunit_report 'a\\b'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
actual = builder.config_as_xml_node('foo')
|
|
14
|
+
|
|
15
|
+
{ 'testResultsPattern' => 'a\\b' }.each do |k, v|
|
|
16
|
+
assert_equal v, actual.xpath(
|
|
17
|
+
"./project/publishers/hudson.plugins.nunit.NUnitPublisher/#{k}").text, k
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/test/test_parameter.rb
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlParameter < Test::Unit::TestCase
|
|
4
|
-
def test_parameter
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
parameter 'GERRIT_BRANCH' do
|
|
9
|
-
default 'master'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
parameter 'SKIP_TEST' do
|
|
13
|
-
default 'true'
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
actual = builder.config_as_xml_node('foo')
|
|
18
|
-
|
|
19
|
-
{ 1 => { 'name' => 'GERRIT_BRANCH', 'defaultValue' => 'master' },
|
|
20
|
-
2 => { 'name' => 'SKIP_TEST', 'defaultValue' => 'true' } }.each do |item, data|
|
|
21
|
-
data.each do |k, v|
|
|
22
|
-
assert_equal v, actual.xpath('./project/properties/hudson.model.ParametersDefinitionProperty/parameterDefinitions/' \
|
|
23
|
-
"hudson.model.StringParameterDefinition[#{item}]/#{k}").text, "item #{item}, #{k}"
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def test_password_parameter
|
|
29
|
-
builder = JenkinsJob::Builder.new
|
|
30
|
-
|
|
31
|
-
builder.freestyle 'foo' do
|
|
32
|
-
password_parameter 'PASS' do
|
|
33
|
-
default 'xyz='
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
actual = builder.config_as_xml_node('foo')
|
|
38
|
-
|
|
39
|
-
{ 'name' => 'PASS', 'defaultValue' => 'xyz=' }.each do |k, v|
|
|
40
|
-
assert_equal v, actual.xpath('./project/properties/hudson.model.ParametersDefinitionProperty/parameterDefinitions/' \
|
|
41
|
-
"hudson.model.PasswordParameterDefinition/#{k}").text
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlParameter < Test::Unit::TestCase
|
|
4
|
+
def test_parameter
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
parameter 'GERRIT_BRANCH' do
|
|
9
|
+
default 'master'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
parameter 'SKIP_TEST' do
|
|
13
|
+
default 'true'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
actual = builder.config_as_xml_node('foo')
|
|
18
|
+
|
|
19
|
+
{ 1 => { 'name' => 'GERRIT_BRANCH', 'defaultValue' => 'master' },
|
|
20
|
+
2 => { 'name' => 'SKIP_TEST', 'defaultValue' => 'true' } }.each do |item, data|
|
|
21
|
+
data.each do |k, v|
|
|
22
|
+
assert_equal v, actual.xpath('./project/properties/hudson.model.ParametersDefinitionProperty/parameterDefinitions/' \
|
|
23
|
+
"hudson.model.StringParameterDefinition[#{item}]/#{k}").text, "item #{item}, #{k}"
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def test_password_parameter
|
|
29
|
+
builder = JenkinsJob::Builder.new
|
|
30
|
+
|
|
31
|
+
builder.freestyle 'foo' do
|
|
32
|
+
password_parameter 'PASS' do
|
|
33
|
+
default 'xyz='
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
actual = builder.config_as_xml_node('foo')
|
|
38
|
+
|
|
39
|
+
{ 'name' => 'PASS', 'defaultValue' => 'xyz=' }.each do |k, v|
|
|
40
|
+
assert_equal v, actual.xpath('./project/properties/hudson.model.ParametersDefinitionProperty/parameterDefinitions/' \
|
|
41
|
+
"hudson.model.PasswordParameterDefinition/#{k}").text
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/test/test_password.rb
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlPassword < Test::Unit::TestCase
|
|
4
|
-
def test_password
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
password 'ADMIN_PASS', 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI='
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
actual = builder.config_as_xml_node('foo')
|
|
12
|
-
|
|
13
|
-
{ 'name' => 'ADMIN_PASS', 'value' => 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI=' }.each do |k, v|
|
|
14
|
-
assert v, actual.xpath("./project/buildWrappers/EnvInjectPasswordWrapper/passwordEntries/EnvInjectPasswordEntry/#{k}").text
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlPassword < Test::Unit::TestCase
|
|
4
|
+
def test_password
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
password 'ADMIN_PASS', 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI='
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
actual = builder.config_as_xml_node('foo')
|
|
12
|
+
|
|
13
|
+
{ 'name' => 'ADMIN_PASS', 'value' => 'PhxHFCjgSiXR2umXhALLq+RzqJBxODDJT4t9Tw5JXbI=' }.each do |k, v|
|
|
14
|
+
assert v, actual.xpath("./project/buildWrappers/EnvInjectPasswordWrapper/passwordEntries/EnvInjectPasswordEntry/#{k}").text
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/test/test_pmd.rb
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlAnt < Test::Unit::TestCase
|
|
4
|
-
def test_javadoc
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
postbuild do
|
|
9
|
-
publish_pmd do
|
|
10
|
-
pmd_results 'build/phppmd.txt'
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
actual = builder.config_as_xml_node('foo')
|
|
16
|
-
{ 'pattern' => 'build/phppmd.txt',
|
|
17
|
-
'thresholdLimit' => 'low',
|
|
18
|
-
'pluginName' => '[PMD]' }.each do |k, v|
|
|
19
|
-
assert_equal v, actual.xpath("./project/publishers/hudson.plugins.pmd.PmdPublisher/#{k}").text, k
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlAnt < Test::Unit::TestCase
|
|
4
|
+
def test_javadoc
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
postbuild do
|
|
9
|
+
publish_pmd do
|
|
10
|
+
pmd_results 'build/phppmd.txt'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
actual = builder.config_as_xml_node('foo')
|
|
16
|
+
{ 'pattern' => 'build/phppmd.txt',
|
|
17
|
+
'thresholdLimit' => 'low',
|
|
18
|
+
'pluginName' => '[PMD]' }.each do |k, v|
|
|
19
|
+
assert_equal v, actual.xpath("./project/publishers/hudson.plugins.pmd.PmdPublisher/#{k}").text, k
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/test/test_pollscm.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlPollSCM < Test::Unit::TestCase
|
|
4
|
-
def test_pollscm
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
pollscm '*/5 * * * *'
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
actual = builder.config_as_xml_node('foo')
|
|
12
|
-
|
|
13
|
-
assert_equal '*/5 * * * *', actual.xpath('./project/triggers/hudson.triggers.SCMTrigger/spec').text
|
|
14
|
-
end
|
|
15
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlPollSCM < Test::Unit::TestCase
|
|
4
|
+
def test_pollscm
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
pollscm '*/5 * * * *'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
actual = builder.config_as_xml_node('foo')
|
|
12
|
+
|
|
13
|
+
assert_equal '*/5 * * * *', actual.xpath('./project/triggers/hudson.triggers.SCMTrigger/spec').text
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlPostbuildGroovy < Test::Unit::TestCase
|
|
4
|
-
def test_postbuild_groovy
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
postbuild do
|
|
9
|
-
groovy 'manager.buildFailure()'
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
actual = builder.config_as_xml_node('foo')
|
|
14
|
-
|
|
15
|
-
assert_equal 'manager.buildFailure()', actual.xpath('./project/publishers/' \
|
|
16
|
-
'org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder/groovyScript').text
|
|
17
|
-
|
|
18
|
-
assert_equal '0', actual.xpath('./project/publishers/' \
|
|
19
|
-
'org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder/behavior').text
|
|
20
|
-
end
|
|
21
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlPostbuildGroovy < Test::Unit::TestCase
|
|
4
|
+
def test_postbuild_groovy
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
postbuild do
|
|
9
|
+
groovy 'manager.buildFailure()'
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
actual = builder.config_as_xml_node('foo')
|
|
14
|
+
|
|
15
|
+
assert_equal 'manager.buildFailure()', actual.xpath('./project/publishers/' \
|
|
16
|
+
'org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder/groovyScript').text
|
|
17
|
+
|
|
18
|
+
assert_equal '0', actual.xpath('./project/publishers/' \
|
|
19
|
+
'org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder/behavior').text
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlPostbuildScript < Test::Unit::TestCase
|
|
4
|
-
def test_postbuild_shell
|
|
5
|
-
builder = JenkinsJob::Builder.new
|
|
6
|
-
|
|
7
|
-
builder.freestyle 'foo' do
|
|
8
|
-
postbuild do
|
|
9
|
-
shell 'cd Reports && mv $(ls *.xml) merge.xml'
|
|
10
|
-
batch 'hostname'
|
|
11
|
-
powershell 'Write-Host "hello world"'
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
actual = builder.config_as_xml_node('foo')
|
|
16
|
-
{ 'hudson.tasks.Shell/command' => 'cd Reports && mv $(ls *.xml) merge.xml',
|
|
17
|
-
'hudson.tasks.BatchFile/command' => 'hostname',
|
|
18
|
-
'hudson.plugins.powershell.PowerShell/command' => 'Write-Host "hello world"',
|
|
19
|
-
}.each do |k, v|
|
|
20
|
-
assert_equal v, actual.xpath('./project/publishers/' \
|
|
21
|
-
"org.jenkinsci.plugins.postbuildscript.PostBuildScript/buildSteps/#{k}").text, k
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlPostbuildScript < Test::Unit::TestCase
|
|
4
|
+
def test_postbuild_shell
|
|
5
|
+
builder = JenkinsJob::Builder.new
|
|
6
|
+
|
|
7
|
+
builder.freestyle 'foo' do
|
|
8
|
+
postbuild do
|
|
9
|
+
shell 'cd Reports && mv $(ls *.xml) merge.xml'
|
|
10
|
+
batch 'hostname'
|
|
11
|
+
powershell 'Write-Host "hello world"'
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
actual = builder.config_as_xml_node('foo')
|
|
16
|
+
{ 'hudson.tasks.Shell/command' => 'cd Reports && mv $(ls *.xml) merge.xml',
|
|
17
|
+
'hudson.tasks.BatchFile/command' => 'hostname',
|
|
18
|
+
'hudson.plugins.powershell.PowerShell/command' => 'Write-Host "hello world"',
|
|
19
|
+
}.each do |k, v|
|
|
20
|
+
assert_equal v, actual.xpath('./project/publishers/' \
|
|
21
|
+
"org.jenkinsci.plugins.postbuildscript.PostBuildScript/buildSteps/#{k}").text, k
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
require_relative './test_xml_generator'
|
|
2
|
-
|
|
3
|
-
class TestXmlPostbuildTrigger < Test::Unit::TestCase
|
|
4
|
-
ROOT = './project/publishers/hudson.plugins.parameterizedtrigger.BuildTrigger/configs'
|
|
5
|
-
TRIGGER_CONFIG = 'hudson.plugins.parameterizedtrigger.BuildTriggerConfig'
|
|
6
|
-
|
|
7
|
-
def test_postbuild_trigger
|
|
8
|
-
builder = JenkinsJob::Builder.new
|
|
9
|
-
|
|
10
|
-
builder.freestyle 'foo' do
|
|
11
|
-
postbuild do
|
|
12
|
-
trigger 'bar' do
|
|
13
|
-
trigger_with_no_parameters true
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
actual = builder.config_as_xml_node('foo')
|
|
19
|
-
|
|
20
|
-
expected_trigger_configuration = {
|
|
21
|
-
'projects' => 'bar',
|
|
22
|
-
'condition' => 'SUCCESS',
|
|
23
|
-
'triggerWithNoParameters' => 'true'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
expected_trigger_configuration.each do |key, expected_value|
|
|
27
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
28
|
-
assert_equal expected_value, given_value, key
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def test_postbuild_trigger_multiple_projects
|
|
33
|
-
builder = JenkinsJob::Builder.new
|
|
34
|
-
|
|
35
|
-
builder.freestyle 'foo' do
|
|
36
|
-
postbuild do
|
|
37
|
-
trigger 'bar1', 'bar2' do
|
|
38
|
-
trigger_with_no_parameters true
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
actual = builder.config_as_xml_node('foo')
|
|
44
|
-
|
|
45
|
-
expected_trigger_configuration = {
|
|
46
|
-
'projects' => 'bar1,bar2',
|
|
47
|
-
'condition' => 'SUCCESS',
|
|
48
|
-
'triggerWithNoParameters' => 'true'
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
expected_trigger_configuration.each do |key, expected_value|
|
|
52
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
53
|
-
assert_equal expected_value, given_value, key
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def test_trigger_paramaterized_with_file
|
|
58
|
-
expected_file_build_tag = 'hudson.plugins.parameterizedtrigger.FileBuildParameters'
|
|
59
|
-
builder = JenkinsJob::Builder.new
|
|
60
|
-
|
|
61
|
-
builder.freestyle 'foo' do
|
|
62
|
-
postbuild do
|
|
63
|
-
trigger 'bar' do
|
|
64
|
-
file 'env.properties'
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
expected_file_parameters = {
|
|
70
|
-
'propertiesFile' => 'env.properties',
|
|
71
|
-
'failTriggerOnMissing' => 'false',
|
|
72
|
-
'useMatrixChild' => 'false',
|
|
73
|
-
'onlyExactRuns' => 'false'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
expected_trigger_configuration = {
|
|
77
|
-
'projects' => 'bar',
|
|
78
|
-
'condition' => 'SUCCESS',
|
|
79
|
-
'triggerWithNoParameters' => 'false'
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
actual = builder.config_as_xml_node('foo')
|
|
83
|
-
|
|
84
|
-
expected_trigger_configuration.each do |key, expected_value|
|
|
85
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
86
|
-
assert_equal expected_value, given_value, key
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
expected_file_parameters.each do |key, expected_value|
|
|
90
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/#{expected_file_build_tag}/#{key}").text
|
|
91
|
-
assert_equal expected_value, given_value, key
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def test_trigger_paramaterized_with_current_parameters
|
|
96
|
-
builder = JenkinsJob::Builder.new
|
|
97
|
-
|
|
98
|
-
builder.freestyle 'foo' do
|
|
99
|
-
postbuild do
|
|
100
|
-
trigger 'bar' do
|
|
101
|
-
current_parameters true
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
actual = builder.config_as_xml_node('foo')
|
|
107
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs").children.to_s.strip
|
|
108
|
-
expected_config = '<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>'
|
|
109
|
-
assert_equal expected_config, given_value, 'config'
|
|
110
|
-
|
|
111
|
-
expected_trigger_configuration = {
|
|
112
|
-
'projects' => 'bar',
|
|
113
|
-
'condition' => 'SUCCESS',
|
|
114
|
-
'triggerWithNoParameters' => 'false'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
expected_trigger_configuration.each do |key, expected_value|
|
|
118
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
119
|
-
assert_equal expected_value, given_value, key
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
def test_trigger_paramaterized_with_predefined_parameters
|
|
124
|
-
expected_predefined_build_tag = 'hudson.plugins.parameterizedtrigger.PredefinedBuildParameters'
|
|
125
|
-
builder = JenkinsJob::Builder.new
|
|
126
|
-
builder.freestyle 'foo' do
|
|
127
|
-
postbuild do
|
|
128
|
-
trigger 'bar' do
|
|
129
|
-
predefined_parameters 'BUILD_NUM' => '${BUILD_NUMBER}',
|
|
130
|
-
'PACKAGE_VERSION' => '${PACKAGE_VERSION}'
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
actual = builder.config_as_xml_node('foo')
|
|
136
|
-
|
|
137
|
-
expected_predefined_parameters = { 'properties' => "BUILD_NUM=${BUILD_NUMBER}\nPACKAGE_VERSION=${PACKAGE_VERSION}" }
|
|
138
|
-
expected_predefined_parameters.each do |key, expected_value|
|
|
139
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/#{expected_predefined_build_tag}/#{key}").text
|
|
140
|
-
assert_equal expected_value, given_value, key
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
expected_trigger_configuration = {
|
|
144
|
-
'projects' => 'bar',
|
|
145
|
-
'condition' => 'SUCCESS',
|
|
146
|
-
'triggerWithNoParameters' => 'false'
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
expected_trigger_configuration.each do |key, expected_value|
|
|
150
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
151
|
-
assert_equal expected_value, given_value, key
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
def test_trigger_paramaterized_with_pass_through_git_commit
|
|
156
|
-
builder = JenkinsJob::Builder.new
|
|
157
|
-
builder.freestyle 'foo' do
|
|
158
|
-
postbuild do
|
|
159
|
-
trigger 'bar' do
|
|
160
|
-
pass_through_git_commit
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
actual = builder.config_as_xml_node('foo')
|
|
166
|
-
|
|
167
|
-
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/hudson.plugins.git.GitRevisionBuildParameters/combineQueuedCommits").text
|
|
168
|
-
assert_equal 'true', given_value
|
|
169
|
-
end
|
|
170
|
-
end
|
|
1
|
+
require_relative './test_xml_generator'
|
|
2
|
+
|
|
3
|
+
class TestXmlPostbuildTrigger < Test::Unit::TestCase
|
|
4
|
+
ROOT = './project/publishers/hudson.plugins.parameterizedtrigger.BuildTrigger/configs'
|
|
5
|
+
TRIGGER_CONFIG = 'hudson.plugins.parameterizedtrigger.BuildTriggerConfig'
|
|
6
|
+
|
|
7
|
+
def test_postbuild_trigger
|
|
8
|
+
builder = JenkinsJob::Builder.new
|
|
9
|
+
|
|
10
|
+
builder.freestyle 'foo' do
|
|
11
|
+
postbuild do
|
|
12
|
+
trigger 'bar' do
|
|
13
|
+
trigger_with_no_parameters true
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
actual = builder.config_as_xml_node('foo')
|
|
19
|
+
|
|
20
|
+
expected_trigger_configuration = {
|
|
21
|
+
'projects' => 'bar',
|
|
22
|
+
'condition' => 'SUCCESS',
|
|
23
|
+
'triggerWithNoParameters' => 'true'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
expected_trigger_configuration.each do |key, expected_value|
|
|
27
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
28
|
+
assert_equal expected_value, given_value, key
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_postbuild_trigger_multiple_projects
|
|
33
|
+
builder = JenkinsJob::Builder.new
|
|
34
|
+
|
|
35
|
+
builder.freestyle 'foo' do
|
|
36
|
+
postbuild do
|
|
37
|
+
trigger 'bar1', 'bar2' do
|
|
38
|
+
trigger_with_no_parameters true
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
actual = builder.config_as_xml_node('foo')
|
|
44
|
+
|
|
45
|
+
expected_trigger_configuration = {
|
|
46
|
+
'projects' => 'bar1,bar2',
|
|
47
|
+
'condition' => 'SUCCESS',
|
|
48
|
+
'triggerWithNoParameters' => 'true'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
expected_trigger_configuration.each do |key, expected_value|
|
|
52
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
53
|
+
assert_equal expected_value, given_value, key
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def test_trigger_paramaterized_with_file
|
|
58
|
+
expected_file_build_tag = 'hudson.plugins.parameterizedtrigger.FileBuildParameters'
|
|
59
|
+
builder = JenkinsJob::Builder.new
|
|
60
|
+
|
|
61
|
+
builder.freestyle 'foo' do
|
|
62
|
+
postbuild do
|
|
63
|
+
trigger 'bar' do
|
|
64
|
+
file 'env.properties'
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
expected_file_parameters = {
|
|
70
|
+
'propertiesFile' => 'env.properties',
|
|
71
|
+
'failTriggerOnMissing' => 'false',
|
|
72
|
+
'useMatrixChild' => 'false',
|
|
73
|
+
'onlyExactRuns' => 'false'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
expected_trigger_configuration = {
|
|
77
|
+
'projects' => 'bar',
|
|
78
|
+
'condition' => 'SUCCESS',
|
|
79
|
+
'triggerWithNoParameters' => 'false'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
actual = builder.config_as_xml_node('foo')
|
|
83
|
+
|
|
84
|
+
expected_trigger_configuration.each do |key, expected_value|
|
|
85
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
86
|
+
assert_equal expected_value, given_value, key
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
expected_file_parameters.each do |key, expected_value|
|
|
90
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/#{expected_file_build_tag}/#{key}").text
|
|
91
|
+
assert_equal expected_value, given_value, key
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def test_trigger_paramaterized_with_current_parameters
|
|
96
|
+
builder = JenkinsJob::Builder.new
|
|
97
|
+
|
|
98
|
+
builder.freestyle 'foo' do
|
|
99
|
+
postbuild do
|
|
100
|
+
trigger 'bar' do
|
|
101
|
+
current_parameters true
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
actual = builder.config_as_xml_node('foo')
|
|
107
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs").children.to_s.strip
|
|
108
|
+
expected_config = '<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>'
|
|
109
|
+
assert_equal expected_config, given_value, 'config'
|
|
110
|
+
|
|
111
|
+
expected_trigger_configuration = {
|
|
112
|
+
'projects' => 'bar',
|
|
113
|
+
'condition' => 'SUCCESS',
|
|
114
|
+
'triggerWithNoParameters' => 'false'
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
expected_trigger_configuration.each do |key, expected_value|
|
|
118
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
119
|
+
assert_equal expected_value, given_value, key
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def test_trigger_paramaterized_with_predefined_parameters
|
|
124
|
+
expected_predefined_build_tag = 'hudson.plugins.parameterizedtrigger.PredefinedBuildParameters'
|
|
125
|
+
builder = JenkinsJob::Builder.new
|
|
126
|
+
builder.freestyle 'foo' do
|
|
127
|
+
postbuild do
|
|
128
|
+
trigger 'bar' do
|
|
129
|
+
predefined_parameters 'BUILD_NUM' => '${BUILD_NUMBER}',
|
|
130
|
+
'PACKAGE_VERSION' => '${PACKAGE_VERSION}'
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
actual = builder.config_as_xml_node('foo')
|
|
136
|
+
|
|
137
|
+
expected_predefined_parameters = { 'properties' => "BUILD_NUM=${BUILD_NUMBER}\nPACKAGE_VERSION=${PACKAGE_VERSION}" }
|
|
138
|
+
expected_predefined_parameters.each do |key, expected_value|
|
|
139
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/#{expected_predefined_build_tag}/#{key}").text
|
|
140
|
+
assert_equal expected_value, given_value, key
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
expected_trigger_configuration = {
|
|
144
|
+
'projects' => 'bar',
|
|
145
|
+
'condition' => 'SUCCESS',
|
|
146
|
+
'triggerWithNoParameters' => 'false'
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
expected_trigger_configuration.each do |key, expected_value|
|
|
150
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/#{key}").text
|
|
151
|
+
assert_equal expected_value, given_value, key
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def test_trigger_paramaterized_with_pass_through_git_commit
|
|
156
|
+
builder = JenkinsJob::Builder.new
|
|
157
|
+
builder.freestyle 'foo' do
|
|
158
|
+
postbuild do
|
|
159
|
+
trigger 'bar' do
|
|
160
|
+
pass_through_git_commit
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
actual = builder.config_as_xml_node('foo')
|
|
166
|
+
|
|
167
|
+
given_value = actual.xpath("#{ROOT}/#{TRIGGER_CONFIG}/configs/hudson.plugins.git.GitRevisionBuildParameters/combineQueuedCommits").text
|
|
168
|
+
assert_equal 'true', given_value
|
|
169
|
+
end
|
|
170
|
+
end
|