Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit 8027b94

Browse files
committed
Split cart and node tests. Increased timeout for puppet script.
1 parent e5daf90 commit 8027b94

File tree

7 files changed

+156
-188
lines changed

7 files changed

+156
-188
lines changed

.idea/vagrant-openshift.iml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 103 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vagrant-openshift/command/test.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def execute
2525
options = {}
2626
options[:help] = false
2727
options[:node] = false
28+
options[:cart] = false
2829
options[:broker] = false
2930
options[:rhc] = false
3031
options[:console] = false
@@ -39,6 +40,10 @@ def execute
3940
options[:node] = true
4041
end
4142

43+
o.on("-c", "--cart", String, "Run cartridge tests") do |f|
44+
options[:cart] = true
45+
end
46+
4247
o.on("-b", "--broker", String, "Run broker tests") do |f|
4348
options[:broker] = true
4449
end
@@ -80,8 +85,8 @@ def execute
8085
exit
8186
end
8287

83-
if !(options[:broker] || options[:node] || options[:rhc] || options[:console])
84-
options[:node] = options[:broker] = options[:console] = options[:rhc] = true
88+
if !(options[:broker] || options[:node] || options[:cart] || options[:rhc] || options[:console])
89+
options[:node] = options[:cart] = options[:broker] = options[:console] = options[:rhc] = true
8590
end
8691

8792
with_target_vms(argv, :reverse => true) do |machine|

lib/vagrant-openshift/provisioner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def provision
4545
@machine.ui.info("Reapplying puppet script to update changed IP values")
4646
hostname = @machine.config.vm.hostname
4747
sudo(machine,"echo #{hostname} > /proc/sys/kernel/hostname")
48-
sudo(machine,"puppet apply --verbose #{Vagrant::Openshift::Constants.build_dir + 'configure_origin.pp'}")
48+
sudo(machine,"puppet apply --verbose #{Vagrant::Openshift::Constants.build_dir + 'configure_origin.pp'}", {timeout: 60*20})
4949
is_fedora = @machine.communicate.test("test -e /etc/fedora-release")
5050

5151
sudo(machine,Constants.restart_services_cmd(is_fedora).join("\n"))

lib/vagrant-openshift/templates/builder/Rakefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,21 @@ task :run_tests do
177177
options[:fixme] = ENV["fixme"] == "true"
178178
if ENV["extended"] == "true"
179179
options[:node_extended] = ENV["node"] == "true"
180+
options[:cart_extended] = ENV["cart"] == "true"
180181
options[:broker_extended] = ENV["broker"] == "true"
181182
options[:rhc_extended] = ENV["rhc"] == "true"
182183
options[:console_extended] = ENV["console"] == "true"
183-
options[:exclude_node] = true
184-
options[:exclude_broker] = true
185-
options[:exclude_rhc] = true
186-
options[:exclude_console] = true
184+
options[:node] = false
185+
options[:cart] = false
186+
options[:broker] = false
187+
options[:rhc] = false
188+
options[:console] = false
187189
else
188-
options[:exclude_node] = ENV["node"] != "true"
189-
options[:exclude_broker] = ENV["broker"] != "true"
190-
options[:exclude_rhc] = ENV["rhc"] != "true"
191-
options[:exclude_console] = ENV["console"] != "true"
190+
options[:node] = ENV["node"] == "true"
191+
options[:cart] = ENV["cart"] == "true"
192+
options[:broker] = ENV["broker"] == "true"
193+
options[:rhc] = ENV["rhc"] == "true"
194+
options[:console] = ENV["console"] == "true"
192195
end
193196

194197
Test.new.test(options)

lib/vagrant-openshift/templates/builder/lib/test.rb

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ def test(options)
3838

3939
if options[:node_extended]
4040
(1..3).each do |i|
41-
test_queues[i-1] << build_cucumber_command("Extended Runtime Group #{i}", ["@runtime_extended#{i}"])
41+
test_queues[i-1] << build_cucumber_command("Extended Node Group #{i}", ["@node_extended#{i}"])
4242
end
43-
test_queues[3] << build_rake_command("OpenShift Runtime Functionals Ext", "cd /data/openshift-test/node; rake ext_func_test")
43+
test_queues[3] << build_rake_command("OpenShift Runtime Node Functionals Ext", "cd /data/openshift-test/node; rake ext_node_func_test")
44+
end
45+
46+
if options[:cart_extended]
47+
(1..3).each do |i|
48+
test_queues[i-1] << build_cucumber_command("Extended Cart Group #{i}", ["@cart_extended#{i}"])
49+
end
50+
test_queues[2] << build_rake_command("OpenShift Runtime Cartridge Functionals Ext", "cd /data/openshift-test/node; rake ext_cart_func_test")
4451
end
4552

4653
if options[:rhc_extended]
@@ -49,29 +56,35 @@ def test(options)
4956
nil,"/data/openshift-test/rhc/cucumber")
5057
end
5158

52-
unless options[:exclude_broker]
59+
if options[:broker]
5360
test_queues[0] << build_rake_command("OpenShift Broker Sanity", "cd /data/openshift-test/broker; rake test:sanity", {}, false) if options[:fixme]
5461
test_queues[3] << build_rake_command("OpenShift Broker Units", "cd /data/openshift-test/broker; rake test:units", {}, false)
55-
test_queues[0] << build_rake_command("OpenShift Broker Integration", "cd /data/openshift-test/broker; rake test:integration", {}, false)
5662
test_queues[2] << build_rake_command("OpenShift Broker Functional", "cd /data/openshift-test/broker; rake test:functionals", {}, false)
57-
test_queues[1] << build_rake_command("OpenShift Admin Console Functional", "cd /data/openshift-test/broker; rake test:admin_console_functionals", {}, false) if options[:fixme]
63+
test_queues[0] << build_rake_command("OpenShift Broker Integration", "cd /data/openshift-test/broker; rake test:integration", {}, false)
64+
test_queues[1] << build_rake_command("OpenShift Admin Console Functional", "cd /data/openshift-test/broker; rake test:admin_console_functionals", {}, false)
5865
test_queues[3] << build_cucumber_command("Broker cucumber", ["@broker"])
5966
end
6067

61-
unless options[:exclude_node]
68+
if options[:node]
6269
test_queues[0] << build_rake_command("Runtime Functional", "cd /data/openshift-test/node; rake essentials_test", {}, false)
6370
test_queues[1] << build_rake_command("Runtime Frontend Plugin ApacheDB", "cd /data/openshift-test/plugins/frontend/apachedb; rake test", {}, false)
6471
test_queues[2] << build_rake_command("Runtime Frontend Plugin Apache Mod Rewrite", "cd /data/openshift-test/plugins/frontend/apache-mod-rewrite; rake test", {}, false)
6572
test_queues[3] << build_rake_command("Runtime Frontend Plugin Apache Vhost", "cd /data/openshift-test/plugins/frontend/apache-vhost; rake test", {}, false)
6673
test_queues[0] << build_rake_command("Runtime Frontend Plugin NodeJS Websocket", "cd /data/openshift-test/plugins/frontend/nodejs-websocket; rake test", {}, false)
6774
test_queues[1] << build_rake_command("Runtime Frontend Plugin Haproxy SNI Proxy", "cd /data/openshift-test/plugins/frontend/haproxy-sni-proxy; rake test", {}, false)
6875
test_queues[2] << build_rake_command("Runtime Unit", "cd /data/openshift-test/node; rake unit_test", {}, false)
69-
(1..4).each do |i|
70-
test_queues[i-1] << build_cucumber_command("Runtime Group #{i.to_s}", ["@runtime#{i.to_s}"])
76+
(1..3).each do |i|
77+
test_queues[i] << build_cucumber_command("Node Group #{i.to_s}", ["@node#{i.to_s}"])
7178
end
7279
end
7380

74-
unless options[:exclude_rhc]
81+
if options[:cart]
82+
(1..3).each do |i|
83+
test_queues[i] << build_cucumber_command("Cartridge Group #{i.to_s}", ["@cartridge#{i.to_s}"])
84+
end
85+
end
86+
87+
if options[:rhc]
7588
if @is_fedora
7689
test_queues[0] << build_rake_command("RHC Spec", 'cd /data/openshift-test/rhc; bundle install --local && bundle exec rake spec', {"SKIP_RUNCON" => 1}, false)
7790
test_queues[0] << build_rake_command("RHC Features", %{
@@ -99,10 +112,14 @@ def test(options)
99112

100113
#These are special tests that cannot be written to work concurrently
101114
singleton_queue = []
115+
idle_all_gears
102116

103-
unless options[:exclude_node]
104-
idle_all_gears
105-
singleton_queue << build_cucumber_command("Runtime singletons", ["@singleton"])
117+
if options[:node]
118+
singleton_queue << build_cucumber_command("Runtime singletons", ["@node_singleton"])
119+
end
120+
121+
if options[:cart]
122+
singleton_queue << build_cucumber_command("Runtime singletons", ["@cart_singleton"])
106123
end
107124

108125
run_tests_with_retry([singleton_queue])

lib/vagrant-openshift/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616

1717
module Vagrant
1818
module Openshift
19-
VERSION = "0.0.7"
19+
VERSION = "0.0.8"
2020
end
2121
end

0 commit comments

Comments
 (0)