continuous4r 0.0.1 → 0.0.2
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.
- data/History.txt +1 -1
- data/Manifest.txt +34 -34
- data/PostInstall.txt +3 -0
- data/README.rdoc +58 -0
- data/Rakefile +28 -3
- data/lib/changelog_builder.rb +51 -0
- data/lib/continuous4r.rb +63 -426
- data/lib/dcov_builder.rb +144 -0
- data/lib/flay_builder.rb +38 -0
- data/lib/flog_builder.rb +120 -0
- data/lib/git_extractor.rb +48 -0
- data/lib/rcov_builder.rb +23 -0
- data/lib/rdoc_builder.rb +33 -0
- data/lib/reek_builder.rb +38 -0
- data/lib/roodi_builder.rb +41 -0
- data/lib/saikuro_builder.rb +20 -0
- data/lib/site/body-changelog.rhtml +1 -1
- data/lib/site/body-continuous4r-reports.rhtml +40 -47
- data/lib/site/body-dcov.rhtml +1 -21
- data/lib/site/body-flay.rhtml +16 -0
- data/lib/site/body-flog.rhtml +2 -10
- data/lib/site/body-rcov.rhtml +2 -3
- data/lib/site/body-rdoc.rhtml +1 -1
- data/lib/site/body-reek.rhtml +16 -0
- data/lib/site/body-roodi.rhtml +16 -0
- data/lib/site/body-saikuro.rhtml +32 -0
- data/lib/site/body-scm-usage.rhtml +13 -12
- data/lib/site/body-stats.rhtml +1 -1
- data/lib/site/body-tests.rhtml +1 -1
- data/lib/site/body-xdoclet.rhtml +29 -0
- data/lib/site/body-zentest.rhtml +1 -1
- data/lib/site/flog.html.erb +33 -0
- data/lib/site/flog_page.html.erb +74 -0
- data/lib/site/header.rhtml +36 -20
- data/lib/site/images/added.png +0 -0
- data/lib/site/images/deleted.png +0 -0
- data/lib/site/images/modified.png +0 -0
- data/lib/site/menu-continuous4r-reports.rhtml +4 -14
- data/lib/site/{menu-dcov.rhtml → menu-task.rhtml} +3 -5
- data/lib/site/style/maven-base.css +3 -0
- data/lib/site/syntax_highlighting.css +30 -0
- data/lib/stats_builder.rb +18 -0
- data/lib/subversion_extractor.rb +29 -19
- data/lib/tasks/continuous4r-project.xml +26 -0
- data/lib/tasks/continuous4r.rake +23 -0
- data/lib/tasks/continuous4r.rb +6 -0
- data/lib/tests_builder.rb +21 -0
- data/lib/tests_formatter.rb +13 -46
- data/lib/utils.rb +47 -0
- data/lib/xdoclet_builder.rb +48 -0
- data/lib/zen_test_formatter.rb +58 -28
- data/lib/zentest_builder.rb +19 -0
- data/script/console +10 -0
- data/script/console.cmd +1 -0
- data/script/destroy +1 -1
- data/script/generate +1 -1
- data/test/test_continuous4r.rb +1 -1
- data/test/test_helper.rb +1 -0
- data/website/index.html +141 -363
- data/website/index.txt +169 -228
- data/website/template.rhtml +2 -2
- metadata +66 -46
- data/License.txt +0 -20
- data/README.txt +0 -1
- data/config/hoe.rb +0 -71
- data/config/requirements.rb +0 -17
- data/lib/capistrano_formatter.rb +0 -19
- data/lib/continuous4r/version.rb +0 -9
- data/lib/flog_formatter.rb +0 -48
- data/lib/heckle_formatter.rb +0 -27
- data/lib/httperf_formatter.rb +0 -160
- data/lib/site/body-capistrano.rhtml +0 -8
- data/lib/site/body-heckle.rhtml +0 -16
- data/lib/site/body-httperf.rhtml +0 -8
- data/lib/site/body-kwala.rhtml +0 -35
- data/lib/site/body-railroad.rhtml +0 -29
- data/lib/site/menu-capistrano.rhtml +0 -23
- data/lib/site/menu-changelog.rhtml +0 -23
- data/lib/site/menu-flog.rhtml +0 -23
- data/lib/site/menu-heckle.rhtml +0 -23
- data/lib/site/menu-httperf.rhtml +0 -23
- data/lib/site/menu-kwala.rhtml +0 -23
- data/lib/site/menu-railroad.rhtml +0 -23
- data/lib/site/menu-rcov.rhtml +0 -23
- data/lib/site/menu-rdoc.rhtml +0 -23
- data/lib/site/menu-stats.rhtml +0 -23
- data/lib/site/menu-tests.rhtml +0 -23
- data/lib/site/menu-zentest.rhtml +0 -23
- data/log/debug.log +0 -0
- data/script/txt2html +0 -74
- data/script/txt2html.cmd +0 -1
- data/setup.rb +0 -1585
- data/tasks/deployment.rake +0 -34
- data/tasks/environment.rake +0 -7
- data/tasks/website.rake +0 -17
data/lib/tests_formatter.rb
CHANGED
|
@@ -6,58 +6,25 @@ require 'XmlElements'
|
|
|
6
6
|
# Author: Vincent Dubois
|
|
7
7
|
# =====================================================
|
|
8
8
|
class TestsFormatter
|
|
9
|
-
attr_accessor :params
|
|
10
|
-
|
|
11
|
-
# Constructeur
|
|
12
|
-
def initialize params
|
|
13
|
-
self.params = params
|
|
14
|
-
end
|
|
15
|
-
|
|
16
9
|
# Methode qui permet de fabriquer le flux HTML a partir des flux console
|
|
17
10
|
# de tests unitaires
|
|
18
11
|
def to_html
|
|
19
12
|
html = "<table class='bodyTable'><thead><th>Testing element</th><th>Pass</th><th>Result</th></thead><tbody>"
|
|
20
13
|
i = 0
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><strong>#{runner
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
puts " #{File.read("test_units.log")}"
|
|
30
|
-
raise " BUILD FAILED."
|
|
31
|
-
end
|
|
32
|
-
html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
|
|
33
|
-
html = html + "<td><pre>#{File.read("test_units.log")}</pre></td></tr>"
|
|
34
|
-
when "functionals"
|
|
35
|
-
pass = system("rake test:functionals > test_functionals.log")
|
|
36
|
-
if !pass
|
|
37
|
-
puts " #{File.read("test_functionals.log")}"
|
|
38
|
-
raise " BUILD FAILED."
|
|
39
|
-
end
|
|
40
|
-
html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
|
|
41
|
-
html = html + "<td><pre>#{File.read("test_functionals.log")}</pre></td></tr>"
|
|
42
|
-
when "integration"
|
|
43
|
-
pass = system("rake test:integration > test_integration.log")
|
|
44
|
-
if !pass
|
|
45
|
-
puts " #{File.read("test_integration.log")}"
|
|
46
|
-
raise " BUILD FAILED."
|
|
47
|
-
end
|
|
48
|
-
html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
|
|
49
|
-
html = html + "<td><pre>#{File.read("test_integration.log")}</pre></td></tr>"
|
|
50
|
-
when "rspec"
|
|
51
|
-
pass = system("rake spec > test_rspec.log")
|
|
52
|
-
if !pass
|
|
53
|
-
puts " #{File.read("test_rspec.log")}"
|
|
54
|
-
raise " BUILD FAILED."
|
|
55
|
-
end
|
|
56
|
-
html = html + "<td style='text-align: center;'><img src='images/icon_#{pass ? 'success' : 'error'}_sml.gif'/></td>"
|
|
57
|
-
html = html + "<td><pre>#{File.read("test_rspec.log").gsub(/\[32m|\[0m|\[31m/,"")}</pre></td></tr>"
|
|
58
|
-
else
|
|
59
|
-
raise " Don't know how to run '#{runner['type']}' test.\n BUILD FAILED."
|
|
14
|
+
project = XmlElements.fromString(File.read("continuous4r-project.xml"))
|
|
15
|
+
['units','functionals','integration'].each do |runner|
|
|
16
|
+
puts " Running #{runner} tests..."
|
|
17
|
+
html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><strong>#{runner}</strong></td>"
|
|
18
|
+
result = Utils.run_command("rake test:#{runner}")
|
|
19
|
+
passed = (result.index("Failure:").nil? and result.index("Error:").nil? and result.index("pending migrations").nil? and result.split(/$/).length > 1)
|
|
20
|
+
if project['ignore-tests-failures'] == "false" and passed == false
|
|
21
|
+
raise " #{runner} tests failed.\n BUILD FAILED."
|
|
60
22
|
end
|
|
23
|
+
f = File.open("#{Continuous4r::WORK_DIR}/test_#{runner}.log", "w")
|
|
24
|
+
f.write(result)
|
|
25
|
+
f.close
|
|
26
|
+
html = html + "<td style='text-align: center;'><img src='images/icon_#{passed ? 'success' : 'error'}_sml.gif'/></td>"
|
|
27
|
+
html = html + "<td><pre>#{File.read("#{Continuous4r::WORK_DIR}/test_#{runner}.log")}</pre></td></tr>"
|
|
61
28
|
i = i + 1
|
|
62
29
|
end
|
|
63
30
|
html = html + "</tbody></table>"
|
data/lib/utils.rb
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Module de fonctions utilitaires necessaire a la construction
|
|
2
|
+
module Utils
|
|
3
|
+
|
|
4
|
+
# Methode qui permet de construire une page avec eruby, et de lever une exception au besoin
|
|
5
|
+
def self.erb_run page, is_a_task = true
|
|
6
|
+
page_file = File.open("#{Continuous4r::WORK_DIR}/#{page}.html", "w")
|
|
7
|
+
erb = ERB.new(File.read("#{File.dirname(__FILE__)}/site/header.rhtml"))
|
|
8
|
+
page_file.write(erb.result)
|
|
9
|
+
if is_a_task == true
|
|
10
|
+
erb = ERB.new(File.read("#{File.dirname(__FILE__)}/site/menu-task.rhtml"), 0, "%<>")
|
|
11
|
+
current_task = page
|
|
12
|
+
page_file.write(erb.result(binding))
|
|
13
|
+
else
|
|
14
|
+
erb = ERB.new(File.read("#{File.dirname(__FILE__)}/site/menu-#{page}.rhtml"), 0, "%<>")
|
|
15
|
+
page_file.write(erb.result)
|
|
16
|
+
end
|
|
17
|
+
erb = ERB.new(File.read("#{File.dirname(__FILE__)}/site/body-#{page}.rhtml"))
|
|
18
|
+
page_file.write(erb.result)
|
|
19
|
+
page_file.close
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Methode qui permet de lancer une ligne de commande et de renvoyer son resultat
|
|
23
|
+
def self.run_command(cmd)
|
|
24
|
+
if Config::CONFIG['host_os'] =~ /mswin/
|
|
25
|
+
`cmd.exe /C #{cmd}`
|
|
26
|
+
else
|
|
27
|
+
`#{cmd}`
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Methode de verification de la presence d'un gem, avec installation au besoin
|
|
32
|
+
def self.verify_gem_presence(gem, auto_install, proxy_option)
|
|
33
|
+
gem_version = run_command("gem list #{gem}")
|
|
34
|
+
if gem_version.blank?
|
|
35
|
+
if auto_install == "true"
|
|
36
|
+
puts " Installing #{gem}..."
|
|
37
|
+
gem_installed = Utils.run_command("#{"sudo " unless Config::CONFIG['host_os'] =~ /mswin/}gem install #{gem}#{proxy_option}")
|
|
38
|
+
if gem_installed.index("installed").nil?
|
|
39
|
+
raise " Install for #{gem} failed with command '#{"sudo " unless Config::CONFIG['host_os'] =~ /mswin/}gem install #{gem}#{proxy_option}'\n BUILD FAILED."
|
|
40
|
+
end
|
|
41
|
+
else
|
|
42
|
+
raise " You don't seem to have #{gem} installed. You can install it with '#{"sudo " unless Config::CONFIG['host_os'] =~ /mswin/}gem install #{gem}#{proxy_option}'.\n BUILD FAILED."
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# ==========================================================================
|
|
2
|
+
# Construction de la tache xdoclet (transformation du code Ruby en HMTL)
|
|
3
|
+
# author: Vincent Dubois
|
|
4
|
+
# date: 07 fevrier 2009
|
|
5
|
+
# ==========================================================================
|
|
6
|
+
class XdocletBuilder
|
|
7
|
+
include Utils
|
|
8
|
+
|
|
9
|
+
# Implementation de la construction de la tache
|
|
10
|
+
def build(project_name, auto_install, proxy_option)
|
|
11
|
+
# Vérification de la présence du gem syntax
|
|
12
|
+
Utils.verify_gem_presence("syntax", auto_install, proxy_option)
|
|
13
|
+
# Génération du rapport pour chaque fichier source ruby
|
|
14
|
+
puts " Building xdoc source report..."
|
|
15
|
+
FileUtils.mkdir("#{Continuous4r::WORK_DIR}/xdoclet")
|
|
16
|
+
require 'syntax/convertors/html'
|
|
17
|
+
files = Array.new
|
|
18
|
+
files << Dir.glob("#{RAILS_ROOT}/app/**/*.rb")
|
|
19
|
+
files << Dir.glob("#{RAILS_ROOT}/lib/**/*.rb")
|
|
20
|
+
files << Dir.glob("#{RAILS_ROOT}/test/**/*.rb")
|
|
21
|
+
files.flatten!
|
|
22
|
+
convertor = Syntax::Convertors::HTML.for_syntax("ruby")
|
|
23
|
+
|
|
24
|
+
files.each do |file|
|
|
25
|
+
print "\nProcessing #{file.gsub(Regexp.new("#{RAILS_ROOT}/"),'')}..."
|
|
26
|
+
ruby_code = File.read(file)
|
|
27
|
+
html_code = convertor.convert(ruby_code)
|
|
28
|
+
# Ajout des numéros de lignes
|
|
29
|
+
html_code_with_lines = ""
|
|
30
|
+
html_code_lines = html_code.split(/$/)
|
|
31
|
+
html_code_lines.each_with_index do |line,index|
|
|
32
|
+
if index == 0
|
|
33
|
+
html_code_with_lines = html_code_with_lines.concat("<pre><a name='#{(index + 1).to_s}'></a><span class='numline'>#{(index + 1).to_s.rjust(4)} </span>").concat(line.delete("\n").gsub(/<pre>/,'')).concat("\n")
|
|
34
|
+
elsif index == html_code_lines.length - 1
|
|
35
|
+
print "OK"
|
|
36
|
+
else
|
|
37
|
+
html_code_with_lines = html_code_with_lines.concat("<span class='numline'>#{(index + 1).to_s.rjust(4)} </span><a name='#{(index + 2).to_s}'></a>").concat(line.delete("\n")).concat("\n")
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
html_file = File.open("#{Continuous4r::WORK_DIR}/xdoclet/#{file.gsub(Regexp.new("#{RAILS_ROOT}/"),'').gsub(/\//,'_')}.html", "w")
|
|
41
|
+
html_global_code = "<html><head><title>Source code for #{file.gsub(Regexp.new("#{RAILS_ROOT}/"),'')}</title>"
|
|
42
|
+
html_global_code = html_global_code + "<style>#{File.read("#{File.dirname(__FILE__)}/site/syntax_highlighting.css")}</style>"
|
|
43
|
+
html_global_code = html_global_code + "<body><h2>Source code for #{file.gsub(Regexp.new("#{RAILS_ROOT}/"),'')}</h2><br/>#{html_code_with_lines}</body></html>"
|
|
44
|
+
html_file.write(html_global_code)
|
|
45
|
+
html_file.close
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/lib/zen_test_formatter.rb
CHANGED
|
@@ -6,42 +6,72 @@ require 'XmlElements'
|
|
|
6
6
|
# Author: Vincent Dubois
|
|
7
7
|
# =====================================================
|
|
8
8
|
class ZenTestFormatter
|
|
9
|
-
attr_accessor :params
|
|
10
|
-
|
|
11
|
-
# Constructeur
|
|
12
|
-
def initialize params
|
|
13
|
-
self.params = params
|
|
14
|
-
end
|
|
15
9
|
|
|
16
10
|
# Methode qui permet de fabriquer le flux HTML a partir des flux console
|
|
17
11
|
# de ZenTest
|
|
18
12
|
def to_html
|
|
13
|
+
files_controllers = files_models = Array.new
|
|
14
|
+
files_controllers << Dir.glob("app/controllers/*_controller.rb")
|
|
15
|
+
files_controllers.flatten!
|
|
16
|
+
files_models << Dir.glob("app/models/*.rb")
|
|
17
|
+
files_models.flatten!
|
|
19
18
|
html = "<table class='bodyTable'><thead><th>Element</th><th>Pass</th><th>Errors</th><th>Generated class</th></thead><tbody>"
|
|
20
19
|
i = 0
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
files_controllers.each do |runner|
|
|
21
|
+
['functional','integration'].each do |test_type|
|
|
22
|
+
if File.exist?("#{RAILS_ROOT}/test/#{test_type}/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}")
|
|
23
|
+
puts " Running ZenTest on #{runner} against test/#{test_type}/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}..."
|
|
24
|
+
html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><a href='xdoclet/#{runner.gsub(/\//,'_')}.html' target='_blank'>#{runner}</a><br/><strong>run against</strong><br/><a href='xdoclet/#{"test/#{test_type}/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}".gsub(/\//,'_')}.html' target='_blank'>test/#{test_type}/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}</a></td>"
|
|
25
|
+
Utils.run_command("zentest -r #{runner} test/#{test_type}/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")} > #{Continuous4r::WORK_DIR}/zentest.log")
|
|
26
|
+
file_content = File.read("#{Continuous4r::WORK_DIR}/zentest.log")
|
|
27
|
+
file_lines = file_content.split(/$/)
|
|
28
|
+
start_line = 0
|
|
29
|
+
while file_lines[start_line].index("Code Generated by ZenTest").nil?
|
|
30
|
+
start_line = start_line + 1
|
|
31
|
+
end
|
|
32
|
+
end_line = start_line
|
|
33
|
+
while file_lines[end_line].index("Number of errors detected").nil?
|
|
34
|
+
end_line = end_line + 1
|
|
35
|
+
end
|
|
36
|
+
number_of_errors = file_lines[end_line][29..(file_lines[end_line].length - 1)]
|
|
37
|
+
end_line = end_line - 1
|
|
38
|
+
html = html + "<td style='text-align: center;'><img src='images/icon_#{(number_of_errors.to_i == 0) ? 'success' : 'error'}_sml.gif'/></td>"
|
|
39
|
+
html = html + "<td style='text-align: center;'>#{number_of_errors}</td>"
|
|
40
|
+
html = html + "<td style='width: 75%;'><pre style='font-family: Courier New; font-size: 11px;'>"
|
|
41
|
+
(start_line..end_line).to_a.each do |index|
|
|
42
|
+
html = html + file_lines[index]
|
|
43
|
+
end
|
|
44
|
+
html = html + "</pre></td></tr>"
|
|
45
|
+
i = i + 1
|
|
46
|
+
end
|
|
30
47
|
end
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
end
|
|
49
|
+
files_models.each do |runner|
|
|
50
|
+
if File.exist?("#{RAILS_ROOT}/test/unit/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}")
|
|
51
|
+
puts " Running ZenTest on #{runner} against test/unit/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}..."
|
|
52
|
+
html = html + "<tr class='#{ i % 2 == 0 ? 'a' : 'b'}'><td><a href='xdoc/#{runner.gsub(/\//,'_')}.html' target='_blank'>#{runner}</a><br/><strong>run against</strong><br/><a href='xdoc/#{"test/unit/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}".gsub(/\//,'_')}.html' target='_blank'>test/unit/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")}</a></td>"
|
|
53
|
+
Utils.run_command("zentest -r #{runner} test/unit/#{runner.split("/")[2].gsub(Regexp.new(".rb"),"_test.rb")} > #{Continuous4r::WORK_DIR}/zentest.log")
|
|
54
|
+
file_content = File.read("#{Continuous4r::WORK_DIR}/zentest.log")
|
|
55
|
+
file_lines = file_content.split(/$/)
|
|
56
|
+
start_line = 0
|
|
57
|
+
while file_lines[start_line].index("Code Generated by ZenTest").nil?
|
|
58
|
+
start_line = start_line + 1
|
|
59
|
+
end
|
|
60
|
+
end_line = start_line
|
|
61
|
+
while file_lines[end_line].index("Number of errors detected").nil?
|
|
62
|
+
end_line = end_line + 1
|
|
63
|
+
end
|
|
64
|
+
number_of_errors = file_lines[end_line][29..(file_lines[end_line].length - 1)]
|
|
65
|
+
end_line = end_line - 1
|
|
66
|
+
html = html + "<td style='text-align: center;'><img src='images/icon_#{(number_of_errors.to_i == 0) ? 'success' : 'error'}_sml.gif'/></td>"
|
|
67
|
+
html = html + "<td style='text-align: center;'>#{number_of_errors}</td>"
|
|
68
|
+
html = html + "<td style='width: 75%;'><pre style='font-family: Courier New; font-size: 11px;'>"
|
|
69
|
+
(start_line..end_line).to_a.each do |index|
|
|
70
|
+
html = html + file_lines[index]
|
|
71
|
+
end
|
|
72
|
+
html = html + "</pre></td></tr>"
|
|
73
|
+
i = i + 1
|
|
42
74
|
end
|
|
43
|
-
html = html + "</pre></td></tr>"
|
|
44
|
-
i = i + 1
|
|
45
75
|
end
|
|
46
76
|
html = html + "</tbody></table>"
|
|
47
77
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ==========================================================================
|
|
2
|
+
# Construction de la tache zentest (manques dans les tests unitaires)
|
|
3
|
+
# author: Vincent Dubois
|
|
4
|
+
# date: 12 fevrier 2009
|
|
5
|
+
# ==========================================================================
|
|
6
|
+
class ZentestBuilder
|
|
7
|
+
include Utils
|
|
8
|
+
|
|
9
|
+
# Implementation de la construction de la tache
|
|
10
|
+
def build(project_name, auto_install, proxy_option)
|
|
11
|
+
# On verifie la presence de ZenTest
|
|
12
|
+
Utils.verify_gem_presence("ZenTest", auto_install, proxy_option)
|
|
13
|
+
# On lance la generation
|
|
14
|
+
puts " Building ZenTest report..."
|
|
15
|
+
zentest_report = File.open("#{Continuous4r::WORK_DIR}/zentest-body.html", "w")
|
|
16
|
+
zentest_report.write(ZenTestFormatter.new.to_html)
|
|
17
|
+
zentest_report.close
|
|
18
|
+
end
|
|
19
|
+
end
|
data/script/console
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# File: script/console
|
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
|
4
|
+
|
|
5
|
+
libs = " -r irb/completion"
|
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/continuous4r.rb'}"
|
|
9
|
+
puts "Loading continuous4r gem"
|
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/console.cmd
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@ruby script/console %*
|
data/script/destroy
CHANGED
data/script/generate
CHANGED
data/test/test_continuous4r.rb
CHANGED
data/test/test_helper.rb
CHANGED
data/website/index.html
CHANGED
|
@@ -33,375 +33,153 @@
|
|
|
33
33
|
<h1>continuous4r</h1>
|
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/continuous4r"; return false'>
|
|
35
35
|
<p>Get Version</p>
|
|
36
|
-
<a href="http://rubyforge.org/projects/continuous4r" class="numbers">0.0.
|
|
36
|
+
<a href="http://rubyforge.org/projects/continuous4r" class="numbers">0.0.2</a>
|
|
37
37
|
</div>
|
|
38
38
|
<h2><br/>What is it ?</h2>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<span class="ident">require</span> <span class="punct">'</span><span class="string">continuous4r</span><span class="punct">'</span>
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<span class="
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<span class="punct"><
|
|
86
|
-
<span class="punct"><</span><span class="tag">
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<span class="punct"><</span><span class="tag">
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<span class="punct"></</span><span class="tag">
|
|
94
|
-
<span class="
|
|
95
|
-
|
|
96
|
-
<span class="punct"><</span><span class="tag">
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<span class="punct"><</span><span class="tag">url</span><span class="punct">></span>BUGTRACKER_URL_TICKETS_LIST<span class="punct"></</span><span class="tag">url</span><span class="punct">></span>
|
|
100
|
-
<span class="punct"><</span><span class="tag">add</span><span class="punct">></span>BUGTRACKER_URL_TICKET_ADD<span class="punct"></</span><span class="tag">add</span><span class="punct">></span>
|
|
101
|
-
<span class="punct"></</span><span class="tag">bugtracker</span><span class="punct">></span>
|
|
102
|
-
<span class="punct"><</span><span class="tag">scm</span><span class="punct">></span>
|
|
103
|
-
<span class="punct"><</span><span class="tag">repository_type</span><span class="punct">></span>[svn|cvs]<span class="punct"></</span><span class="tag">repository_type</span><span class="punct">></span>
|
|
104
|
-
<span class="punct"><</span><span class="tag">url</span><span class="punct">></span>SCM_URL<span class="punct"></</span><span class="tag">url</span><span class="punct">></span>
|
|
105
|
-
<span class="punct"><</span><span class="tag">view</span><span class="punct">></span>SCM_VIEWER_URL<span class="punct"></</span><span class="tag">view</span><span class="punct">></span>
|
|
106
|
-
<span class="comment"><!-- needed if authentication for access is mandatory --></span>
|
|
107
|
-
<span class="punct"><</span><span class="tag">user</span><span class="punct">></span>userlogin<span class="punct"></</span><span class="tag">user</span><span class="punct">></span>
|
|
108
|
-
<span class="punct"><</span><span class="tag">password</span><span class="punct">></span>userpassword<span class="punct"></</span><span class="tag">password</span><span class="punct">></span>
|
|
109
|
-
<span class="punct"></</span><span class="tag">scm</span><span class="punct">></span>
|
|
110
|
-
<span class="comment"><!-- Gems mandatory for your project --></span>
|
|
111
|
-
<span class="punct"><</span><span class="tag">gems</span><span class="punct">></span>
|
|
112
|
-
<span class="punct"><</span><span class="tag">gem</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">GEM_NAME</span><span class="punct">"</span> <span class="attribute">version</span><span class="punct">="</span><span class="string">GEM_VERSION</span><span class="punct">"/></span>
|
|
113
|
-
...
|
|
114
|
-
<span class="punct"></</span><span class="tag">gems</span><span class="punct">></span>
|
|
115
|
-
<span class="comment"><!-- Tasks in order to generate reports, described further --></span>
|
|
116
|
-
<span class="punct"><</span><span class="tag">tasks</span> [<span class="attribute">autoinstall</span><span class="punct">="</span><span class="string">true</span><span class="punct">"]</span> <!<span class="attribute">--</span> <span class="attribute">activates</span> <span class="attribute">autoinstall</span> <span class="attribute">for</span> <span class="attribute">gems</span> <span class="attribute">needed</span> <span class="attribute">by</span> <span class="attribute">tasks</span> <span class="attribute">--</span><span class="punct">></span> >
|
|
117
|
-
...
|
|
118
|
-
<span class="punct"></</span><span class="tag">tasks</span><span class="punct">></span>
|
|
119
|
-
<span class="punct"></</span><span class="tag">project</span><span class="punct">></span></pre></p>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<h2>Defining tasks</h2>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
<h3>Changelog task</h3>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<p>Builds a report of the last modifications on the <span class="caps">SCM</span> repository. Only Subversion is supported
|
|
129
|
-
at the time.</p>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">changelog</span><span class="punct">"/></span>
|
|
39
|
+
<p>continuous4r is a continuous integration tool for Ruby on Rails. With it, you can aggregate reports of the best analysis, quality, and tests tools for Ruby on Rails. By just launching one Rake task and customizing a <span class="caps">XML</span> file describing your project, continuous4r builds for you an entire website in a Maven-like form/design.</p>
|
|
40
|
+
<h2>Requirements</h2>
|
|
41
|
+
<ul>
|
|
42
|
+
<li>RubyGems</li>
|
|
43
|
+
<li>rails (erb)</li>
|
|
44
|
+
<li>hpricot</li>
|
|
45
|
+
<li>XmlElements</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<h2>Installing</h2>
|
|
48
|
+
<p><pre class='syntax'><span class="punct">[</span><span class="ident">sudo</span><span class="punct">]</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">continuous4r</span></pre></p>
|
|
49
|
+
<h2>Release notes for this version</h2>
|
|
50
|
+
<ul>
|
|
51
|
+
<li>Full Windows support, and no need for the user to define the <span class="caps">HOME</span> environment variable.</li>
|
|
52
|
+
<li>Only quality and code-related tools kept (goodbye Capistrano, httperf, railroad…).</li>
|
|
53
|
+
<li>No need to create the project file from scratch now, type ‘rake continuous4r:init’ in your Rails project directory, and there you go.</li>
|
|
54
|
+
<li>Full extensibility : the tasks are now defined in [task]_builder.rb files, and instanciated dynamically.</li>
|
|
55
|
+
<li>Full refactoring (Ruby and <span class="caps">HTML</span>/<span class="caps">RHTML</span> parts).</li>
|
|
56
|
+
<li>Git support added.</li>
|
|
57
|
+
<li><span class="caps">HTTP</span> Proxy support (for those who are constrained by a proxy).</li>
|
|
58
|
+
<li>No need to have eruby installed, now uses the Rails erb compiler.</li>
|
|
59
|
+
<li><span class="caps">HTML</span> global template fixes.</li>
|
|
60
|
+
<li>No need to define or configure your tasks anymore.</li>
|
|
61
|
+
</ul>
|
|
62
|
+
<h2>The basics</h2>
|
|
63
|
+
<h3>Preparing your project</h3>
|
|
64
|
+
<p>In order to have access to continuous4r Rake tasks, you must open your Rakefile, and add to the end :</p>
|
|
65
|
+
<p><pre class='syntax'><span class="ident">require</span> <span class="punct">'</span><span class="string">continuous4r</span><span class="punct">'</span></pre></p>
|
|
66
|
+
<h3>Initializing your project</h3>
|
|
67
|
+
<p>In order to initialize your project, you must create your continuous4r-project.xml file. <br />
|
|
68
|
+
Just type this command and the file will be created :</p>
|
|
69
|
+
<p><pre class='syntax'>rake continuous4r:init</pre></p>
|
|
70
|
+
<p>Here is the content of this file, you can customize it to suite your needs :</p>
|
|
71
|
+
<p><pre class='syntax'><span class="punct"><</span><span class="tag">project</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">FIXME project name</span><span class="punct">"</span> <span class="attribute">auto-install-gems</span><span class="punct">="</span><span class="string">true</span><span class="punct">"</span>
|
|
72
|
+
<span class="attribute">auto-install-tools</span><span class="punct">="</span><span class="string">true</span><span class="punct">"</span> <span class="attribute">ignore-tests-failures</span><span class="punct">="</span><span class="string">true</span><span class="punct">"></span>
|
|
73
|
+
<span class="punct"><</span><span class="tag">description</span><span class="punct">></span>FIXME project description<span class="punct"></</span><span class="tag">description</span><span class="punct">></span>
|
|
74
|
+
<span class="punct"><</span><span class="tag">url</span><span class="punct">></span>FIXME project URL<span class="punct"></</span><span class="tag">url</span><span class="punct">></span>
|
|
75
|
+
<span class="punct"><</span><span class="tag">logo</span><span class="punct">></span>FIXME Logo URL<span class="punct"></</span><span class="tag">logo</span><span class="punct">></span>
|
|
76
|
+
<span class="punct"><</span><span class="tag">company</span><span class="punct">></span>
|
|
77
|
+
<span class="punct"><</span><span class="tag">denomination</span><span class="punct">></span>FIXME your company name here<span class="punct"></</span><span class="tag">denomination</span><span class="punct">></span>
|
|
78
|
+
<span class="punct"><</span><span class="tag">url</span><span class="punct">></span>FIXME your company website URL here<span class="punct"></</span><span class="tag">url</span><span class="punct">></span>
|
|
79
|
+
<span class="punct"><</span><span class="tag">logo</span><span class="punct">></span>FIXME your company logo URL here<span class="punct"></</span><span class="tag">logo</span><span class="punct">></span>
|
|
80
|
+
<span class="punct"></</span><span class="tag">company</span><span class="punct">></span>
|
|
81
|
+
<span class="punct"><</span><span class="tag">members</span><span class="punct">></span>
|
|
82
|
+
<span class="punct"><</span><span class="tag">member</span> <span class="attribute">id</span><span class="punct">="</span><span class="string">FIXME user login</span><span class="punct">"</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">FIXME user name</span><span class="punct">"</span> <span class="attribute">email</span><span class="punct">="</span><span class="string">FIXME user email</span><span class="punct">"</span>
|
|
83
|
+
<span class="attribute">roles</span><span class="punct">="</span><span class="string">FIXME user roles, separated by commas</span><span class="punct">"</span>
|
|
84
|
+
<span class="attribute">company</span><span class="punct">="</span><span class="string">FIXME company/organisation name</span><span class="punct">"/></span>
|
|
85
|
+
<span class="punct"></</span><span class="tag">members</span><span class="punct">></span>
|
|
86
|
+
<span class="punct"><</span><span class="tag">bugtracker</span><span class="punct">></span>
|
|
87
|
+
<span class="punct"><</span><span class="tag">tracker_type</span><span class="punct">></span>[Trac|Bugzilla|Mantis|etc...]<span class="punct"></</span><span class="tag">tracker_type</span><span class="punct">></span>
|
|
88
|
+
<span class="punct"><</span><span class="tag">tracker_url</span><span class="punct">></span>BUGTRACKER_URL<span class="punct"></</span><span class="tag">tracker_url</span><span class="punct">></span>
|
|
89
|
+
<span class="punct"><</span><span class="tag">tracker_account_create</span><span class="punct">></span>BUGTRACKER_URL_ACCOUNT_CREATION<span class="punct"></</span><span class="tag">tracker_account_create</span><span class="punct">></span>
|
|
90
|
+
<span class="punct"><</span><span class="tag">search</span><span class="punct">></span>BUGTRACKER_URL_SEARCH_TICKETS<span class="punct"></</span><span class="tag">search</span><span class="punct">></span>
|
|
91
|
+
<span class="punct"><</span><span class="tag">url</span><span class="punct">></span>BUGTRACKER_URL_TICKETS_LIST<span class="punct"></</span><span class="tag">url</span><span class="punct">></span>
|
|
92
|
+
<span class="punct"><</span><span class="tag">add</span><span class="punct">></span>BUGTRACKER_URL_TICKET_ADD<span class="punct"></</span><span class="tag">add</span><span class="punct">></span>
|
|
93
|
+
<span class="punct"></</span><span class="tag">bugtracker</span><span class="punct">></span>
|
|
94
|
+
<span class="comment"><!-- Gems mandatory for your project --></span>
|
|
95
|
+
<span class="punct"><</span><span class="tag">gems</span> <span class="attribute">repository</span><span class="punct">="</span><span class="string">http://gems.rubyforge.org/gems/</span><span class="punct">"></span>
|
|
96
|
+
<span class="punct"><</span><span class="tag">gem</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">GEM_NAME</span><span class="punct">"</span> <span class="attribute">version</span><span class="punct">="</span><span class="string">GEM_VERSION</span><span class="punct">"/></span>
|
|
97
|
+
<span class="punct"></</span><span class="tag">gems</span><span class="punct">></span>
|
|
98
|
+
<span class="punct"></</span><span class="tag">project</span><span class="punct">></span>
|
|
133
99
|
</pre></p>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span></pre></p>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<p><a href="stats.png" target="_blank">Sample</a></p>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<h3>Dcov task</h3>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<p>Generates a report on the rdoc coverage of your Ruby code. The parts
|
|
157
|
-
which are not covered are colored in red.<br/>
|
|
158
|
-
The <strong>pattern</strong> param enables you to select the Ruby code to control.<br/>
|
|
159
|
-
The <strong>report</strong> param is the path where Continuous4R can find the dcov
|
|
160
|
-
original report (due to a bug in dcov).</p>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">dcov</span><span class="punct">"></span>
|
|
164
|
-
<span class="punct"><</span><span class="tag">description</span><span class="punct">></span>Rdoc coverage analysis report<span class="punct"></</span><span class="tag">description</span><span class="punct">></span>
|
|
165
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
166
|
-
<span class="punct"><</span><span class="tag">pattern</span> <span class="attribute">value</span><span class="punct">="</span><span class="string">app/**/*.rb</span><span class="punct">"/></span>
|
|
167
|
-
<span class="punct"><</span><span class="tag">report</span> <span class="attribute">path</span><span class="punct">="</span><span class="string">coverage.html</span><span class="punct">"/></span>
|
|
168
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
169
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span></pre></p>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
<p><a href="dcov.png" target="_blank">Sample</a></p>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<h3>Rcov task</h3>
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<p>Builds a report on the coverage of your tests over your Ruby code.</p>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">rcov</span><span class="punct">"></span>
|
|
182
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
183
|
-
<span class="comment"><!-- file which loads all the necessary test files (based on requires) --></span>
|
|
184
|
-
<span class="punct"><</span><span class="tag">file</span> <span class="attribute">path</span><span class="punct">="</span><span class="string">test/rcov_test_all.rb</span><span class="punct">"/></span>
|
|
185
|
-
<span class="comment"><!-- path where to find the reports generated by rcov --></span>
|
|
186
|
-
<span class="punct"><</span><span class="tag">reports</span> <span class="attribute">path</span><span class="punct">="</span><span class="string">coverage</span><span class="punct">"/></span>
|
|
187
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
188
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
100
|
+
<h3>Building your project</h3>
|
|
101
|
+
<p>When your project file is suitable, type :</p>
|
|
102
|
+
<p><pre class='syntax'>rake continuous4r:build</pre></p>
|
|
103
|
+
<p>When the build is finished, you can find your site in the RAILS_ROOT/tmp/continuous4r directory.</p>
|
|
104
|
+
<h2>Features</h2>
|
|
105
|
+
<h3>Proxy configuration</h3>
|
|
106
|
+
<p>If you are behind a <span class="caps">HTTP</span> proxy within your company, you can configure it with a simple <span class="caps">YAML</span> file. <br />
|
|
107
|
+
Create a file named proxy.yml within your USER_HOME/.continuous4r directory, with the following content :</p>
|
|
108
|
+
<p><pre class='syntax'><span class="key">proxy</span><span class="punct">:</span>
|
|
109
|
+
<span class="key">server</span><span class="punct">:</span> my.proxy.server
|
|
110
|
+
<span class="key">port</span><span class="punct">:</span> my_port
|
|
111
|
+
<span class="key">login</span><span class="punct">:</span> my_login
|
|
112
|
+
<span class="key">password</span><span class="punct">:</span> my_password
|
|
189
113
|
</pre></p>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
</
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
report of
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
</
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
<p>Railroad is a tool to generate graphs of your models and/or your controllers. This
|
|
257
|
-
task generates your graphs and presents them on a <span class="caps">HTML</span> report. This task is not
|
|
258
|
-
compatible with CruiseControl.rb.</p>
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">railroad</span><span class="punct">"></span>
|
|
262
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
263
|
-
<span class="punct"><</span><span class="tag">generate</span> <span class="attribute">value</span><span class="punct">="</span><span class="string">controllers|models|all</span><span class="punct">"/></span>
|
|
264
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
265
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
266
|
-
</pre></p>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
<h3>Httperf task</h3>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
<p><a href="http://www.hpl.hp.com/research/linux/httperf/" target="_blank">Httperf</a>
|
|
273
|
-
is a <span class="caps">HTTP</span> stress tool which generates text reports for a really important number
|
|
274
|
-
of statistics. This task generates a <span class="caps">HTML</span> report for these statistics.</p>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">httperf</span><span class="punct">"></span>
|
|
278
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
279
|
-
<span class="comment"><!-- set of ports which will match Mongrel instances (all managed within) --></span>
|
|
280
|
-
<span class="punct"><</span><span class="tag">ports</span><span class="punct">></span>
|
|
281
|
-
<span class="punct"><</span><span class="tag">port</span><span class="punct">></span>3334<span class="punct"></</span><span class="tag">port</span><span class="punct">></span>
|
|
282
|
-
<span class="punct"></</span><span class="tag">ports</span><span class="punct">></span>
|
|
283
|
-
<span class="punct"><</span><span class="tag">processes</span><span class="punct">></span>
|
|
284
|
-
<span class="punct"><</span><span class="tag">process</span> <span class="attribute">port</span><span class="punct">="</span><span class="string">3334</span><span class="punct">"</span> <span class="attribute">url</span><span class="punct">="</span><span class="string">/controller/action?param=value</span><span class="punct">"</span>
|
|
285
|
-
<span class="attribute">requests</span><span class="punct">="</span><span class="string">50</span><span class="punct">"</span> <span class="attribute">timeout</span><span class="punct">="</span><span class="string">2</span><span class="punct">"></span>
|
|
286
|
-
<span class="punct"><</span><span class="tag">description</span><span class="punct">></span>Stressing application with 50 requests (URL http://127.0.0.1:3334/controller/action?param=value),
|
|
287
|
-
with a timeout set to 2 seconds.<span class="punct"></</span><span class="tag">description</span><span class="punct">></span>
|
|
288
|
-
<span class="punct"></</span><span class="tag">process</span><span class="punct">></span>
|
|
289
|
-
<span class="punct"><</span><span class="tag">process</span> <span class="attribute">port</span><span class="punct">="</span><span class="string">3334</span><span class="punct">"</span> <span class="attribute">url</span><span class="punct">="</span><span class="string">/controller/action?param=value</span><span class="punct">"</span>
|
|
290
|
-
<span class="attribute">sessions</span><span class="punct">="</span><span class="string">10,5,2</span><span class="punct">"</span> <span class="attribute">rate</span><span class="punct">="</span><span class="string">5</span><span class="punct">"</span> <span class="attribute">timeout</span><span class="punct">="</span><span class="string">3</span><span class="punct">"></span>
|
|
291
|
-
<span class="punct"><</span><span class="tag">description</span><span class="punct">></span>Stressing application with 10 sessions (URL http://127.0.0.1:3334/controller/action?param=value),
|
|
292
|
-
with a rate of 5 sessions per second. Each session consists
|
|
293
|
-
of 5 calls that are spaced out by 2 seconds. Timeout is set to 3 seconds.<span class="punct"></</span><span class="tag">description</span><span class="punct">></span>
|
|
294
|
-
<span class="punct"></</span><span class="tag">process</span><span class="punct">></span>
|
|
295
|
-
<span class="punct"></</span><span class="tag">processes</span><span class="punct">></span>
|
|
296
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
297
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
298
|
-
</pre></p>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
<p><a href="httperf.png" target="_blank">Sample</a></p>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
<h3>Tests task</h3>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
<p>Generates a report for the results of your tests.</p>
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">tests</span><span class="punct">"></span>
|
|
311
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
312
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">type</span><span class="punct">="</span><span class="string">units</span><span class="punct">"/></span><span class="comment"><!-- equivalent to rake test:units --></span>
|
|
313
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">type</span><span class="punct">="</span><span class="string">functionals</span><span class="punct">"/></span><span class="comment"><!-- equivalent to rake test:functionals --></span>
|
|
314
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">type</span><span class="punct">="</span><span class="string">integration</span><span class="punct">"/></span><span class="comment"><!-- equivalent to rake test:integration --></span>
|
|
315
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">type</span><span class="punct">="</span><span class="string">rspec</span><span class="punct">"/></span><span class="comment"><!-- equivalent to rake spec --></span>
|
|
316
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
317
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
318
|
-
</pre></p>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
<p><a href="tests.png" target="_blank">Sample</a></p>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
<h3>ZenTest task</h3>
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
<p>ZenTest is a tool which generates Ruby code to show your test leaks. This task generates
|
|
328
|
-
a report to show where these leaks are.</p>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">zentest</span><span class="punct">"></span>
|
|
332
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
333
|
-
<span class="comment"><!-- runs an analysis of the efficiency/exhaustiveness of the HomeControllerTest
|
|
334
|
-
test class against the HomeController class --></span>
|
|
335
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">class</span><span class="punct">="</span><span class="string">app/controllers/home_controller.rb</span><span class="punct">"</span> <span class="attribute">test</span><span class="punct">="</span><span class="string">test/functional/home_controller_test.rb</span><span class="punct">"/></span>
|
|
336
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
337
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
338
|
-
</pre></p>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
<p><a href="zentest.png" target="_blank">Sample</a></p>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
<h3>Capistrano task</h3>
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<p>Generates reports for you Capistrano deployments.</p>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
<p><pre class='syntax'><span class="punct"><</span><span class="tag">task</span> <span class="attribute">name</span><span class="punct">="</span><span class="string">capistrano</span><span class="punct">"></span>
|
|
351
|
-
<span class="comment"><!-- set of runners for your Capistrano deployments --></span>
|
|
352
|
-
<span class="punct"><</span><span class="tag">params</span><span class="punct">></span>
|
|
353
|
-
<span class="punct"><</span><span class="tag">runner</span> <span class="attribute">task</span><span class="punct">="</span><span class="string">deploy</span><span class="punct">"/></span><span class="comment"><!-- equivalent to 'cap deploy' --></span>
|
|
354
|
-
<span class="punct"></</span><span class="tag">params</span><span class="punct">></span>
|
|
355
|
-
<span class="punct"></</span><span class="tag">task</span><span class="punct">></span>
|
|
356
|
-
</pre></p>
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
<p><a href="capistrano.png" target="_blank">Sample</a></p>
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
<h2>Demonstration of usage</h2>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
<p>When the <span class="caps">XML</span> file describing your project is written, you can build the Continuous4R
|
|
366
|
-
website by typing :</p>
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
<p><pre class='syntax'>rake continuous4r:build</pre></p>
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
<p>Now you can view the website generated for your project by lauching <strong>[project_folder]/continuous4r_build/index.html</strong>.</p>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
<h2>Integration within CruiseControl.rb</h2>
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<p>Integration within CruiseControl.rb is quite simple. You just need to configure your
|
|
379
|
-
project to build task “rake continuous4r:build”. When the build is done, go to the
|
|
380
|
-
detail page of the build, and click on the link below “Custom Build Artifacts”.</p>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
<h2>Help needed</h2>
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
<p>This version 0.0.1 is a beta version of Continuous4r. I’m searching for volunteers
|
|
387
|
-
to work on this tool. With a more substancial amount of quality and work, this tool
|
|
388
|
-
could be <span class="caps">REALLY GREAT</span>.</p>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
<h2>License</h2>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
<h2>Contact</h2>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
<p>Comments are welcome. Send an email to <a href="mailto:duboisv@hotmail.com">Vincent Dubois</a>,
|
|
114
|
+
<p>When you will run the build task, if there is a need for continuous4r to find something on the internet (via Rubygems), it will automatically use this configuration.</p>
|
|
115
|
+
<h3>CruiseControl.rb integration</h3>
|
|
116
|
+
<p>If you heard about Continuous Integration, and are a fan of <a href="http://cruisecontrolrb.thoughtworks.com" target="_blank">CruiseControl.rb</a>, just customize your project to build the ‘continuous4r:build’ Rake task, and a ‘continuous4r’ artifact will appear on your build page.</p>
|
|
117
|
+
<h3>Running tests</h3>
|
|
118
|
+
<p>By default the behaviour of continuous4r is to ignore the fact that there are failures in your tests (because the failures are noticed within the tests report).</p>
|
|
119
|
+
<p>If you want continuous4r to stop on tests failures, then you must set the “ignore-tests-failures” flag to false in your project file.</p>
|
|
120
|
+
<h3>Tasks</h3>
|
|
121
|
+
<p>continuous4r built-in tasks are the core of the gem. They produce reports with some of the best code-related tools for Ruby on Rails. These tasks are described below :</p>
|
|
122
|
+
<h4>dcov</h4>
|
|
123
|
+
<p><a href='http://dcov.rubyforge.org' target='_blank'>Dcov</a> task produces a report related to the coverage of your Ruby documentation (rdoc). If there is a class, a module or a method which is not documented, this task finds it and reports it.</p>
|
|
124
|
+
<p>Screenshot :</p>
|
|
125
|
+
<p><a href='images/dcov.png' target='_blank'><img width='200' height='130' src='images/dcov.png' border='0' /></a></p>
|
|
126
|
+
<h4>rcov</h4>
|
|
127
|
+
<p><a href='http://eigenclass.org/hiki/rcov' target='_blank'>Rcov</a> is a tool which produces a report for the coverage of your Ruby code against you tests.</p>
|
|
128
|
+
<p>Screenshot :</p>
|
|
129
|
+
<p><a href='images/rcov.png' target='_blank'><img width='200' height='150' src='images/rcov.png' border='0' /></a></p>
|
|
130
|
+
<h4>rdoc</h4>
|
|
131
|
+
<p>Produces your project documentation.</p>
|
|
132
|
+
<p><a href='images/rdoc.png' target='_blank'><img width='200' height='80' src='images/rdoc.png' border='0' /></a></p>
|
|
133
|
+
<h4>stats</h4>
|
|
134
|
+
<p>Produces what you get if you run ‘rake stats’, but in <span class="caps">HTML</span> format.</p>
|
|
135
|
+
<p><a href='images/stats.png' target='_blank'><img width='200' height='100' src='images/stats.png' border='0' /></a></p>
|
|
136
|
+
<h4>changelog</h4>
|
|
137
|
+
<p>Produces a <span class="caps">HTML</span> report of your code changes in your favorite source content manager. <a href='http://www.git-scm.com' target='_blank'>Git</a> and <a href='http://subversion.tigris.org' target='_blank'>Subversion</a> are supported.</p>
|
|
138
|
+
<p>Screenshot :</p>
|
|
139
|
+
<p><a href='images/changelog.png' target='_blank'><img width='200' height='80' src='images/changelog.png' border='0' /></a></p>
|
|
140
|
+
<h4>flog</h4>
|
|
141
|
+
<p><a href='http://ruby.sadi.st/Flog.html' target='_blank'>Flog</a> is a tool which measures the complexity of your Ruby code.</p>
|
|
142
|
+
<p>Screenshot :</p>
|
|
143
|
+
<p><a href='images/flog.png' target='_blank'><img width='200' height='150' src='images/flog.png' border='0' /></a></p>
|
|
144
|
+
<h4>xdoclet</h4>
|
|
145
|
+
<p>A task which transforms your Ruby files in <span class="caps">HTML</span> format with syntax highlighting support. This task is used via links in other tasks (look flog screenshot for example).</p>
|
|
146
|
+
<p>Screenshot :</p>
|
|
147
|
+
<p><a href='images/xdoclet.png' target='_blank'><img width='200' height='150' src='images/xdoclet.png' border='0' /></a></p>
|
|
148
|
+
<h4>flay</h4>
|
|
149
|
+
<p><a href='http://ruby.sadi.st/Flay.html' target='_blank'>Flay</a> task finds duplicates in your Ruby code.</p>
|
|
150
|
+
<p>Screenshot :</p>
|
|
151
|
+
<p><a href='images/flay.png' target='_blank'><img width='200' height='150' src='images/flay.png' border='0' /></a></p>
|
|
152
|
+
<h4>reek</h4>
|
|
153
|
+
<p><a href='http://wiki.github.com/kevinrutherford/reek' target='_blank'>Reek</a> is code smell detector for Ruby. If there is something bad in your code, it tells you.</p>
|
|
154
|
+
<p>Screenshot :</p>
|
|
155
|
+
<p><a href='images/reek.png' target='_blank'><img width='200' height='150' src='images/reek.png' border='0' /></a></p>
|
|
156
|
+
<h4>roodi</h4>
|
|
157
|
+
<p><a href='http://roodi.rubyforge.org' target='_blank'>Roodi</a> parses your Ruby code and warns you about design issues.</p>
|
|
158
|
+
<p>Screenshot :</p>
|
|
159
|
+
<p><a href='images/roodi.png' target='_blank'><img width='200' height='150' src='images/roodi.png' border='0' /></a></p>
|
|
160
|
+
<h4>saikuro</h4>
|
|
161
|
+
<p><a href='http://saikuro.rubyforge.org' target='_blank'>Saikuro</a> analyzes the cyclomatic complexity of your Ruby code.</p>
|
|
162
|
+
<p>Screenshot :</p>
|
|
163
|
+
<p><a href='images/saikuro.png' target='_blank'><img width='200' height='150' src='images/saikuro.png' border='0' /></a></p>
|
|
164
|
+
<h4>tests</h4>
|
|
165
|
+
<p>Task to run your tests and make a report with details (type, success/failure, result).</p>
|
|
166
|
+
<p>Screenshot :</p>
|
|
167
|
+
<p><a href='images/tests.png' target='_blank'><img width='200' height='100' src='images/tests.png' border='0' /></a></p>
|
|
168
|
+
<h4>zentest</h4>
|
|
169
|
+
<p><a href='http://zentest.rubyforge.org/ZenTest/' target='_blank'>ZenTest</a> is a test tool. It runs a Ruby file against its test file, and generates a convention-delta report if your tests are not good enough.</p>
|
|
170
|
+
<p>Screenshot :</p>
|
|
171
|
+
<p><a href='images/zentest.png' target='_blank'><img width='200' height='150' src='images/zentest.png' border='0' /></a></p>
|
|
172
|
+
<h2>Help needed</h2>
|
|
173
|
+
<p>This version 0.0.2 has many improvements, but is still a pre-RC version of continuous4r. I’m planning on orienting the gem to collect some statistics about the tasks, and make a global quality report with graphs.<br />
|
|
174
|
+
I’m searching for volunteers to test, or work on this tool. With a more substancial amount of quality and work, this tool will be really great.</p>
|
|
175
|
+
<h2>License</h2>
|
|
176
|
+
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
|
|
177
|
+
<h2>Contact</h2>
|
|
178
|
+
<p>Comments are welcome. Send an email to <a href="mailto:duboisv@hotmail.com">Vincent Dubois</a>,<br />
|
|
401
179
|
or post a message on the <a href="http://rubyforge.org/forum/forum.php?forum_id=19721" target="_blank">forum</a>.</p>
|
|
402
180
|
<p class="coda">
|
|
403
|
-
<a href="duboisv@hotmail.com">Vincent Dubois</a>,
|
|
404
|
-
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
|
181
|
+
<a href="mailto:duboisv@hotmail.com">Vincent Dubois</a>, 24th February 2009<br>
|
|
182
|
+
Theme extended from <a href="http://rb2js.rubyforge.org/" target="_blank">Paul Battley</a>
|
|
405
183
|
</p>
|
|
406
184
|
</div>
|
|
407
185
|
|