gorgon 0.7.0 → 0.7.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.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/architecture.md +33 -17
- data/lib/gorgon/originator.rb +7 -2
- data/lib/gorgon/settings/files_content.rb +15 -8
- data/lib/gorgon/settings/initial_files_creator.rb +2 -0
- data/lib/gorgon/settings/rails_project_files_content.rb +3 -2
- data/lib/gorgon/settings/simple_project_files_content.rb +1 -0
- data/lib/gorgon/version.rb +1 -1
- metadata +82 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODFiMzc4NjIzZTU3NmVjYjUyZDA0NDk0MWEzYTQ4MTg5MzZmZjBlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzljZGEyNTE5ZTU3OWFiYjhiNTdhMDU2YTkyMzg1NjU4YjA4MzI1Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWY1MWNmOWIwZjM3NjE4YTc5MTFiNjQzOWY0NmU2Y2FmMTUxOGJlZmMyZDky
|
10
|
+
YmQ3NGRjNzM1MTMwNTY2Zjg5YzhmZWYxNDJiMTEzZWYyNmQ1ZGMxYzI5ZTAx
|
11
|
+
NzkzMDA4N2U3MDc3NzJhYmMzNDk4NzE1YWEwNDNlNTZlZTBjMzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjZiMTAyYTIxZjRjYzcxNmRhOTM0NmYwNmY2ZjU3MmU5MzdjMGE4Mjc4ZWUw
|
14
|
+
MzQ1M2ZmZGQxYjM1ZjI1NzAyMGMyNmI1NjFhNDBhZDE1OGEyNmFlNDllZWE4
|
15
|
+
NTJjOTY0ODhiYWYyZWZhYjZkODljYjZhMzczZWM5MWEwNjVhODY=
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gorgon (0.7.
|
4
|
+
gorgon (0.7.1)
|
5
5
|
amqp (~> 1.1.0)
|
6
6
|
awesome_print
|
7
7
|
colorize (~> 0.5.8)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
colorize (0.5.8)
|
22
22
|
diff-lcs (1.1.3)
|
23
23
|
eventmachine (1.0.3)
|
24
|
-
open4 (1.3.
|
24
|
+
open4 (1.3.4)
|
25
25
|
rake (0.9.2.2)
|
26
26
|
rspec (2.11.0)
|
27
27
|
rspec-core (~> 2.11.0)
|
data/README.md
CHANGED
data/architecture.md
CHANGED
@@ -1,28 +1,44 @@
|
|
1
1
|
Architecture
|
2
2
|
---------------------
|
3
3
|
|
4
|
-
|
4
|
+
[Gorgon](https://github.com/Fitzsimmons/Gorgon/) distributes a test suite across multiple machines. So you can use all the computer power in your office to run your tests in parallel.
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
*
|
6
|
+
These are the main components of Gorgon's architecture:
|
7
|
+
|
8
|
+
* *originator*: program that we run in the terminal to start running tests.
|
9
|
+
* *listener*: long living program running as background process on every remote host that will run tests. It will wait for a *job definition* form *originator*, and fork a *worker manager*.
|
10
|
+
* *file server*: middleman host used to transfer source code from *originator* to *listeners*.
|
11
|
+
* *worker manager*: process that forks *workers*.
|
12
|
+
* *worker*: process that runs test files and sends results back to *originator*
|
13
|
+
* [*RabbitMQ*](http://www.rabbitmq.com/): message broker running on a fixed host. It's used to communicate between *originator*, and *listeners*, *worker managers* and *workers*.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
Every machine needs to run a *listener*, that should be launched on system startup. Between *originator* and *listeners* we have a *file server* and *RabbitMQ*. When we run Gorgon, *originator* will push all files to the *file server*, and add a *job definition* to a *RabbitMQ* queue that all listener are listening to.
|
18
|
+
|
19
|
+
A *job definition* contains:
|
20
|
+
|
21
|
+
* The rsync information with which to fetch the source tree from *file server*
|
22
|
+
* The name of a RabbitMQ queue that contains the list of files that require testing
|
23
|
+
* The name of a RabbitMQ exchange to send replies to
|
9
24
|
* Application-specific setup/teardown, either per-job or per-worker (callbacks)
|
10
25
|
|
11
|
-
|
26
|
+
When a *listener* receives a *job definition*, it:
|
12
27
|
|
13
|
-
*
|
14
|
-
* Rsync the source tree to the temporary workspace
|
15
|
-
*
|
28
|
+
* Creates a unique temporary workspace directory for the job
|
29
|
+
* Rsync the source tree from *file server* to the temporary workspace
|
30
|
+
* Runs after_sync callback
|
16
31
|
* Invoke a WorkerManager
|
17
32
|
|
18
|
-
After WorkerManager starts, it
|
19
|
-
|
20
|
-
*
|
21
|
-
*
|
33
|
+
After WorkerManager starts, it:
|
34
|
+
|
35
|
+
* Runs before_creating_workers callback
|
36
|
+
* Forks n workers, where n is the number of available worker slots specified in [gorgon configuration](https://github.com/Fitzsimmons/Gorgon/blob/master/gorgon_listener.json.sample).
|
37
|
+
* Subscribes to a queue where originator can send a cancel_job message
|
38
|
+
|
39
|
+
Each Worker:
|
22
40
|
|
23
|
-
|
24
|
-
*
|
25
|
-
*
|
26
|
-
* Run after_complete callback
|
41
|
+
* Runs before_start callback
|
42
|
+
* Keeps popping files one at a time until *file queue* is empty. For every file, it posts a *start message*, runs file using correct *test runner* (RSpec or MiniTest), and sends a *finish message* to *originator* with the results through the reply queue.
|
43
|
+
* Runs after_complete callback
|
27
44
|
|
28
|
-
To invoke the worker manager, the listener passes the name of the *file queue*, *reply queue*, and *listener queue* to the worker manager initialization, and then it will block until worker manager finishes.
|
data/lib/gorgon/originator.rb
CHANGED
@@ -160,8 +160,13 @@ class Originator
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def file_server_host
|
163
|
-
|
164
|
-
|
163
|
+
if configuration[:file_server].nil?
|
164
|
+
raise <<-MSG
|
165
|
+
Missing file_server configuration.
|
166
|
+
See https://github.com/Fitzsimmons/Gorgon/blob/master/gorgon.json.sample for a sample configuration
|
167
|
+
MSG
|
168
|
+
end
|
169
|
+
|
165
170
|
configuration[:file_server][:host]
|
166
171
|
end
|
167
172
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Settings
|
2
2
|
class FilesContent
|
3
|
-
attr_accessor :amqp_host, :sync_exclude, :files, :originator_log_file,
|
3
|
+
attr_accessor :amqp_host, :file_server_host, :sync_exclude, :files, :originator_log_file,
|
4
4
|
:callbacks, :callbacks_dir
|
5
5
|
|
6
6
|
TEST_UNIT_GLOB = "test/**/*_test.rb"
|
@@ -12,15 +12,22 @@ module Settings
|
|
12
12
|
@files << FilesContent::RSPEC_GLOB if Dir.exist?('spec')
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
DEFAULT_HOST = 'localhost'
|
16
16
|
def self.get_amqp_host
|
17
|
-
puts "AMQP host (
|
17
|
+
puts "What's the AMQP host name? (leave blank to use '#{DEFAULT_HOST}') "
|
18
|
+
return get_input_or_default(DEFAULT_HOST)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.get_file_server_host
|
22
|
+
puts "What's the File Server host name? (leave blank to use '#{DEFAULT_HOST}') "
|
23
|
+
return get_input_or_default(DEFAULT_HOST)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def self.get_input_or_default(default)
|
18
29
|
input = $stdin.gets.chomp
|
19
|
-
|
20
|
-
return DEFAULT_AMQP_HOST
|
21
|
-
else
|
22
|
-
return input
|
23
|
-
end
|
30
|
+
(input == '') ? default : input
|
24
31
|
end
|
25
32
|
end
|
26
33
|
end
|
@@ -22,6 +22,7 @@ module Settings
|
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
|
+
|
25
26
|
def self.create_gorgon_json content
|
26
27
|
if File.exist? GORGON_JSON_FILE
|
27
28
|
puts "gorgo.json exists. Skipping..."
|
@@ -30,6 +31,7 @@ module Settings
|
|
30
31
|
|
31
32
|
config = {
|
32
33
|
connection: {host: content.amqp_host},
|
34
|
+
file_server: {host: content.file_server_host},
|
33
35
|
job: {
|
34
36
|
sync_exclude: content.sync_exclude
|
35
37
|
},
|
@@ -5,6 +5,7 @@ module Settings
|
|
5
5
|
def initialize
|
6
6
|
super
|
7
7
|
@amqp_host = FilesContent.get_amqp_host
|
8
|
+
@file_server_host = FilesContent.get_file_server_host
|
8
9
|
@sync_exclude = [".git", ".rvmrc","tmp","log","doc"]
|
9
10
|
@originator_log_file = 'log/gorgon-originator.log'
|
10
11
|
create_callbacks
|
@@ -67,8 +68,8 @@ if status.exitstatus != 0
|
|
67
68
|
raise "ERROR: 'rake db:setup' failed.\n#{stderr.read}\n#{stdout.read}"
|
68
69
|
end
|
69
70
|
|
70
|
-
spec_helper_file = File.expand_path('../../spec_helper', __FILE__)
|
71
|
-
test_helper_file = File.expand_path('../../test_helper', __FILE__)
|
71
|
+
spec_helper_file = File.expand_path('../../spec_helper.rb', __FILE__)
|
72
|
+
test_helper_file = File.expand_path('../../test_helper.rb', __FILE__)
|
72
73
|
|
73
74
|
require spec_helper_file if File.exist?(spec_helper_file)
|
74
75
|
require test_helper_file if File.exist?(test_helper_file)
|
data/lib/gorgon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorgon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Fitzsimmons
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-
|
15
|
+
date: 2014-10-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|
@@ -365,8 +365,86 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
365
|
version: '0'
|
366
366
|
requirements: []
|
367
367
|
rubyforge_project: gorgon
|
368
|
-
rubygems_version: 2.
|
368
|
+
rubygems_version: 2.2.2
|
369
369
|
signing_key:
|
370
370
|
specification_version: 4
|
371
371
|
summary: Distributed testing for ruby with centralized management
|
372
|
-
test_files:
|
372
|
+
test_files:
|
373
|
+
- spec/acceptance/run_tests_spec.rb
|
374
|
+
- spec/acceptance_spec_helper.rb
|
375
|
+
- spec/callback_handler_spec.rb
|
376
|
+
- spec/crash_reporter_spec.rb
|
377
|
+
- spec/failures_printer_spec.rb
|
378
|
+
- spec/gem_command_handler_spec.rb
|
379
|
+
- spec/gem_service_spec.rb
|
380
|
+
- spec/gorgon_rspec_formatter_spec.rb
|
381
|
+
- spec/host_state_spec.rb
|
382
|
+
- spec/job_definition_spec.rb
|
383
|
+
- spec/job_state_spec.rb
|
384
|
+
- spec/listener_spec.rb
|
385
|
+
- spec/mini_test_runner_spec.rb
|
386
|
+
- spec/originator_logger_spec.rb
|
387
|
+
- spec/originator_protocol_spec.rb
|
388
|
+
- spec/originator_spec.rb
|
389
|
+
- spec/ping_service_spec.rb
|
390
|
+
- spec/pipe_forker_spec.rb
|
391
|
+
- spec/progress_bar_view_spec.rb
|
392
|
+
- spec/rspec_runner_spec.rb
|
393
|
+
- spec/rsync_daemon_spec.rb
|
394
|
+
- spec/shutdown_manager_spec.rb
|
395
|
+
- spec/source_tree_syncer_spec.rb
|
396
|
+
- spec/support/mock_app/.gitignore
|
397
|
+
- spec/support/mock_app/Gemfile
|
398
|
+
- spec/support/mock_app/Gemfile.lock
|
399
|
+
- spec/support/mock_app/README.rdoc
|
400
|
+
- spec/support/mock_app/Rakefile
|
401
|
+
- spec/support/mock_app/app/assets/images/rails.png
|
402
|
+
- spec/support/mock_app/app/assets/javascripts/application.js
|
403
|
+
- spec/support/mock_app/app/assets/stylesheets/application.css
|
404
|
+
- spec/support/mock_app/app/controllers/application_controller.rb
|
405
|
+
- spec/support/mock_app/app/helpers/application_helper.rb
|
406
|
+
- spec/support/mock_app/app/mailers/.gitkeep
|
407
|
+
- spec/support/mock_app/app/models/.gitkeep
|
408
|
+
- spec/support/mock_app/app/views/layouts/application.html.erb
|
409
|
+
- spec/support/mock_app/config.ru
|
410
|
+
- spec/support/mock_app/config/application.rb
|
411
|
+
- spec/support/mock_app/config/boot.rb
|
412
|
+
- spec/support/mock_app/config/database.yml
|
413
|
+
- spec/support/mock_app/config/environment.rb
|
414
|
+
- spec/support/mock_app/config/environments/development.rb
|
415
|
+
- spec/support/mock_app/config/environments/production.rb
|
416
|
+
- spec/support/mock_app/config/environments/test.rb
|
417
|
+
- spec/support/mock_app/config/initializers/backtrace_silencers.rb
|
418
|
+
- spec/support/mock_app/config/initializers/inflections.rb
|
419
|
+
- spec/support/mock_app/config/initializers/mime_types.rb
|
420
|
+
- spec/support/mock_app/config/initializers/secret_token.rb
|
421
|
+
- spec/support/mock_app/config/initializers/session_store.rb
|
422
|
+
- spec/support/mock_app/config/initializers/wrap_parameters.rb
|
423
|
+
- spec/support/mock_app/config/locales/en.yml
|
424
|
+
- spec/support/mock_app/config/routes.rb
|
425
|
+
- spec/support/mock_app/db/seeds.rb
|
426
|
+
- spec/support/mock_app/doc/README_FOR_APP
|
427
|
+
- spec/support/mock_app/lib/assets/.gitkeep
|
428
|
+
- spec/support/mock_app/lib/tasks/.gitkeep
|
429
|
+
- spec/support/mock_app/log/.gitkeep
|
430
|
+
- spec/support/mock_app/public/404.html
|
431
|
+
- spec/support/mock_app/public/422.html
|
432
|
+
- spec/support/mock_app/public/500.html
|
433
|
+
- spec/support/mock_app/public/favicon.ico
|
434
|
+
- spec/support/mock_app/public/index.html
|
435
|
+
- spec/support/mock_app/public/robots.txt
|
436
|
+
- spec/support/mock_app/script/rails
|
437
|
+
- spec/support/mock_app/test/fixtures/.gitkeep
|
438
|
+
- spec/support/mock_app/test/functional/.gitkeep
|
439
|
+
- spec/support/mock_app/test/integration/.gitkeep
|
440
|
+
- spec/support/mock_app/test/performance/browsing_test.rb
|
441
|
+
- spec/support/mock_app/test/test_helper.rb
|
442
|
+
- spec/support/mock_app/test/unit/.gitkeep
|
443
|
+
- spec/support/mock_app/test/unit/passing_test.rb
|
444
|
+
- spec/support/mock_app/vendor/assets/javascripts/.gitkeep
|
445
|
+
- spec/support/mock_app/vendor/assets/stylesheets/.gitkeep
|
446
|
+
- spec/support/mock_app/vendor/plugins/.gitkeep
|
447
|
+
- spec/support/originator_handler.rb
|
448
|
+
- spec/unknown_runner_spec.rb
|
449
|
+
- spec/worker_manager_spec.rb
|
450
|
+
- spec/worker_spec.rb
|