nulogy-hydra 0.23.2.1

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.
Files changed (75) hide show
  1. data/.document +5 -0
  2. data/LICENSE +20 -0
  3. data/README.rdoc +39 -0
  4. data/Rakefile +56 -0
  5. data/TODO +18 -0
  6. data/VERSION +1 -0
  7. data/caliper.yml +6 -0
  8. data/hydra-icon-64x64.png +0 -0
  9. data/hydra.gemspec +131 -0
  10. data/hydra_gray.png +0 -0
  11. data/lib/hydra/cucumber/formatter.rb +29 -0
  12. data/lib/hydra/hash.rb +16 -0
  13. data/lib/hydra/js/lint.js +5150 -0
  14. data/lib/hydra/listener/abstract.rb +39 -0
  15. data/lib/hydra/listener/minimal_output.rb +24 -0
  16. data/lib/hydra/listener/notifier.rb +17 -0
  17. data/lib/hydra/listener/progress_bar.rb +48 -0
  18. data/lib/hydra/listener/report_generator.rb +31 -0
  19. data/lib/hydra/master.rb +252 -0
  20. data/lib/hydra/message/master_messages.rb +19 -0
  21. data/lib/hydra/message/runner_messages.rb +46 -0
  22. data/lib/hydra/message/worker_messages.rb +52 -0
  23. data/lib/hydra/message.rb +47 -0
  24. data/lib/hydra/messaging_io.rb +49 -0
  25. data/lib/hydra/pipe.rb +61 -0
  26. data/lib/hydra/proxy_config.rb +27 -0
  27. data/lib/hydra/runner.rb +306 -0
  28. data/lib/hydra/runner_listener/abstract.rb +23 -0
  29. data/lib/hydra/safe_fork.rb +31 -0
  30. data/lib/hydra/spec/autorun_override.rb +3 -0
  31. data/lib/hydra/spec/hydra_formatter.rb +26 -0
  32. data/lib/hydra/ssh.rb +41 -0
  33. data/lib/hydra/stdio.rb +16 -0
  34. data/lib/hydra/sync.rb +99 -0
  35. data/lib/hydra/tasks.rb +366 -0
  36. data/lib/hydra/threadsafe_io.rb +18 -0
  37. data/lib/hydra/tmpdir.rb +11 -0
  38. data/lib/hydra/trace.rb +29 -0
  39. data/lib/hydra/worker.rb +168 -0
  40. data/lib/hydra.rb +16 -0
  41. data/nulogy-hydra.gemspec +122 -0
  42. data/test/fixtures/assert_true.rb +7 -0
  43. data/test/fixtures/bad_proxy_config.yml +4 -0
  44. data/test/fixtures/config.yml +4 -0
  45. data/test/fixtures/conflicting.rb +10 -0
  46. data/test/fixtures/features/step_definitions.rb +21 -0
  47. data/test/fixtures/features/write_alternate_file.feature +7 -0
  48. data/test/fixtures/features/write_file.feature +7 -0
  49. data/test/fixtures/hello_world.rb +3 -0
  50. data/test/fixtures/hydra_worker_init.rb +2 -0
  51. data/test/fixtures/js_file.js +4 -0
  52. data/test/fixtures/json_data.json +4 -0
  53. data/test/fixtures/many_outputs_to_console.rb +9 -0
  54. data/test/fixtures/master_listeners.rb +10 -0
  55. data/test/fixtures/proxy_config.yml +4 -0
  56. data/test/fixtures/proxy_config_http.yml +4 -0
  57. data/test/fixtures/runner_listeners.rb +23 -0
  58. data/test/fixtures/slow.rb +9 -0
  59. data/test/fixtures/sync_test.rb +8 -0
  60. data/test/fixtures/task_test_config.yml +6 -0
  61. data/test/fixtures/write_file.rb +10 -0
  62. data/test/fixtures/write_file_alternate_spec.rb +10 -0
  63. data/test/fixtures/write_file_spec.rb +9 -0
  64. data/test/fixtures/write_file_with_pending_spec.rb +11 -0
  65. data/test/master_test.rb +383 -0
  66. data/test/message_test.rb +31 -0
  67. data/test/pipe_test.rb +38 -0
  68. data/test/proxy_config_test.rb +31 -0
  69. data/test/runner_test.rb +196 -0
  70. data/test/ssh_test.rb +25 -0
  71. data/test/sync_test.rb +113 -0
  72. data/test/task_test.rb +21 -0
  73. data/test/test_helper.rb +107 -0
  74. data/test/worker_test.rb +60 -0
  75. metadata +208 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009-2010 Nick Gauthier
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,39 @@
1
+ = Hydra
2
+
3
+ Spread your tests over processors and/or multiple machines to test your code faster.
4
+
5
+ == Description
6
+
7
+ Hydra is a distributed testing framework. It allows you to distribute
8
+ your tests locally across multiple cores and processors, as well as
9
+ run your tests remotely over SSH.
10
+
11
+ Hydra's goals are to make distributed testing easy. So as long as
12
+ you can ssh into a computer and run the tests, you can automate
13
+ the distribution with Hydra.
14
+
15
+ == Usage and Configuration
16
+
17
+ Check out the wiki for usage and configuration information:
18
+
19
+ http://wiki.github.com/ngauthier/hydra/
20
+
21
+ I've tried hard to keep accurate documentation via RDoc as well:
22
+
23
+ http://rdoc.info/projects/ngauthier/hydra
24
+
25
+ == Supported frameworks
26
+
27
+ Right now hydra only supports a few frameworks:
28
+
29
+ * Test::Unit
30
+ * Cucumber
31
+ * RSpec
32
+
33
+ We're working on adding more frameworks, and if you'd like to help, please
34
+ send me a message and I'll show you where to code!
35
+
36
+ == Copyright
37
+
38
+ Copyright (c) 2010 Nick Gauthier. See LICENSE for details.
39
+
data/Rakefile ADDED
@@ -0,0 +1,56 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "nulogy-hydra"
8
+ gem.summary = %Q{Distributed testing toolkit}
9
+ gem.description = %Q{Spread your tests over multiple machines to test your code faster.}
10
+ gem.email = "engineering@nulogy.com"
11
+ gem.homepage = "http://github.com/nulogy/hydra"
12
+ gem.authors = ["Nick Gauthier", "Justin Fitzsimmons", "Victor Savkin"]
13
+ gem.add_development_dependency "shoulda", "= 2.10.3"
14
+ gem.add_development_dependency "rspec", "= 2.0.0.beta.19"
15
+ gem.add_development_dependency "cucumber", "= 0.9.2"
16
+ gem.add_development_dependency "therubyracer", "= 0.7.4"
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
+ end
22
+
23
+ require 'rake/testtask'
24
+ Rake::TestTask.new(:test) do |test|
25
+ test.libs << 'lib' << 'test'
26
+ test.pattern = 'test/**/*_test.rb'
27
+ test.verbose = true
28
+ end
29
+
30
+ begin
31
+ require 'rcov/rcovtask'
32
+ Rcov::RcovTask.new do |test|
33
+ test.libs << 'test'
34
+ test.pattern = 'test/**/*_test.rb'
35
+ test.verbose = true
36
+ end
37
+ rescue LoadError
38
+ task :rcov do
39
+ abort "RCov is not available. In order to run rcov, you must: gem install rcov"
40
+ end
41
+ end
42
+
43
+ task :test => :check_dependencies
44
+
45
+ task :default => :test
46
+
47
+ require 'rake/rdoctask'
48
+ Rake::RDocTask.new do |rdoc|
49
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
+
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "hydra #{version}"
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ rdoc.options << '--charset=utf-8'
56
+ end
data/TODO ADDED
@@ -0,0 +1,18 @@
1
+ = Hydra TODO
2
+
3
+ * hydra:sync task that runs the SSH syncing for remote workers
4
+ * ensure same version is running remotely (gem directive)
5
+ * on a crash, bubble up error messages
6
+ * send workers a "boot" message with all the files that will be tested so that it
7
+ can boot the environment before forking runners
8
+ * named configurations (i.e. 'local', 'remote', 'myconfig') so users can swap configs with an
9
+ environment variable or with a hydra testtask option
10
+
11
+ == Reporting
12
+
13
+ Refactor reporting into an event listening system. Add in a default listener that messages:
14
+
15
+ * Files at start
16
+ * Progress status "50% (10/20 files)"
17
+ * Time report at the end
18
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.23.2.1
data/caliper.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ directories_to_calculate: ---
3
+ - lib
4
+
5
+ test_directories_to_calculate: ---
6
+ - test
Binary file
data/hydra.gemspec ADDED
@@ -0,0 +1,131 @@
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{hydra}
8
+ s.version = "0.23.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nick Gauthier"]
12
+ s.date = %q{2010-11-03}
13
+ s.description = %q{Spread your tests over multiple machines to test your code faster.}
14
+ s.email = %q{nick@smartlogicsolutions.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc",
18
+ "TODO"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "TODO",
27
+ "VERSION",
28
+ "caliper.yml",
29
+ "hydra-icon-64x64.png",
30
+ "hydra.gemspec",
31
+ "hydra_gray.png",
32
+ "lib/hydra.rb",
33
+ "lib/hydra/cucumber/formatter.rb",
34
+ "lib/hydra/hash.rb",
35
+ "lib/hydra/js/lint.js",
36
+ "lib/hydra/listener/abstract.rb",
37
+ "lib/hydra/listener/minimal_output.rb",
38
+ "lib/hydra/listener/notifier.rb",
39
+ "lib/hydra/listener/progress_bar.rb",
40
+ "lib/hydra/listener/report_generator.rb",
41
+ "lib/hydra/master.rb",
42
+ "lib/hydra/message.rb",
43
+ "lib/hydra/message/master_messages.rb",
44
+ "lib/hydra/message/runner_messages.rb",
45
+ "lib/hydra/message/worker_messages.rb",
46
+ "lib/hydra/messaging_io.rb",
47
+ "lib/hydra/pipe.rb",
48
+ "lib/hydra/runner.rb",
49
+ "lib/hydra/safe_fork.rb",
50
+ "lib/hydra/spec/autorun_override.rb",
51
+ "lib/hydra/spec/hydra_formatter.rb",
52
+ "lib/hydra/ssh.rb",
53
+ "lib/hydra/stdio.rb",
54
+ "lib/hydra/sync.rb",
55
+ "lib/hydra/tasks.rb",
56
+ "lib/hydra/tmpdir.rb",
57
+ "lib/hydra/trace.rb",
58
+ "lib/hydra/worker.rb",
59
+ "test/fixtures/assert_true.rb",
60
+ "test/fixtures/config.yml",
61
+ "test/fixtures/conflicting.rb",
62
+ "test/fixtures/features/step_definitions.rb",
63
+ "test/fixtures/features/write_alternate_file.feature",
64
+ "test/fixtures/features/write_file.feature",
65
+ "test/fixtures/hello_world.rb",
66
+ "test/fixtures/js_file.js",
67
+ "test/fixtures/json_data.json",
68
+ "test/fixtures/slow.rb",
69
+ "test/fixtures/sync_test.rb",
70
+ "test/fixtures/write_file.rb",
71
+ "test/fixtures/write_file_alternate_spec.rb",
72
+ "test/fixtures/write_file_spec.rb",
73
+ "test/fixtures/write_file_with_pending_spec.rb",
74
+ "test/master_test.rb",
75
+ "test/message_test.rb",
76
+ "test/pipe_test.rb",
77
+ "test/runner_test.rb",
78
+ "test/ssh_test.rb",
79
+ "test/sync_test.rb",
80
+ "test/test_helper.rb",
81
+ "test/worker_test.rb"
82
+ ]
83
+ s.homepage = %q{http://github.com/ngauthier/hydra}
84
+ s.rdoc_options = ["--charset=UTF-8"]
85
+ s.require_paths = ["lib"]
86
+ s.rubygems_version = %q{1.3.7}
87
+ s.summary = %q{Distributed testing toolkit}
88
+ s.test_files = [
89
+ "test/pipe_test.rb",
90
+ "test/sync_test.rb",
91
+ "test/ssh_test.rb",
92
+ "test/fixtures/write_file_alternate_spec.rb",
93
+ "test/fixtures/sync_test.rb",
94
+ "test/fixtures/hello_world.rb",
95
+ "test/fixtures/features/step_definitions.rb",
96
+ "test/fixtures/assert_true.rb",
97
+ "test/fixtures/slow.rb",
98
+ "test/fixtures/write_file_spec.rb",
99
+ "test/fixtures/conflicting.rb",
100
+ "test/fixtures/write_file_with_pending_spec.rb",
101
+ "test/fixtures/write_file.rb",
102
+ "test/message_test.rb",
103
+ "test/test_helper.rb",
104
+ "test/master_test.rb",
105
+ "test/runner_test.rb",
106
+ "test/worker_test.rb"
107
+ ]
108
+
109
+ if s.respond_to? :specification_version then
110
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
111
+ s.specification_version = 3
112
+
113
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
114
+ s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
115
+ s.add_development_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
116
+ s.add_development_dependency(%q<cucumber>, ["= 0.9.2"])
117
+ s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
118
+ else
119
+ s.add_dependency(%q<shoulda>, ["= 2.10.3"])
120
+ s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
121
+ s.add_dependency(%q<cucumber>, ["= 0.9.2"])
122
+ s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
123
+ end
124
+ else
125
+ s.add_dependency(%q<shoulda>, ["= 2.10.3"])
126
+ s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
127
+ s.add_dependency(%q<cucumber>, ["= 0.9.2"])
128
+ s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
129
+ end
130
+ end
131
+
data/hydra_gray.png ADDED
Binary file
@@ -0,0 +1,29 @@
1
+ require 'cucumber/formatter/progress'
2
+
3
+ module Cucumber #:nodoc:
4
+ module Formatter #:nodoc:
5
+ # Hydra formatter for cucumber.
6
+ # Stifles all output except error messages
7
+ # Based on the
8
+ class Hydra < Cucumber::Formatter::Progress
9
+ # Removed the extra newlines here
10
+ def after_features(features)
11
+ print_summary(features)
12
+ end
13
+
14
+ private
15
+
16
+ # Removed the file statistics
17
+ def print_summary(features)
18
+ print_steps(:pending)
19
+ print_steps(:failed)
20
+ print_snippets(@options)
21
+ print_passing_wip(@options)
22
+ end
23
+
24
+ # Removed all progress output
25
+ def progress(status)
26
+ end
27
+ end
28
+ end
29
+ end
data/lib/hydra/hash.rb ADDED
@@ -0,0 +1,16 @@
1
+ class Hash
2
+ # Stringify the keys in the hash. Returns a new hash.
3
+ def stringify_keys
4
+ inject({}) do |options, (key, value)|
5
+ options[key.to_s] = value
6
+ options
7
+ end
8
+ end
9
+ # Stringify the keys in the hash in place.
10
+ def stringify_keys!
11
+ keys.each do |key|
12
+ self[key.to_s] = delete(key)
13
+ end
14
+ self
15
+ end
16
+ end