crazy_ivan 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/crazy_ivan +43 -3
- data/lib/crazy_ivan/templates/css/ci.css +3 -3
- data/lib/crazy_ivan/templates/index.html +21 -19
- data/lib/crazy_ivan/test_runner.rb +0 -2
- data/lib/crazy_ivan/version.rb +1 -1
- data/lib/crazy_ivan.rb +5 -1
- metadata +4 -10
- data/.gitignore +0 -7
- data/Rakefile +0 -76
- data/TODO +0 -39
- data/crazy_ivan.gemspec +0 -247
- data/test/crazy_ivan_test.rb +0 -159
- data/test/test_helper.rb +0 -16
data/bin/crazy_ivan
CHANGED
@@ -13,7 +13,15 @@ end
|
|
13
13
|
require "optparse"
|
14
14
|
require "logger"
|
15
15
|
|
16
|
-
|
16
|
+
Syslog.open('crazy_ivan', Syslog::LOG_PID | Syslog::LOG_CONS)
|
17
|
+
|
18
|
+
Signal.trap("INT") do
|
19
|
+
Syslog.debug("Interrupted - Now dropping a note in the test output and exiting.")
|
20
|
+
CrazyIvan.interrupt_test
|
21
|
+
CrazyIvan::ProcessManager.unlock
|
22
|
+
puts
|
23
|
+
exit
|
24
|
+
end
|
17
25
|
|
18
26
|
def show_howto
|
19
27
|
puts "Hankering for a continuous integration server, eh?"
|
@@ -44,6 +52,35 @@ end
|
|
44
52
|
|
45
53
|
options = {}
|
46
54
|
|
55
|
+
|
56
|
+
class CrazyIvan::ProcessManager
|
57
|
+
PidFile = '/tmp/crazy_ivan.pid'
|
58
|
+
|
59
|
+
def self.acquire_lock
|
60
|
+
lock_exclusively!
|
61
|
+
yield
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.unlock
|
65
|
+
File.new(PidFile).flock(File::LOCK_UN)
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.ci_already_running?
|
69
|
+
File.exists?(PidFile) && !File.new(PidFile).flock(File::LOCK_EX | File::LOCK_NB)
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.lock_exclusively!
|
73
|
+
pid = Integer(File.read(PidFile)) if File.exists?(PidFile)
|
74
|
+
File.open('/tmp/crazy_ivan.pid', "w+") { |fp| fp << Process.pid }
|
75
|
+
|
76
|
+
if ci_already_running?
|
77
|
+
Process.kill("INT", pid)
|
78
|
+
Syslog.debug("Detected another running CI process #{pid}; interrupting it and starting myself")
|
79
|
+
File.new(PidFile).flock(File::LOCK_EX)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
47
84
|
ARGV.options do |opts|
|
48
85
|
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} test_reports_path"
|
49
86
|
|
@@ -60,15 +97,18 @@ ARGV.options do |opts|
|
|
60
97
|
|
61
98
|
begin
|
62
99
|
opts.parse!
|
63
|
-
|
100
|
+
|
64
101
|
case ARGV[0]
|
65
102
|
when /setup/
|
66
103
|
CrazyIvan::setup
|
67
104
|
when /\w+/ # a directory for test results
|
68
|
-
CrazyIvan::
|
105
|
+
CrazyIvan::ProcessManager.acquire_lock do
|
106
|
+
CrazyIvan::generate_test_reports_in(ARGV[0])
|
107
|
+
end
|
69
108
|
else
|
70
109
|
show_howto
|
71
110
|
exit
|
72
111
|
end
|
73
112
|
end
|
74
113
|
end
|
114
|
+
|
@@ -20,11 +20,11 @@ pre { margin: 0;}
|
|
20
20
|
.tests .test { font-size: 80%; margin-right: 8px;}
|
21
21
|
.tests .latest { font-size: 100%;}
|
22
22
|
|
23
|
-
.results .result { margin: 12px 18px 8px 18px;}
|
24
23
|
.results .result .timestamp { margin-right: 12px;}
|
25
24
|
.results .result .version { margin: 6px 0 6px 12px }
|
26
|
-
.results .result .
|
27
|
-
.results .result .
|
25
|
+
.results .result .output { padding: 5px; color: silver; background:black; margin: 12px 18px 8px 18px;}
|
26
|
+
.results .result .output .update { margin: 6px 0 6px 12px }
|
27
|
+
.results .result .output .test { margin: 6px 0 6px 12px }
|
28
28
|
|
29
29
|
.footer {
|
30
30
|
margin: 24px 0 0 0;
|
@@ -110,30 +110,32 @@
|
|
110
110
|
<span class='version'>{version.output}</span> \
|
111
111
|
</div> \
|
112
112
|
\
|
113
|
-
|
114
|
-
{.section
|
115
|
-
<div class='version'> \
|
116
|
-
<pre class='error'>{error}</pre> \
|
117
|
-
</div> \
|
118
|
-
{.end} \
|
119
|
-
{.end} \
|
120
|
-
\
|
121
|
-
<div class='update'> \
|
122
|
-
<pre>{update.output}</pre> \
|
123
|
-
{.section update} \
|
113
|
+
<div class='output'> \
|
114
|
+
{.section version} \
|
124
115
|
{.section exit_status} \
|
125
|
-
<
|
116
|
+
<div class='version'> \
|
117
|
+
<pre class='error'>{error}</pre> \
|
118
|
+
</div> \
|
126
119
|
{.end} \
|
127
120
|
{.end} \
|
128
|
-
</div> \
|
129
121
|
\
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
122
|
+
<div class='update'> \
|
123
|
+
<pre>{update.output}</pre> \
|
124
|
+
{.section update} \
|
125
|
+
{.section exit_status} \
|
126
|
+
<pre class='error'>{update.error}</pre> \
|
127
|
+
{.end} \
|
135
128
|
{.end} \
|
136
|
-
|
129
|
+
</div> \
|
130
|
+
\
|
131
|
+
<div class='test'> \
|
132
|
+
<pre>{test.output}</pre> \
|
133
|
+
{.section test} \
|
134
|
+
{.section exit_status} \
|
135
|
+
<pre class='error'>{test.error}</pre> \
|
136
|
+
{.end} \
|
137
|
+
{.end} \
|
138
|
+
</div> \
|
137
139
|
</div> \
|
138
140
|
</div> \
|
139
141
|
{.end} \
|
data/lib/crazy_ivan/version.rb
CHANGED
data/lib/crazy_ivan.rb
CHANGED
@@ -113,7 +113,7 @@ module CrazyIvan
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def self.generate_test_reports_in(output_directory)
|
116
|
-
Syslog.open('crazy_ivan', Syslog::LOG_PID | Syslog::LOG_CONS)
|
116
|
+
Syslog.open('crazy_ivan', Syslog::LOG_PID | Syslog::LOG_CONS) unless Syslog.opened?
|
117
117
|
FileUtils.mkdir_p(output_directory)
|
118
118
|
|
119
119
|
report = ReportAssembler.new(Dir.pwd, output_directory)
|
@@ -126,4 +126,8 @@ module CrazyIvan
|
|
126
126
|
ensure
|
127
127
|
Syslog.close
|
128
128
|
end
|
129
|
+
|
130
|
+
def self.interrupt_test
|
131
|
+
# TODO add a message to the running report generator about the test being interrupted and clear the building json
|
132
|
+
end
|
129
133
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crazy_ivan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edward Ocampo-Gooding
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-12 00:00:00 -05:00
|
13
13
|
default_executable: crazy_ivan
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -50,8 +50,8 @@ extensions: []
|
|
50
50
|
extra_rdoc_files: []
|
51
51
|
|
52
52
|
files:
|
53
|
-
-
|
54
|
-
-
|
53
|
+
- bin/crazy_ivan
|
54
|
+
- bin/test_report2campfire
|
55
55
|
- lib/crazy_ivan/html_asset_crush.rb
|
56
56
|
- lib/crazy_ivan/report_assembler.rb
|
57
57
|
- lib/crazy_ivan/templates/css/ci.css
|
@@ -208,14 +208,8 @@ files:
|
|
208
208
|
- lib/crazy_ivan/vendor/tmpdir.rb
|
209
209
|
- lib/crazy_ivan/version.rb
|
210
210
|
- lib/crazy_ivan.rb
|
211
|
-
- bin/crazy_ivan
|
212
|
-
- bin/test_report2campfire
|
213
211
|
- LICENSE
|
214
|
-
- Rakefile
|
215
212
|
- README.rdoc
|
216
|
-
- TODO
|
217
|
-
- test/crazy_ivan_test.rb
|
218
|
-
- test/test_helper.rb
|
219
213
|
has_rdoc: false
|
220
214
|
homepage: http://github.com/edward/crazy_ivan
|
221
215
|
licenses: []
|
data/.gitignore
DELETED
data/Rakefile
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/clean'
|
3
|
-
require 'rake/gempackagetask'
|
4
|
-
require 'rake/testtask'
|
5
|
-
require 'fileutils'
|
6
|
-
|
7
|
-
$LOAD_PATH << 'lib'
|
8
|
-
require 'crazy_ivan'
|
9
|
-
|
10
|
-
include FileUtils
|
11
|
-
|
12
|
-
version = CrazyIvan::VERSION
|
13
|
-
name = "crazy_ivan"
|
14
|
-
|
15
|
-
spec = Gem::Specification.new do |s|
|
16
|
-
s.name = name
|
17
|
-
s.version = version
|
18
|
-
s.summary = 'Crazy Ivan (CI) is simplest possible continuous integration tool.'
|
19
|
-
s.description = "Continuous integration should really just be a script that captures the output of running your project update & test commands and presents recent results in a static html page.
|
20
|
-
|
21
|
-
By keeping test reports in json, per-project CI configuration in 3 probably-one-line scripts, things are kept simple, quick, and super extensible.
|
22
|
-
|
23
|
-
Want to use git, svn, or hg? No problem.
|
24
|
-
Need to fire off results to Campfire? It's built-in.
|
25
|
-
|
26
|
-
CI depends on cron."
|
27
|
-
s.authors = "Edward Ocampo-Gooding"
|
28
|
-
|
29
|
-
s.email = 'edward@edwardog.net'
|
30
|
-
s.homepage = "http://github.com/edward/crazy_ivan"
|
31
|
-
s.executables = ["crazy_ivan", "test_report2campfire"]
|
32
|
-
s.default_executable = "crazy_ivan"
|
33
|
-
s.rubyforge_project = "crazy_ivan"
|
34
|
-
|
35
|
-
s.platform = Gem::Platform::RUBY
|
36
|
-
s.has_rdoc = false
|
37
|
-
|
38
|
-
# s.files = Dir.glob("{bin,lib}/**/*")
|
39
|
-
s.files = FileList['.gitignore', '*.gemspec', 'lib/**/*', 'bin/*', 'templates/**/*', '[A-Z]*', 'test/**/*'].to_a
|
40
|
-
|
41
|
-
s.require_path = "lib"
|
42
|
-
s.bindir = "bin"
|
43
|
-
|
44
|
-
s.add_development_dependency('gemcutter', '>= 0.2.1')
|
45
|
-
s.add_development_dependency('mocha')
|
46
|
-
|
47
|
-
readme = File.read('README.rdoc')
|
48
|
-
s.post_install_message = '\n' + readme[0...readme.index('== How this works')]
|
49
|
-
end
|
50
|
-
|
51
|
-
Rake::GemPackageTask.new(spec) do |p|
|
52
|
-
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
53
|
-
end
|
54
|
-
|
55
|
-
desc "Install #{name} gem (#{version})"
|
56
|
-
task :install => [ :test, :package ] do
|
57
|
-
sh %{gem install pkg/#{name}-#{version}.gem --no-rdoc --no-ri}
|
58
|
-
end
|
59
|
-
|
60
|
-
desc "Uninstall #{name} gem"
|
61
|
-
task :uninstall => [ :clean ] do
|
62
|
-
sh %{gem uninstall #{name}}
|
63
|
-
end
|
64
|
-
|
65
|
-
desc "Release #{name} gem (#{version})"
|
66
|
-
task :release => [ :test, :package ] do
|
67
|
-
sh %{gem push pkg/#{name}-#{version}.gem}
|
68
|
-
end
|
69
|
-
|
70
|
-
task :default => :test
|
71
|
-
|
72
|
-
Rake::TestTask.new(:test) do |test|
|
73
|
-
test.libs << 'lib' << 'test'
|
74
|
-
test.pattern = 'test/**/*_test.rb'
|
75
|
-
test.verbose = true
|
76
|
-
end
|
data/TODO
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
* When the .ci directory scripts are missing, prompt with a
|
2
|
-
|
3
|
-
Create update script? [Y]/n?
|
4
|
-
|
5
|
-
then ask them about the git or svn repository. Do a friendly wizard thing with nice colours.
|
6
|
-
This should be as nice as Phusion’s thing.
|
7
|
-
|
8
|
-
* TestRunner#run_script should warn or complain on empty scripts or on scripts that do not return output
|
9
|
-
|
10
|
-
* Think about using popen4 instead (fixes exit status code issue with popen3)
|
11
|
-
|
12
|
-
* What about making all setup just be:
|
13
|
-
|
14
|
-
$ ci install [/var/continuous-integration]
|
15
|
-
# Defaults to creating ^^^ and prompting for each project somehow
|
16
|
-
|
17
|
-
* Needs more logging; should log to system when running each project
|
18
|
-
|
19
|
-
* Add a 'periscope' web-hook with rack to run tests.
|
20
|
-
|
21
|
-
* Come up with a better executable name ("ci" is taken by RCS)
|
22
|
-
|
23
|
-
* Come up with a better way of making the scripts executable other than just chmod-755-ing them.
|
24
|
-
|
25
|
-
* Come up with a better way of dealing with the filename length issue. (Having to truncate at 240 chars right now.)
|
26
|
-
|
27
|
-
* Create example script templates for popular version control systems
|
28
|
-
|
29
|
-
* Add functionality to detect new test runs and update index.html in-browser (have a poll every 30 seconds or something on projects.json and recents.json)
|
30
|
-
|
31
|
-
* Use datejs to parse the timestamp to easily produce deltas (i.e. "Last test ran 2 days ago")
|
32
|
-
|
33
|
-
* Do something like use a file-lock to prevent overlapping runs and notify in the index.html that it's happening
|
34
|
-
|
35
|
-
* Write a man page with Ron: http://github.com/rtomayko/ron
|
36
|
-
|
37
|
-
* Refactor and document Syslog to have method names that actually match the syslog levels (like #error instead of #err )
|
38
|
-
|
39
|
-
* Don't overwrite existing config files and warn when skipping
|
data/crazy_ivan.gemspec
DELETED
@@ -1,247 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{crazy_ivan}
|
8
|
-
s.version = "1.0.0"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Edward Ocampo-Gooding"]
|
12
|
-
s.date = %q{2010-01-11}
|
13
|
-
s.default_executable = %q{crazy_ivan}
|
14
|
-
s.description = %q{Continuous integration should really just be a script that captures the output of running your project update & test commands and presents recent results in a static html page.
|
15
|
-
|
16
|
-
By keeping test reports in json, per-project CI configuration in 3 probably-one-line scripts, things are kept simple, quick, and super extensible.
|
17
|
-
|
18
|
-
Want to use git, svn, or hg? No problem.
|
19
|
-
Need to fire off results to Campfire? It's built-in.
|
20
|
-
|
21
|
-
CI depends on cron.}
|
22
|
-
s.email = %q{edward@edwardog.net}
|
23
|
-
s.executables = ["crazy_ivan", "test_report2campfire"]
|
24
|
-
s.extra_rdoc_files = [
|
25
|
-
"LICENSE",
|
26
|
-
"README.rdoc",
|
27
|
-
"TODO"
|
28
|
-
]
|
29
|
-
s.files = [
|
30
|
-
".gitignore",
|
31
|
-
"LICENSE",
|
32
|
-
"README.rdoc",
|
33
|
-
"Rakefile",
|
34
|
-
"TODO",
|
35
|
-
"VERSION",
|
36
|
-
"bin/crazy_ivan",
|
37
|
-
"bin/test_report2campfire",
|
38
|
-
"crazy_ivan.gemspec",
|
39
|
-
"lib/crazy_ivan.rb",
|
40
|
-
"lib/crazy_ivan/html_asset_crush.rb",
|
41
|
-
"lib/crazy_ivan/report_assembler.rb",
|
42
|
-
"lib/crazy_ivan/test_runner.rb",
|
43
|
-
"lib/crazy_ivan/vendor/json-1.1.7/CHANGES",
|
44
|
-
"lib/crazy_ivan/vendor/json-1.1.7/GPL",
|
45
|
-
"lib/crazy_ivan/vendor/json-1.1.7/README",
|
46
|
-
"lib/crazy_ivan/vendor/json-1.1.7/RUBY",
|
47
|
-
"lib/crazy_ivan/vendor/json-1.1.7/Rakefile",
|
48
|
-
"lib/crazy_ivan/vendor/json-1.1.7/TODO",
|
49
|
-
"lib/crazy_ivan/vendor/json-1.1.7/VERSION",
|
50
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log",
|
51
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat",
|
52
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat",
|
53
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat",
|
54
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat",
|
55
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat",
|
56
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat",
|
57
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log",
|
58
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat",
|
59
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat",
|
60
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat",
|
61
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat",
|
62
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat",
|
63
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat",
|
64
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log",
|
65
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat",
|
66
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat",
|
67
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log",
|
68
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log",
|
69
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat",
|
70
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat",
|
71
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log",
|
72
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat",
|
73
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat",
|
74
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log",
|
75
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat",
|
76
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat",
|
77
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log",
|
78
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat",
|
79
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat",
|
80
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log",
|
81
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/generator_benchmark.rb",
|
82
|
-
"lib/crazy_ivan/vendor/json-1.1.7/benchmarks/parser_benchmark.rb",
|
83
|
-
"lib/crazy_ivan/vendor/json-1.1.7/bin/edit_json.rb",
|
84
|
-
"lib/crazy_ivan/vendor/json-1.1.7/bin/prettify_json.rb",
|
85
|
-
"lib/crazy_ivan/vendor/json-1.1.7/data/example.json",
|
86
|
-
"lib/crazy_ivan/vendor/json-1.1.7/data/index.html",
|
87
|
-
"lib/crazy_ivan/vendor/json-1.1.7/data/prototype.js",
|
88
|
-
"lib/crazy_ivan/vendor/json-1.1.7/doc-templates/main.txt",
|
89
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/generator/extconf.rb",
|
90
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/generator/generator.c",
|
91
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/generator/unicode.c",
|
92
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/generator/unicode.h",
|
93
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/parser/extconf.rb",
|
94
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/parser/parser.c",
|
95
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/parser/parser.rl",
|
96
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/parser/unicode.c",
|
97
|
-
"lib/crazy_ivan/vendor/json-1.1.7/ext/json/ext/parser/unicode.h",
|
98
|
-
"lib/crazy_ivan/vendor/json-1.1.7/install.rb",
|
99
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json.rb",
|
100
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/Array.xpm",
|
101
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/FalseClass.xpm",
|
102
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/Hash.xpm",
|
103
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/Key.xpm",
|
104
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/NilClass.xpm",
|
105
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/Numeric.xpm",
|
106
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/String.xpm",
|
107
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/TrueClass.xpm",
|
108
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/add/core.rb",
|
109
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/add/rails.rb",
|
110
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/common.rb",
|
111
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/editor.rb",
|
112
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/ext.rb",
|
113
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/json.xpm",
|
114
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/pure.rb",
|
115
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/pure/generator.rb",
|
116
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/pure/parser.rb",
|
117
|
-
"lib/crazy_ivan/vendor/json-1.1.7/lib/json/version.rb",
|
118
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail1.json",
|
119
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail10.json",
|
120
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail11.json",
|
121
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail12.json",
|
122
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail13.json",
|
123
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail14.json",
|
124
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail18.json",
|
125
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail19.json",
|
126
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail2.json",
|
127
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail20.json",
|
128
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail21.json",
|
129
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail22.json",
|
130
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail23.json",
|
131
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail24.json",
|
132
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail25.json",
|
133
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail27.json",
|
134
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail28.json",
|
135
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail3.json",
|
136
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail4.json",
|
137
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail5.json",
|
138
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail6.json",
|
139
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail7.json",
|
140
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail8.json",
|
141
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/fail9.json",
|
142
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass1.json",
|
143
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass15.json",
|
144
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass16.json",
|
145
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass17.json",
|
146
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass2.json",
|
147
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass26.json",
|
148
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/fixtures/pass3.json",
|
149
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json.rb",
|
150
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json_addition.rb",
|
151
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json_fixtures.rb",
|
152
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json_generate.rb",
|
153
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json_rails.rb",
|
154
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tests/test_json_unicode.rb",
|
155
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tools/fuzz.rb",
|
156
|
-
"lib/crazy_ivan/vendor/json-1.1.7/tools/server.rb",
|
157
|
-
"lib/crazy_ivan/vendor/json.rb",
|
158
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/README",
|
159
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/README.erb",
|
160
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/Rakefile",
|
161
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/lib/open4.rb",
|
162
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/open4.gemspec",
|
163
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/bg.rb",
|
164
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/block.rb",
|
165
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/exception.rb",
|
166
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/simple.rb",
|
167
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/spawn.rb",
|
168
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/stdin_timeout.rb",
|
169
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/samples/timeout.rb",
|
170
|
-
"lib/crazy_ivan/vendor/open4-1.0.1/white_box/leak.rb",
|
171
|
-
"lib/crazy_ivan/vendor/open4.rb",
|
172
|
-
"lib/crazy_ivan/version.rb",
|
173
|
-
"templates/css/ci.css",
|
174
|
-
"templates/index.html",
|
175
|
-
"templates/javascript/builder.js",
|
176
|
-
"templates/javascript/controls.js",
|
177
|
-
"templates/javascript/date.js",
|
178
|
-
"templates/javascript/dragdrop.js",
|
179
|
-
"templates/javascript/effects.js",
|
180
|
-
"templates/javascript/json-template.js",
|
181
|
-
"templates/javascript/prototype.js",
|
182
|
-
"templates/javascript/scriptaculous.js",
|
183
|
-
"templates/javascript/slider.js",
|
184
|
-
"test/crazy_ivan_test.rb",
|
185
|
-
"test/test_helper.rb"
|
186
|
-
]
|
187
|
-
s.homepage = %q{http://github.com/edward/crazy_ivan}
|
188
|
-
s.post_install_message = %q{= Crazy Ivan
|
189
|
-
|
190
|
-
Crazy Ivan (CI) is simplest possible continuous integration tool.
|
191
|
-
|
192
|
-
== Usage
|
193
|
-
|
194
|
-
Create a directory where your projects will live
|
195
|
-
$ mkdir /var/continuous-integration
|
196
|
-
|
197
|
-
Place some project(s) in that directory
|
198
|
-
$ cd /var/continuous-integration
|
199
|
-
$ git clone git://github.com/edward/active_merchant.git
|
200
|
-
|
201
|
-
Set up continuous integration for each project
|
202
|
-
$ crazy_ivan setup # creates example ci scripts in
|
203
|
-
# each project (see How this works)
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
$ crazy_ivan setup # creates the ci directory, and
|
208
|
-
# creates a configuration file,
|
209
|
-
# sets a cron job to run crazy_ivan
|
210
|
-
|
211
|
-
Manually run it once to check everything is ok
|
212
|
-
$ cd /var/continuous-integration
|
213
|
-
$ crazy_ivan /var/www/ci # the test reports path should be
|
214
|
-
# accessible via your web server
|
215
|
-
|
216
|
-
$ open /var/www/ci/index.html # or check it through your browser
|
217
|
-
|
218
|
-
Set a cron job to run it every 15 minutes
|
219
|
-
$ echo "0,15,30,45 * * * * cd /var/continuous-integration; crazy_ivan /var/www/ci" > ci.cron
|
220
|
-
$ crontab ci.cron
|
221
|
-
|
222
|
-
Note that you don’t want this running too frequently; having overlapping
|
223
|
-
runs is possible and would be bad.
|
224
|
-
|
225
|
-
(Functionality to have this run as a web-hook is planned.)
|
226
|
-
|
227
|
-
}
|
228
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
229
|
-
s.require_paths = ["lib"]
|
230
|
-
s.rubygems_version = %q{1.3.5}
|
231
|
-
s.summary = %q{Crazy Ivan (CI) is simplest possible continuous integration tool.}
|
232
|
-
s.test_files = [
|
233
|
-
"test/crazy_ivan_test.rb",
|
234
|
-
"test/test_helper.rb"
|
235
|
-
]
|
236
|
-
|
237
|
-
if s.respond_to? :specification_version then
|
238
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
239
|
-
s.specification_version = 3
|
240
|
-
|
241
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
242
|
-
else
|
243
|
-
end
|
244
|
-
else
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
data/test/crazy_ivan_test.rb
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'tmpdir'
|
3
|
-
|
4
|
-
class CrazyIvanTest < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@results = {:project_name => 'some-project',
|
7
|
-
:version => {:output => 'a-valid-version', :error => '', :exit_status => '0'},
|
8
|
-
:update => {:output => 'Updated successfully', :error => '', :exit_status => '0'},
|
9
|
-
:test => {:output => 'Some valid test results. No fails.', :error => '', :exit_status => '0'},
|
10
|
-
:timestamp => {:start => Time.now, :finish => nil}}
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_setup
|
14
|
-
setup_crazy_ivan do
|
15
|
-
assert File.exists?('projects/some-project/.ci/update')
|
16
|
-
assert File.exists?('projects/some-project/.ci/version')
|
17
|
-
assert File.exists?('projects/some-project/.ci/test')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_runner
|
22
|
-
setup_external_scripts_to_all_be_successful
|
23
|
-
|
24
|
-
setup_crazy_ivan do
|
25
|
-
run_crazy_ivan
|
26
|
-
|
27
|
-
assert File.exists?('test-results/index.html')
|
28
|
-
assert File.exists?('test-results/projects.json')
|
29
|
-
assert File.exists?('test-results/some-project/recent.json')
|
30
|
-
assert File.exists?('test-results/some-project/currently_building.json')
|
31
|
-
|
32
|
-
projects = JSON.parse(File.open('test-results/projects.json').read)["projects"]
|
33
|
-
recent_versions = JSON.parse(File.open('test-results/some-project/recent.json').read)["recent_versions"]
|
34
|
-
|
35
|
-
assert_equal 2, projects.size
|
36
|
-
assert projects.include?('some-project')
|
37
|
-
assert_equal 'a-valid-version', recent_versions.first
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# FIX Does this test really work? Doesn't look like it
|
42
|
-
def test_external_scripts_not_overwritten
|
43
|
-
setup_external_scripts_to_all_be_successful
|
44
|
-
|
45
|
-
setup_crazy_ivan do
|
46
|
-
File.open('projects/some-project/.ci/version', 'a') do |file|
|
47
|
-
file << "a change to the script"
|
48
|
-
end
|
49
|
-
|
50
|
-
FileUtils.copy('projects/some-project/.ci/version', 'projects/some-project/.ci/version_original')
|
51
|
-
|
52
|
-
do_silently { CrazyIvan.setup }
|
53
|
-
assert FileUtils.compare_file('projects/some-project/.ci/version_original', 'projects/some-project/.ci/version')
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_nil_reports_not_created
|
58
|
-
Open4.stubs(:popen4).with('.ci/update').yields(stub(),
|
59
|
-
stub(:close),
|
60
|
-
stub(:read => @results[:update][:output]),
|
61
|
-
stub(:read => @results[:update][:error])).returns(stub(:exitstatus => '0'))
|
62
|
-
Open4.stubs(:popen4).with('.ci/version').yields(stub(),
|
63
|
-
stub(:close),
|
64
|
-
stub(:read => ''),
|
65
|
-
stub(:read => 'could not find the command you were looking for')).returns(stub(:exitstatus => '1'))
|
66
|
-
Open4.stubs(:popen4).with('.ci/conclusion').yields(stub(),
|
67
|
-
stub(:puts => true, :close => true),
|
68
|
-
stub(),
|
69
|
-
stub(:read => '')).returns(stub(:exitstatus => '0'))
|
70
|
-
|
71
|
-
setup_crazy_ivan do
|
72
|
-
Dir.chdir('projects') do
|
73
|
-
do_silently { CrazyIvan.generate_test_reports_in('../test-results') }
|
74
|
-
end
|
75
|
-
|
76
|
-
assert !File.exists?('test-results/some-project/nil.json')
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def test_conclusion_executed
|
81
|
-
Open4.stubs(:popen4).with('.ci/update').yields(stub(),
|
82
|
-
stub(:close),
|
83
|
-
stub(:read => @results[:update][:output]),
|
84
|
-
stub(:read => @results[:update][:error])).returns(stub(:exitstatus => '0'))
|
85
|
-
Open4.stubs(:popen4).with('.ci/version').yields(stub(),
|
86
|
-
stub(:close),
|
87
|
-
stub(:read => @results[:version][:output]),
|
88
|
-
stub(:read => @results[:version][:error])).returns(stub(:exitstatus => '0'))
|
89
|
-
Open4.stubs(:popen4).with('.ci/test').yields(stub(),
|
90
|
-
stub(:close),
|
91
|
-
stub(:read => @results[:test][:output]),
|
92
|
-
stub(:read => @results[:test][:error])).returns(stub(:exitstatus => '0'))
|
93
|
-
|
94
|
-
@results[:timestamp][:start] = Time.now
|
95
|
-
@results[:timestamp][:finish] = @results[:timestamp][:start]
|
96
|
-
Time.stubs(:now => @results[:timestamp][:start])
|
97
|
-
|
98
|
-
fake_stdin = mock()
|
99
|
-
|
100
|
-
fake_stdin.expects(:puts).with(@results.to_json).at_least_once
|
101
|
-
fake_stdin.expects(:close)
|
102
|
-
|
103
|
-
Open4.stubs(:popen4).with('.ci/conclusion').yields(stub(), fake_stdin, stub(), stub(:read => '')).returns(stub(:exitstatus => '0'))
|
104
|
-
|
105
|
-
setup_crazy_ivan(false) do
|
106
|
-
run_crazy_ivan
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
# def test_report_in_progress_json_created
|
111
|
-
# setup_crazy_ivan do
|
112
|
-
# run_crazy_ivan
|
113
|
-
# end
|
114
|
-
# end
|
115
|
-
|
116
|
-
private
|
117
|
-
|
118
|
-
def setup_crazy_ivan(with_multiple_projects = true)
|
119
|
-
Dir.mktmpdir('continuous-integration') do |tmpdir|
|
120
|
-
Dir.chdir(tmpdir)
|
121
|
-
|
122
|
-
Dir.mkdir('projects')
|
123
|
-
Dir.chdir('projects') do |projects_dir|
|
124
|
-
Dir.mkdir('some-project')
|
125
|
-
Dir.mkdir('some-other-project') if with_multiple_projects
|
126
|
-
do_silently { CrazyIvan.setup }
|
127
|
-
end
|
128
|
-
|
129
|
-
yield
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
def run_crazy_ivan
|
134
|
-
# crazy_ivan runs from the projects directory
|
135
|
-
Dir.chdir('projects') do
|
136
|
-
do_silently { CrazyIvan.generate_test_reports_in('../test-results') }
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
def setup_external_scripts_to_all_be_successful
|
141
|
-
Open4.stubs(:popen4).with('.ci/update').yields(stub(),
|
142
|
-
stub(:close),
|
143
|
-
stub(:read => @results[:update][:output]),
|
144
|
-
stub(:read => @results[:update][:error])).returns(stub(:exitstatus => '0'))
|
145
|
-
Open4.stubs(:popen4).with('.ci/version').yields(stub(),
|
146
|
-
stub(:close),
|
147
|
-
stub(:read => @results[:version][:output]),
|
148
|
-
stub(:read => @results[:version][:error])).returns(stub(:exitstatus => '0'))
|
149
|
-
Open4.stubs(:popen4).with('.ci/test').yields(stub(),
|
150
|
-
stub(:close),
|
151
|
-
stub(:read => @results[:test][:output]),
|
152
|
-
stub(:read => @results[:test][:error])).returns(stub(:exitstatus => '0'))
|
153
|
-
|
154
|
-
Open4.stubs(:popen4).with('.ci/conclusion').yields(stub(),
|
155
|
-
stub(:puts => true, :close => true),
|
156
|
-
stub(),
|
157
|
-
stub(:read => '')).returns(stub(:exitstatus => '0'))
|
158
|
-
end
|
159
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'test/unit'
|
3
|
-
require 'mocha'
|
4
|
-
|
5
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
6
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
7
|
-
require 'crazy_ivan'
|
8
|
-
|
9
|
-
class Test::Unit::TestCase
|
10
|
-
def do_silently
|
11
|
-
orig_stdout = $stdout
|
12
|
-
$stdout = File.new('/dev/null', 'w')
|
13
|
-
yield
|
14
|
-
$stdout = orig_stdout
|
15
|
-
end
|
16
|
-
end
|