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

Commit

Permalink
Split cart and node tests. Increased timeout for puppet script.
Browse files Browse the repository at this point in the history
  • Loading branch information
kraman committed Nov 12, 2013
1 parent e5daf90 commit 8027b94
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 188 deletions.
6 changes: 4 additions & 2 deletions .idea/vagrant-openshift.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

265 changes: 103 additions & 162 deletions .idea/workspace.xml

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions lib/vagrant-openshift/command/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def execute
options = {}
options[:help] = false
options[:node] = false
options[:cart] = false
options[:broker] = false
options[:rhc] = false
options[:console] = false
Expand All @@ -39,6 +40,10 @@ def execute
options[:node] = true
end

o.on("-c", "--cart", String, "Run cartridge tests") do |f|
options[:cart] = true
end

o.on("-b", "--broker", String, "Run broker tests") do |f|
options[:broker] = true
end
Expand Down Expand Up @@ -80,8 +85,8 @@ def execute
exit
end

if !(options[:broker] || options[:node] || options[:rhc] || options[:console])
options[:node] = options[:broker] = options[:console] = options[:rhc] = true
if !(options[:broker] || options[:node] || options[:cart] || options[:rhc] || options[:console])
options[:node] = options[:cart] = options[:broker] = options[:console] = options[:rhc] = true
end

with_target_vms(argv, :reverse => true) do |machine|
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-openshift/provisioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def provision
@machine.ui.info("Reapplying puppet script to update changed IP values")
hostname = @machine.config.vm.hostname
sudo(machine,"echo #{hostname} > /proc/sys/kernel/hostname")
sudo(machine,"puppet apply --verbose #{Vagrant::Openshift::Constants.build_dir + 'configure_origin.pp'}")
sudo(machine,"puppet apply --verbose #{Vagrant::Openshift::Constants.build_dir + 'configure_origin.pp'}", {timeout: 60*20})
is_fedora = @machine.communicate.test("test -e /etc/fedora-release")

sudo(machine,Constants.restart_services_cmd(is_fedora).join("\n"))
Expand Down
19 changes: 11 additions & 8 deletions lib/vagrant-openshift/templates/builder/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,21 @@ task :run_tests do
options[:fixme] = ENV["fixme"] == "true"
if ENV["extended"] == "true"
options[:node_extended] = ENV["node"] == "true"
options[:cart_extended] = ENV["cart"] == "true"
options[:broker_extended] = ENV["broker"] == "true"
options[:rhc_extended] = ENV["rhc"] == "true"
options[:console_extended] = ENV["console"] == "true"
options[:exclude_node] = true
options[:exclude_broker] = true
options[:exclude_rhc] = true
options[:exclude_console] = true
options[:node] = false
options[:cart] = false
options[:broker] = false
options[:rhc] = false
options[:console] = false
else
options[:exclude_node] = ENV["node"] != "true"
options[:exclude_broker] = ENV["broker"] != "true"
options[:exclude_rhc] = ENV["rhc"] != "true"
options[:exclude_console] = ENV["console"] != "true"
options[:node] = ENV["node"] == "true"
options[:cart] = ENV["cart"] == "true"
options[:broker] = ENV["broker"] == "true"
options[:rhc] = ENV["rhc"] == "true"
options[:console] = ENV["console"] == "true"
end

Test.new.test(options)
Expand Down
41 changes: 29 additions & 12 deletions lib/vagrant-openshift/templates/builder/lib/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ def test(options)

if options[:node_extended]
(1..3).each do |i|
test_queues[i-1] << build_cucumber_command("Extended Runtime Group #{i}", ["@runtime_extended#{i}"])
test_queues[i-1] << build_cucumber_command("Extended Node Group #{i}", ["@node_extended#{i}"])
end
test_queues[3] << build_rake_command("OpenShift Runtime Functionals Ext", "cd /data/openshift-test/node; rake ext_func_test")
test_queues[3] << build_rake_command("OpenShift Runtime Node Functionals Ext", "cd /data/openshift-test/node; rake ext_node_func_test")
end

if options[:cart_extended]
(1..3).each do |i|
test_queues[i-1] << build_cucumber_command("Extended Cart Group #{i}", ["@cart_extended#{i}"])
end
test_queues[2] << build_rake_command("OpenShift Runtime Cartridge Functionals Ext", "cd /data/openshift-test/node; rake ext_cart_func_test")
end

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

unless options[:exclude_broker]
if options[:broker]
test_queues[0] << build_rake_command("OpenShift Broker Sanity", "cd /data/openshift-test/broker; rake test:sanity", {}, false) if options[:fixme]
test_queues[3] << build_rake_command("OpenShift Broker Units", "cd /data/openshift-test/broker; rake test:units", {}, false)
test_queues[0] << build_rake_command("OpenShift Broker Integration", "cd /data/openshift-test/broker; rake test:integration", {}, false)
test_queues[2] << build_rake_command("OpenShift Broker Functional", "cd /data/openshift-test/broker; rake test:functionals", {}, false)
test_queues[1] << build_rake_command("OpenShift Admin Console Functional", "cd /data/openshift-test/broker; rake test:admin_console_functionals", {}, false) if options[:fixme]
test_queues[0] << build_rake_command("OpenShift Broker Integration", "cd /data/openshift-test/broker; rake test:integration", {}, false)
test_queues[1] << build_rake_command("OpenShift Admin Console Functional", "cd /data/openshift-test/broker; rake test:admin_console_functionals", {}, false)
test_queues[3] << build_cucumber_command("Broker cucumber", ["@broker"])
end

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

unless options[:exclude_rhc]
if options[:cart]
(1..3).each do |i|
test_queues[i] << build_cucumber_command("Cartridge Group #{i.to_s}", ["@cartridge#{i.to_s}"])
end
end

if options[:rhc]
if @is_fedora
test_queues[0] << build_rake_command("RHC Spec", 'cd /data/openshift-test/rhc; bundle install --local && bundle exec rake spec', {"SKIP_RUNCON" => 1}, false)
test_queues[0] << build_rake_command("RHC Features", %{
Expand Down Expand Up @@ -99,10 +112,14 @@ def test(options)

#These are special tests that cannot be written to work concurrently
singleton_queue = []
idle_all_gears

unless options[:exclude_node]
idle_all_gears
singleton_queue << build_cucumber_command("Runtime singletons", ["@singleton"])
if options[:node]
singleton_queue << build_cucumber_command("Runtime singletons", ["@node_singleton"])
end

if options[:cart]
singleton_queue << build_cucumber_command("Runtime singletons", ["@cart_singleton"])
end

run_tests_with_retry([singleton_queue])
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-openshift/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

module Vagrant
module Openshift
VERSION = "0.0.7"
VERSION = "0.0.8"
end
end

0 comments on commit 8027b94

Please sign in to comment.