cloud-toaster 1.1.4 → 1.1.5
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 +8 -8
- data/Gemfile +3 -2
- data/README.md +2 -1
- data/Rakefile +0 -16
- data/VERSION +1 -1
- data/bin/toaster +5 -11
- data/chef/cookbooks/lxc/recipes/setup_database.rb +6 -2
- data/chef/cookbooks/toaster/recipes/testing.rb +2 -8
- data/lib/toaster/api.rb +2 -2
- data/lib/toaster/chef/chef_util.rb +2 -4
- data/lib/toaster/chef/failsafe_resource_parser.rb +1 -27
- data/lib/toaster/chef/resource_inspector.rb +1 -6
- data/lib/toaster/model/key_value_pair.rb +2 -0
- data/lib/toaster/model/task_parameter.rb +0 -2
- data/lib/toaster/test/test_runner.rb +21 -17
- data/lib/toaster/toaster_app_service.rb +3 -11
- data/lib/toaster/util/load_bundler.rb +23 -0
- data/lib/toaster/util/lxc.rb +1 -1
- data/webapp/app/controllers/scripts_controller.rb +1 -1
- data/webapp/app/views/test/gen.html.erb +1 -1
- data/webapp/app/views/test/suites.html.erb +1 -1
- data/webapp/config/application.rb +9 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmI2MjQ0MGYzYjJhZmVhNjkwYjBiOWFiNWY2YjI5Y2EyZTRlNzE4Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjdlYjdiMDA5Yzk0OWZkNzRmNDJjYjE0M2JhNWIyZjUxODg5N2ExZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGVjZjBiMDI2NDk4ZTZkYzc3YjY0YWRhMDFhNjgwN2ViZjc4Njg1ZGY1YzI5
|
10
|
+
NDRjMmE1NDY3OGUzMThjNmMwNTE0YWZiNmUzNDkyODdmOWVlZWEyNjBjYWE4
|
11
|
+
NTEyMGFmY2Q2Nzk1OGM2MjNmNjBmZDkwZDY5NTZkMGI5YzZjZTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGFlMDE4ZTBhOTE1YjRkNTA3Y2VlNDhmNDhiMWM2YThhMGNhOGM4N2Y4MzYz
|
14
|
+
MGVkODAzMzkyYTRlNzQ3MTYxNDY2NjU3ZTE0ZmQ4MDBkMDI3YjAzNGJlODY0
|
15
|
+
NGNjYzVlMWZjOWNhMjE0ZWU1MzE4YTgwMzU3NzlmYWVkNzdhMWY=
|
data/Gemfile
CHANGED
@@ -24,8 +24,9 @@ group :doc do
|
|
24
24
|
end
|
25
25
|
# Authentication module
|
26
26
|
gem 'devise'
|
27
|
-
#
|
28
|
-
gem 'thin'
|
27
|
+
# Use thin server (faster; prints less rails output/warnings)
|
28
|
+
gem 'thin', '~> 1.6' # 14-07-08: default version 2.0.0.pre is incompatible
|
29
|
+
# http://stackoverflow.com/questions/19579984/sinatra-server-wont-start-wrong-number-of-arguments
|
29
30
|
|
30
31
|
# TOASTER DEPENDENCIES
|
31
32
|
gem 'hashdiff' # diff hashes
|
data/README.md
CHANGED
@@ -23,11 +23,12 @@ sudo su -
|
|
23
23
|
# prerequisites:
|
24
24
|
apt-get -y install wget make bzip2 curl patch screen libgdbm-dev libyaml-dev libxml2-dev libxslt-dev libmysqlclient-dev libsqlite3-dev
|
25
25
|
curl -L https://get.rvm.io | bash -s stable --ruby
|
26
|
+
# (OR: install stable ruby versions from repo: apt-get install -y ruby ruby-dev)
|
26
27
|
source /usr/local/rvm/scripts/rvm
|
27
28
|
|
28
29
|
# install toaster gem:
|
29
30
|
gem build toaster.gemspec
|
30
|
-
gem install --no-ri --no-rdoc toaster
|
31
|
+
gem install --no-ri --no-rdoc cloud-toaster-*version*.gem
|
31
32
|
|
32
33
|
# (OR: install directly using rubygems.org: gem install cloud-toaster)
|
33
34
|
|
data/Rakefile
CHANGED
@@ -11,19 +11,6 @@ rescue Bundler::BundlerError => e
|
|
11
11
|
end
|
12
12
|
require 'rake'
|
13
13
|
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
gem.name = "cloud-toaster"
|
17
|
-
gem.license = "Apache"
|
18
|
-
gem.authors = ["Waldemar Hummer"]
|
19
|
-
gem.email = ["hummer@infosys.tuwien.ac.at"]
|
20
|
-
gem.homepage = "https://github.com/whummer/toaster"
|
21
|
-
gem.summary = %q{Testing of infrastructure-as-code automations.}
|
22
|
-
gem.description = %q{This gem provides tools for testing of infrastructure-as-code automations.}
|
23
|
-
gem.files = FileList['lib/**/*.rb', '[A-Z]*', 'spec/**/*'].to_a
|
24
|
-
end
|
25
|
-
Jeweler::RubygemsDotOrgTasks.new
|
26
|
-
|
27
14
|
require 'rspec/core'
|
28
15
|
require 'rspec/core/rake_task'
|
29
16
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
@@ -35,9 +22,6 @@ RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
35
22
|
spec.rcov = true
|
36
23
|
end
|
37
24
|
|
38
|
-
require 'cucumber/rake/task'
|
39
|
-
Cucumber::Rake::Task.new(:features)
|
40
|
-
|
41
25
|
task :default => :spec
|
42
26
|
|
43
27
|
require 'rdoc/task'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.5
|
data/bin/toaster
CHANGED
@@ -5,23 +5,17 @@
|
|
5
5
|
#
|
6
6
|
|
7
7
|
# some global/constant variables
|
8
|
+
ROOT_DIR = File.join(File.dirname(File.expand_path(__FILE__)), "..")
|
8
9
|
REQUIRED_CONFIGS = {
|
9
10
|
#"db.host" => "Database host"
|
10
11
|
}
|
11
|
-
|
12
|
+
$LOAD_PATH << File.join(ROOT_DIR, "lib")
|
12
13
|
|
13
|
-
#
|
14
|
-
require "
|
15
|
-
require "bundler/setup"
|
16
|
-
# bug fix for ruby 1.9+
|
17
|
-
require 'dl/import'
|
18
|
-
DL::Importable = DL::Importer
|
19
|
-
ENV['BUNDLE_GEMFILE'] = File.join(ROOT_DIR, "Gemfile")
|
20
|
-
Bundler.require(:default)
|
14
|
+
# load dependencies using Bundler
|
15
|
+
require "toaster/util/load_bundler"
|
21
16
|
|
22
17
|
# requires
|
23
|
-
|
24
|
-
require "toaster/api.rb"
|
18
|
+
require "toaster/api"
|
25
19
|
|
26
20
|
# util functions
|
27
21
|
def install_chef()
|
@@ -4,8 +4,13 @@ if platform_family?("debian")
|
|
4
4
|
node.set['mysql']['server_root_password'] = "root"
|
5
5
|
include_recipe "mysql::server"
|
6
6
|
|
7
|
+
root_dir = File.join(File.dirname(__FILE__), "..","..","..","..")
|
8
|
+
|
7
9
|
bash 'db_create' do
|
8
|
-
code
|
10
|
+
code <<-EOH
|
11
|
+
echo 'create database toaster;' | mysql -u root -p#{node['mysql']['server_root_password']}
|
12
|
+
cd #{root_dir}/webapp && ./bin/rake db:migrate RAILS_ENV=development
|
13
|
+
EOH
|
9
14
|
not_if "echo \"show databases;\" | mysql -u root -p#{node['mysql']['server_root_password']} | grep toaster"
|
10
15
|
end
|
11
16
|
|
@@ -19,4 +24,3 @@ EOH
|
|
19
24
|
end
|
20
25
|
|
21
26
|
end
|
22
|
-
|
@@ -39,14 +39,8 @@ FileUtils.mkpath(databags_dir) if !File.directory?(databags_dir)
|
|
39
39
|
root_dir = File.join(File.dirname(__FILE__), "..","..","..","..")
|
40
40
|
code_dir = File.join(root_dir, "lib")
|
41
41
|
$:.unshift(code_dir)
|
42
|
-
require
|
43
|
-
require "
|
44
|
-
# bug fix for ruby 1.9+
|
45
|
-
require 'dl/import'
|
46
|
-
DL::Importable = DL::Importer
|
47
|
-
ENV['BUNDLE_GEMFILE'] = File.join(root_dir, "Gemfile")
|
48
|
-
Bundler.require(:default)
|
49
|
-
|
42
|
+
# load gems and require files using Bundler
|
43
|
+
require "toaster/util/load_bundler"
|
50
44
|
|
51
45
|
package "gcc-c++" do
|
52
46
|
action :install
|
data/lib/toaster/api.rb
CHANGED
@@ -278,7 +278,7 @@ module Toaster
|
|
278
278
|
def web(detached=false)
|
279
279
|
puts "INFO: Starting Web application on port 8080"
|
280
280
|
dir = File.join(File.dirname(__FILE__), "..", "..")
|
281
|
-
cmd = "cd \"#{dir}\" && webapp/bin/rails server thin"
|
281
|
+
cmd = "cd \"#{dir}\" && #{dir}/webapp/bin/rails server thin"
|
282
282
|
if detached
|
283
283
|
Kernel::exec("screen -d -m #{cmd}")
|
284
284
|
else
|
@@ -325,7 +325,7 @@ module Toaster
|
|
325
325
|
if blocking
|
326
326
|
print_output = true
|
327
327
|
destroy_container = true
|
328
|
-
TestRunner.execute_test(test_case,
|
328
|
+
TestRunner.execute_test(test_case, destroy_container, print_output)
|
329
329
|
else
|
330
330
|
puts "INFO: Scheduling test cases #{test_case_uuids} for test suite uuid '#{test_suite_uuid}'"
|
331
331
|
if $test_runners[test_suite_uuid]
|
@@ -161,9 +161,8 @@ module Toaster
|
|
161
161
|
Util.write(solo_file, (<<-EOF
|
162
162
|
cookbook_path [
|
163
163
|
"#{File.expand_path(File.join(Dir.pwd, "cookbooks"))}",
|
164
|
-
"#{
|
165
|
-
"#{File.join(root_dir, "chef", "cookbooks")}"
|
166
|
-
"#{@@DEFAULT_COOKBOOKS_DIR}"
|
164
|
+
"#{@@DEFAULT_COOKBOOKS_DIR}",
|
165
|
+
"#{File.join(root_dir, "chef", "cookbooks")}"
|
167
166
|
]
|
168
167
|
EOF
|
169
168
|
), true)
|
@@ -809,7 +808,6 @@ module Toaster
|
|
809
808
|
puts "WARN: Could not parse code file #{recipe_file} : #{line + 1}"
|
810
809
|
else
|
811
810
|
resource_obj = ResourceInspector.get_resource_from_source(code, attributes_source)
|
812
|
-
puts "received resource_obj: #{resource_obj}"
|
813
811
|
result[cookbook][recipe_name]["resources"][line] = code
|
814
812
|
result[cookbook][recipe_name]["resource_objs"][line] = resource_obj
|
815
813
|
if !code.match(/not_if\s*/) && !code.match(/only_if\s*/)
|
@@ -55,7 +55,6 @@ class ::Chef
|
|
55
55
|
|
56
56
|
module DSL
|
57
57
|
module Recipe
|
58
|
-
#alias_method :old_method_missing, :method_missing
|
59
58
|
$old_mm = ::Chef::DSL::Recipe.instance_method(:method_missing)
|
60
59
|
def attributes_proxy=(attrs)
|
61
60
|
@attributes_proxy = attrs
|
@@ -70,18 +69,10 @@ class ::Chef
|
|
70
69
|
begin
|
71
70
|
super
|
72
71
|
rescue Object => ex
|
73
|
-
puts "WARN: cannot run instance_eval on recipe: #{ex}"
|
72
|
+
puts "WARN: cannot run instance_eval on recipe: #{ex} - #{ex.backtrace.join("\n")}"
|
74
73
|
end
|
75
74
|
end
|
76
|
-
# def build_resource(type, name, created_at=nil, &resource_attrs_block)
|
77
|
-
# if !name
|
78
|
-
# name = "__unnamed__"
|
79
|
-
# end
|
80
|
-
# super(type, name, created_at, &resource_attrs_block)
|
81
|
-
# end
|
82
75
|
def method_missing(method_symbol, *args, &block)
|
83
|
-
#puts "method_missing:"
|
84
|
-
puts method_symbol
|
85
76
|
begin
|
86
77
|
|
87
78
|
# code copied from chef/dsl/recipe.rb
|
@@ -104,8 +95,6 @@ class ::Chef
|
|
104
95
|
end
|
105
96
|
end
|
106
97
|
|
107
|
-
#old_method_missing(method_symbol, args, block)
|
108
|
-
#super
|
109
98
|
if caller.size > 250
|
110
99
|
puts $old_mm.object_id
|
111
100
|
puts "--"
|
@@ -113,24 +102,9 @@ class ::Chef
|
|
113
102
|
puts "-------"
|
114
103
|
return nil
|
115
104
|
end
|
116
|
-
# puts "--->"
|
117
|
-
# puts self
|
118
|
-
# $old_mm.bind(self).(method_symbol, *args, &block)
|
119
105
|
rescue Object => ex
|
120
|
-
# begin
|
121
|
-
#puts ex
|
122
|
-
#puts ex.backtrace.join(" \n")
|
123
106
|
proxy = @attributes_proxy ? @attributes_proxy : $new_node
|
124
|
-
#puts "proxy (in new line):"
|
125
|
-
#puts proxy
|
126
|
-
#puts method_symbol
|
127
107
|
proxy.send(method_symbol, *args, &block)
|
128
|
-
# rescue Object => ex1
|
129
|
-
# puts ex1
|
130
|
-
# puts ex1.backtrace.join(" \n")
|
131
|
-
# puts "----"
|
132
|
-
# puts caller
|
133
|
-
# end
|
134
108
|
end
|
135
109
|
end
|
136
110
|
end
|
@@ -47,7 +47,7 @@ module Toaster
|
|
47
47
|
if task_or_sourcecode.kind_of?(Task)
|
48
48
|
param = TaskParameter.new(task_or_sourcecode, param)
|
49
49
|
else
|
50
|
-
param = TaskParameter.new(
|
50
|
+
param = TaskParameter.new(:key => param)
|
51
51
|
end
|
52
52
|
exists = result.find { |p| (p.kind_of?(TaskParameter) ? p.key : p) ==
|
53
53
|
(param.kind_of?(TaskParameter) ? param.key : param) }
|
@@ -191,11 +191,6 @@ module Toaster
|
|
191
191
|
msg = ex.to_s
|
192
192
|
puts msg if attempt <= 1
|
193
193
|
puts ex.backtrace if attempt <= 1
|
194
|
-
#puts "----"
|
195
|
-
#puts resource_src
|
196
|
-
#puts "----"
|
197
|
-
# puts msg
|
198
|
-
# puts ex.backtrace
|
199
194
|
|
200
195
|
if msg.match(/Cannot find a resource for/)
|
201
196
|
pkg_name = msg.gsub(/.*for ([a-z0-9A-Z_]+) on.*/, '\1').to_s
|
@@ -163,7 +163,7 @@ module Toaster
|
|
163
163
|
c = TestCase.new(test_suite)
|
164
164
|
test_suite.test_cases << c
|
165
165
|
puts "INFO: Executing initial automation run; test case '#{c.uuid}'"
|
166
|
-
automation_run = execute_test(c,
|
166
|
+
automation_run = execute_test(c, destroy_container, print_output)
|
167
167
|
puts "DEBUG: Finished execution of initial automation run; test case '#{c.uuid}': #{automation_run}"
|
168
168
|
return nil if !automation_run
|
169
169
|
return automation_run.automation
|
@@ -194,8 +194,8 @@ module Toaster
|
|
194
194
|
#
|
195
195
|
# execute the provided test case
|
196
196
|
#
|
197
|
-
def self.execute_test(test_case,
|
198
|
-
|
197
|
+
def self.execute_test(test_case, destroy_container=true,
|
198
|
+
print_output=false, num_attempts=2)
|
199
199
|
|
200
200
|
test_suite = nil
|
201
201
|
test_id = nil
|
@@ -205,13 +205,9 @@ module Toaster
|
|
205
205
|
test_suite = test_case.test_suite
|
206
206
|
automation = test_suite.automation
|
207
207
|
test_id = test_suite.uuid
|
208
|
-
automation_name = automation.get_short_name if !automation_name
|
209
208
|
recipes = automation.recipes
|
210
209
|
end
|
211
210
|
|
212
|
-
# generate automation attributes which represent this test case
|
213
|
-
chef_node_attrs = test_case.create_chef_node_attrs()
|
214
|
-
|
215
211
|
sleep_time = 0
|
216
212
|
self.semaphore.synchronize do
|
217
213
|
time = TimeStamp.now()
|
@@ -234,7 +230,12 @@ module Toaster
|
|
234
230
|
begin
|
235
231
|
automation_run = nil
|
236
232
|
if automation.is_chef?
|
237
|
-
|
233
|
+
# generate automation attributes which represent this test case
|
234
|
+
chef_node_attrs = test_case.create_chef_node_attrs()
|
235
|
+
# set cookbook if necessary
|
236
|
+
automation.cookbook = automation.get_short_name if !automation.cookbook
|
237
|
+
# now run test!
|
238
|
+
automation_run = TestRunner.do_execute_test_chef(automation.cookbook,
|
238
239
|
automation.script, recipes, chef_node_attrs, test_suite.lxc_prototype,
|
239
240
|
test_id, destroy_container, print_output)
|
240
241
|
else
|
@@ -300,12 +301,12 @@ module Toaster
|
|
300
301
|
Toaster::ChefUtil.download_cookbook_url_in_lxc(lxc, script_url)
|
301
302
|
end
|
302
303
|
|
303
|
-
def self.do_execute_test_chef(
|
304
|
+
def self.do_execute_test_chef(cookbook_name, script_url, recipes, chef_node_attrs,
|
304
305
|
prototype_name, test_id=nil, destroy_container=true, print_output=false, num_repeats=0)
|
305
306
|
|
306
307
|
# Create/prepare new LXC container.
|
307
308
|
lxc = LXC.new_container(prototype_name)
|
308
|
-
prepare_test_container_for_chef(lxc, script_url,
|
309
|
+
prepare_test_container_for_chef(lxc, script_url, cookbook_name, recipes)
|
309
310
|
|
310
311
|
recipes = [recipes] if !recipes.kind_of?(Array)
|
311
312
|
automation_run = nil
|
@@ -314,13 +315,16 @@ module Toaster
|
|
314
315
|
|
315
316
|
begin
|
316
317
|
# create run list from list of recipe names
|
317
|
-
run_list = recipes.collect { |r|
|
318
|
-
"recipe[
|
318
|
+
run_list = recipes.collect { |r|
|
319
|
+
r.include?("recipe[") ? r :
|
320
|
+
r.include?("::") ?
|
321
|
+
"recipe[#{r}]" :
|
322
|
+
"recipe[#{cookbook_name}::#{r}]" }
|
319
323
|
|
320
324
|
# run chef automation within LXC container
|
321
325
|
key = "runChef " + Util.generate_short_uid()
|
322
326
|
TimeStamp.add(nil, key)
|
323
|
-
output = LXC.run_chef_node(lxc,
|
327
|
+
output = LXC.run_chef_node(lxc, cookbook_name, run_list, chef_node_attrs)
|
324
328
|
TimeStamp.add(nil, key)
|
325
329
|
|
326
330
|
automation_run_id = nil
|
@@ -331,12 +335,12 @@ module Toaster
|
|
331
335
|
puts "WARN: Could not extract automation run ID from output of previous test case run ('#{automation_run_id}')."
|
332
336
|
# repeat the process
|
333
337
|
(1..num_repeats).each do |iteration|
|
334
|
-
puts "INFO: Repeating test case '#{test_id}' -
|
338
|
+
puts "INFO: Repeating test case '#{test_id}' - cookbook '#{cookbook_name}', run list '#{run_list}'"
|
335
339
|
# create/prepate new container
|
336
340
|
lxc_new = LXC.new_container(prototype_name)
|
337
|
-
prepare_test_container_for_chef(lxc_new, script_url,
|
341
|
+
prepare_test_container_for_chef(lxc_new, script_url, cookbook_name, recipes)
|
338
342
|
|
339
|
-
output = LXC.run_chef_node(lxc_new,
|
343
|
+
output = LXC.run_chef_node(lxc_new, cookbook_name, run_list, chef_node_attrs)
|
340
344
|
output.scan(pattern) { |id| automation_run_id = id[0].strip }
|
341
345
|
if destroy_container
|
342
346
|
LXC.destroy_container(lxc_new)
|
@@ -361,7 +365,7 @@ module Toaster
|
|
361
365
|
else
|
362
366
|
auto = automation_run.automation
|
363
367
|
if !auto.chef_run_list || auto.chef_run_list.empty?
|
364
|
-
chef_node = ChefUtil.extract_node_name(
|
368
|
+
chef_node = ChefUtil.extract_node_name(cookbook_name)
|
365
369
|
auto.chef_run_list = [].concat(ChefUtil.prepare_run_list(chef_node, run_list))
|
366
370
|
auto.save
|
367
371
|
end
|
@@ -1,18 +1,10 @@
|
|
1
1
|
|
2
2
|
$LOAD_PATH << File.join(File.expand_path(File.dirname(__FILE__)), "..")
|
3
3
|
|
4
|
+
# load dependencies using bundler
|
5
|
+
require "toaster/util/load_bundler"
|
4
6
|
|
5
|
-
|
6
|
-
require 'bundler/setup'
|
7
|
-
|
8
|
-
# bug fix for ruby 1.9+
|
9
|
-
require 'dl/import'
|
10
|
-
DL::Importable = DL::Importer
|
11
|
-
|
12
|
-
# call bundler
|
13
|
-
Bundler.require(:default)
|
14
|
-
|
15
|
-
|
7
|
+
# requires
|
16
8
|
require 'toaster/util/config'
|
17
9
|
require 'toaster/util/docker'
|
18
10
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Load dependent gems into $LOAD_PATH and
|
2
|
+
# invoke all necessary *require*s using Bundler
|
3
|
+
|
4
|
+
if !$toaster_bundler_loaded
|
5
|
+
TOASTER_ROOT_DIR = File.join(File.dirname(__FILE__), "..","..","..")
|
6
|
+
ENV['BUNDLE_GEMFILE'] = File.join(TOASTER_ROOT_DIR, "Gemfile")
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler/setup'
|
9
|
+
|
10
|
+
# bug fix for ruby 1.9+ required to load gem tidy
|
11
|
+
original_verbosity = $VERBOSE
|
12
|
+
$VERBOSE = nil # disable warning "DL is deprecated, please use Fiddle"
|
13
|
+
require 'dl/import'
|
14
|
+
DL::Importable = DL::Importer
|
15
|
+
$VERBOSE = original_verbosity
|
16
|
+
|
17
|
+
# call bundler
|
18
|
+
Bundler.require(:default)
|
19
|
+
|
20
|
+
# $LOAD_PATH changed by Bundler, we have to add toaster again
|
21
|
+
$LOAD_PATH << File.join(TOASTER_ROOT_DIR, "lib")
|
22
|
+
$toaster_bundler_loaded = true
|
23
|
+
end
|
data/lib/toaster/util/lxc.rb
CHANGED
@@ -139,7 +139,7 @@ module Toaster
|
|
139
139
|
node_attributes["toaster"][key] = value
|
140
140
|
end
|
141
141
|
end
|
142
|
-
puts "DEBUG: Chef node attributes: #{node_attributes.inspect}"
|
142
|
+
puts "DEBUG: Chef automation #{chef_node}, node attributes: #{node_attributes.inspect}"
|
143
143
|
|
144
144
|
run_chef(lxc, chef_node, node_attributes)
|
145
145
|
end
|
@@ -113,7 +113,7 @@ class ScriptsController < ApplicationController
|
|
113
113
|
params[:cookbook], rec, params[:cookbook_version])[params[:cookbook]][rec]
|
114
114
|
recipe_info["resources"].each do |line,code|
|
115
115
|
action = "__action__"
|
116
|
-
resource = "
|
116
|
+
resource = "__resource__"
|
117
117
|
if recipe_info["resource_objs"][line]
|
118
118
|
action = recipe_info["resource_objs"][line].action
|
119
119
|
action = action.join(" , ") if action.kind_of?(Array)
|
@@ -119,7 +119,7 @@ begin
|
|
119
119
|
test_coverage = TestCoverage.new(test_suite, state_graph)
|
120
120
|
end
|
121
121
|
|
122
|
-
test_suites = Toaster::TestSuite.find()
|
122
|
+
test_suites = Toaster::TestSuite.find().to_a
|
123
123
|
test_suites.sort! { |x,y| (!x.last_test || !y.last_test) ? 0 :
|
124
124
|
x.last_test.start_time.to_i <=> y.last_test.start_time.to_i }
|
125
125
|
rescue => ex
|
@@ -152,7 +152,7 @@ end
|
|
152
152
|
<%= link_to 'details', "/execs/#{test_suite.automation.id}/#{test.automation_run.id}" %>
|
153
153
|
<% end %>
|
154
154
|
</td><td>
|
155
|
-
<% if !test.running_or_scheduled? %>
|
155
|
+
<% if !test.automation_run && !test.running_or_scheduled? %>
|
156
156
|
<%= link_to 'execute', "/test/exec/#{test.test_suite.id}/#{test.id}",
|
157
157
|
:data => { :confirm => 'Are you sure you want to execute this test case?', :method => :post } %>
|
158
158
|
<% end %>
|
@@ -1,14 +1,20 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
+
root_dir = File.join(File.dirname(__FILE__), "..", "..")
|
4
|
+
$LOAD_PATH << File.join(root_dir, "lib")
|
5
|
+
# load dependencies using bundler
|
6
|
+
require "toaster/util/load_bundler"
|
7
|
+
|
8
|
+
|
3
9
|
require 'rails/all'
|
4
10
|
|
5
11
|
# Require the gems listed in Gemfile, including any gems
|
6
12
|
# you've limited to :test, :development, or :production.
|
7
13
|
|
8
14
|
# bug fix for ruby 1.9+
|
9
|
-
require 'dl/import'
|
10
|
-
DL::Importable = DL::Importer
|
11
|
-
Bundler.require(:default, Rails.env)
|
15
|
+
#require 'dl/import'
|
16
|
+
#DL::Importable = DL::Importer
|
17
|
+
#Bundler.require(:default, Rails.env)
|
12
18
|
|
13
19
|
module Toaster
|
14
20
|
class Application < Rails::Application
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-toaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Waldemar Hummer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -486,6 +486,7 @@ files:
|
|
486
486
|
- lib/toaster/util/docker.rb
|
487
487
|
- lib/toaster/util/mem_dump.rb
|
488
488
|
- lib/toaster/util/util.rb
|
489
|
+
- lib/toaster/util/load_bundler.rb
|
489
490
|
- lib/toaster/util/lxc.rb
|
490
491
|
- lib/toaster/util/timestamp.rb
|
491
492
|
- lib/toaster/test/test_result.rb
|