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
@@ -0,0 +1,122 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "nulogy-hydra"
8
+ s.version = "0.23.2.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nick Gauthier", "Justin Fitzsimmons", "Victor Savkin"]
12
+ s.date = "2011-11-09"
13
+ s.description = "Spread your tests over multiple machines to test your code faster."
14
+ s.email = "engineering@nulogy.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc",
18
+ "TODO"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "TODO",
26
+ "VERSION",
27
+ "caliper.yml",
28
+ "hydra-icon-64x64.png",
29
+ "hydra.gemspec",
30
+ "hydra_gray.png",
31
+ "lib/hydra.rb",
32
+ "lib/hydra/cucumber/formatter.rb",
33
+ "lib/hydra/hash.rb",
34
+ "lib/hydra/js/lint.js",
35
+ "lib/hydra/listener/abstract.rb",
36
+ "lib/hydra/listener/minimal_output.rb",
37
+ "lib/hydra/listener/notifier.rb",
38
+ "lib/hydra/listener/progress_bar.rb",
39
+ "lib/hydra/listener/report_generator.rb",
40
+ "lib/hydra/master.rb",
41
+ "lib/hydra/message.rb",
42
+ "lib/hydra/message/master_messages.rb",
43
+ "lib/hydra/message/runner_messages.rb",
44
+ "lib/hydra/message/worker_messages.rb",
45
+ "lib/hydra/messaging_io.rb",
46
+ "lib/hydra/pipe.rb",
47
+ "lib/hydra/proxy_config.rb",
48
+ "lib/hydra/runner.rb",
49
+ "lib/hydra/runner_listener/abstract.rb",
50
+ "lib/hydra/safe_fork.rb",
51
+ "lib/hydra/spec/autorun_override.rb",
52
+ "lib/hydra/spec/hydra_formatter.rb",
53
+ "lib/hydra/ssh.rb",
54
+ "lib/hydra/stdio.rb",
55
+ "lib/hydra/sync.rb",
56
+ "lib/hydra/tasks.rb",
57
+ "lib/hydra/threadsafe_io.rb",
58
+ "lib/hydra/tmpdir.rb",
59
+ "lib/hydra/trace.rb",
60
+ "lib/hydra/worker.rb",
61
+ "nulogy-hydra.gemspec",
62
+ "test/fixtures/assert_true.rb",
63
+ "test/fixtures/bad_proxy_config.yml",
64
+ "test/fixtures/config.yml",
65
+ "test/fixtures/conflicting.rb",
66
+ "test/fixtures/features/step_definitions.rb",
67
+ "test/fixtures/features/write_alternate_file.feature",
68
+ "test/fixtures/features/write_file.feature",
69
+ "test/fixtures/hello_world.rb",
70
+ "test/fixtures/hydra_worker_init.rb",
71
+ "test/fixtures/js_file.js",
72
+ "test/fixtures/json_data.json",
73
+ "test/fixtures/many_outputs_to_console.rb",
74
+ "test/fixtures/master_listeners.rb",
75
+ "test/fixtures/proxy_config.yml",
76
+ "test/fixtures/proxy_config_http.yml",
77
+ "test/fixtures/runner_listeners.rb",
78
+ "test/fixtures/slow.rb",
79
+ "test/fixtures/sync_test.rb",
80
+ "test/fixtures/task_test_config.yml",
81
+ "test/fixtures/write_file.rb",
82
+ "test/fixtures/write_file_alternate_spec.rb",
83
+ "test/fixtures/write_file_spec.rb",
84
+ "test/fixtures/write_file_with_pending_spec.rb",
85
+ "test/master_test.rb",
86
+ "test/message_test.rb",
87
+ "test/pipe_test.rb",
88
+ "test/proxy_config_test.rb",
89
+ "test/runner_test.rb",
90
+ "test/ssh_test.rb",
91
+ "test/sync_test.rb",
92
+ "test/task_test.rb",
93
+ "test/test_helper.rb",
94
+ "test/worker_test.rb"
95
+ ]
96
+ s.homepage = "http://github.com/nulogy/hydra"
97
+ s.require_paths = ["lib"]
98
+ s.rubygems_version = "1.8.10"
99
+ s.summary = "Distributed testing toolkit"
100
+
101
+ if s.respond_to? :specification_version then
102
+ s.specification_version = 3
103
+
104
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
105
+ s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
106
+ s.add_development_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
107
+ s.add_development_dependency(%q<cucumber>, ["= 0.9.2"])
108
+ s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
109
+ else
110
+ s.add_dependency(%q<shoulda>, ["= 2.10.3"])
111
+ s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
112
+ s.add_dependency(%q<cucumber>, ["= 0.9.2"])
113
+ s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
114
+ end
115
+ else
116
+ s.add_dependency(%q<shoulda>, ["= 2.10.3"])
117
+ s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
118
+ s.add_dependency(%q<cucumber>, ["= 0.9.2"])
119
+ s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
120
+ end
121
+ end
122
+
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ class AssertTrueTest < Test::Unit::TestCase
4
+ should "be true" do
5
+ assert true
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ ---
2
+ proxy:
3
+ path: test/fixtures/config.yml
4
+ type: fjoeaij
@@ -0,0 +1,4 @@
1
+ ---
2
+ workers:
3
+ - type: local
4
+ runners: 2
@@ -0,0 +1,10 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ # this test is around to make sure that we handle all the errors
4
+ # that can occur when 'require'ing a test file.
5
+ class SyncTest < Object
6
+ def test_it_again
7
+ assert true
8
+ end
9
+ end
10
+
@@ -0,0 +1,21 @@
1
+ Given /^a target file$/ do
2
+ @target_file = File.expand_path(File.join(Dir.consistent_tmpdir, 'hydra_test.txt'))
3
+ end
4
+
5
+ Given /^an alternate target file$/ do
6
+ @target_file = File.expand_path(File.join(Dir.consistent_tmpdir, 'alternate_hydra_test.txt'))
7
+ end
8
+
9
+ When /^I write "([^\"]*)" to the file$/ do |text|
10
+ f = File.new(@target_file, 'w')
11
+ f.write text
12
+ f.flush
13
+ f.close
14
+ end
15
+
16
+ Then /^"([^\"]*)" should be written in the file$/ do |text|
17
+ f = File.new(@target_file, 'r')
18
+ raise 'Did not write to file' unless text == f.read
19
+ f.close
20
+ end
21
+
@@ -0,0 +1,7 @@
1
+ Feature: Write a file
2
+
3
+ Scenario: Write to hydra_test.txt
4
+ Given an alternate target file
5
+ When I write "HYDRA" to the file
6
+ Then "HYDRA" should be written in the file
7
+
@@ -0,0 +1,7 @@
1
+ Feature: Write a file
2
+
3
+ Scenario: Write to hydra_test.txt
4
+ Given a target file
5
+ When I write "HYDRA" to the file
6
+ Then "HYDRA" should be written in the file
7
+
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ $stdout.write "{:class=>Hydra::Messages::TestMessage, :text=>\"Hello World\"}\n"
3
+ $stdout.flush
@@ -0,0 +1,2 @@
1
+ require '../test/fixtures/runner_listeners.rb'
2
+ require '../test/fixtures/master_listeners.rb'
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ var thisvar;
3
+ var thatvar
4
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "var1": "something",
3
+ "var2": "trailing comma",
4
+ }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ 10000.times do
4
+ $stdout.write "A non-hydra message...\n"
5
+ $stdout.flush
6
+ end
7
+
8
+ $stdout.write "{:class=>Hydra::Messages::TestMessage, :text=>\"My message\"}\n"
9
+ $stdout.flush
@@ -0,0 +1,10 @@
1
+ module HydraExtension
2
+ module Listener
3
+ class WorkerBeganFlag < Hydra::Listener::Abstract
4
+ # Fired after runner processes have been started
5
+ def worker_begin(worker)
6
+ FileUtils.touch File.expand_path(File.join(Dir.consistent_tmpdir, 'worker_began_flag'))
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,4 @@
1
+ ---
2
+ proxy:
3
+ path: test/fixtures/config.yml
4
+ type: file
@@ -0,0 +1,4 @@
1
+ ---
2
+ proxy:
3
+ path: http://mocked/url
4
+ type: http
@@ -0,0 +1,23 @@
1
+ module HydraExtension
2
+ module RunnerListener
3
+ class RunnerBeginTest < Hydra::RunnerListener::Abstract
4
+ # Fired by the runner just before requesting the first file
5
+ def runner_begin( runner )
6
+ FileUtils.touch File.expand_path(File.join(Dir.consistent_tmpdir, 'alternate_hydra_test.txt'))
7
+ end
8
+ end
9
+
10
+ class RunnerEndTest < Hydra::RunnerListener::Abstract
11
+ # Fired by the runner just before requesting the first file
12
+ def runner_begin( runner )
13
+ FileUtils.touch File.expand_path(File.join(Dir.consistent_tmpdir, 'runner_began_flag')) #used to know when the runner is ready
14
+ end
15
+ # Fired by the runner just after stoping
16
+ def runner_end( runner )
17
+ # NOTE: do not use trace here
18
+ #runner.trace "Ending runner"
19
+ FileUtils.touch File.expand_path(File.join(Dir.consistent_tmpdir, 'alternate_hydra_test.txt'))
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,9 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ class WriteFileTest < Test::Unit::TestCase
4
+ def test_slow
5
+ sleep(5)
6
+ end
7
+ end
8
+
9
+
@@ -0,0 +1,8 @@
1
+ require 'test/unit'
2
+
3
+ class SyncTest < Test::Unit::TestCase
4
+ def test_truth
5
+ assert true
6
+ end
7
+ end
8
+
@@ -0,0 +1,6 @@
1
+ ---
2
+ workers:
3
+ - type: ssh
4
+ connect: localhost
5
+ directory: /tmp
6
+ runners: 1
@@ -0,0 +1,10 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ class WriteFileTest < Test::Unit::TestCase
4
+ def test_write_a_file
5
+ File.open(File.join(Dir.consistent_tmpdir, 'hydra_test.txt'), 'a') do |f|
6
+ f.write "HYDRA"
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ require 'rspec'
2
+ require 'hydra/tmpdir'
3
+ context "file writing" do
4
+ it "writes to a file" do
5
+ File.open(File.join(Dir.consistent_tmpdir, 'alternate_hydra_test.txt'), 'a') do |f|
6
+ f.write "HYDRA"
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,9 @@
1
+ require 'rspec'
2
+ require 'hydra/tmpdir'
3
+ context "file writing" do
4
+ it "writes to a file" do
5
+ File.open(File.join(Dir.consistent_tmpdir, 'hydra_test.txt'), 'a') do |f|
6
+ f.write "HYDRA"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require 'tmpdir'
2
+ require 'rspec'
3
+ context "file writing" do
4
+ it "writes to a file" do
5
+ File.open(File.join(Dir.consistent_tmpdir, 'hydra_test.txt'), 'a') do |f|
6
+ f.write "HYDRA"
7
+ end
8
+ end
9
+ it 'could do so much more' # pending spec
10
+ end
11
+