gorgon 0.8.3 → 0.8.4

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjQ4NWZhNTMzMjIzZWQ4NTMwNzAxYzMzMDQ0NDhiMWJjMjg1Y2NmZQ==
4
+ ODE4OGJiNzI0ZTBkNmRhYjJjNGJkNzg0Y2FjNmQ0M2ZlYWY2Mjk0NA==
5
5
  data.tar.gz: !binary |-
6
- YmRiMDAzYmU3M2Y3ZGFiNWQzOGU3NWZiYWUyM2QwZDAzNTQ4N2EwYg==
6
+ NjVkNjkwNGE1ZTE0N2NmMTNjNzE3ZjExYWVkMjYwZjUzYTE3NjdjZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWY2YTZmYjY5OGVhMjNlYjEwZWQ0ZWM2MDBmYjNiMWUzNjBmYTY5NWQ1MzBi
10
- NDJiYTA0ZTA0NGQyM2ZkMmQ5YWMzZmFjYWIxMmJkOWEwYjJhZjE1Mzc0YWJj
11
- YmE4NzA2ZmJhOGNlMWMyNjEyMTUwNTEwMGE0YWI0MmYwMjE2YjQ=
9
+ NDQxMzVmNjk2YTM3NThjZWNkMjkxNDc5MzVlMWE2ZWIwZmZhOWU0ZjJhZTlj
10
+ MWYxZDZmM2RkNTFlNDJmM2FhNWIxZDJkODA4NTIyZjVhYzgzYmQ2NGY4Zjgy
11
+ MzBkMzg0ZmE3MjU5ODdjOTBhYjA0MGY1MTRiYjg2OThlZmEwMmY=
12
12
  data.tar.gz: !binary |-
13
- Mjk4YTUwYzNmMWJiNmZmYzU1NzY1YTc4ZWQxYzdhZDgyYjExODk2Y2M0ZmFm
14
- MDI0YTljODRkNjVjNTUyMjc5YjU3MDhmMTJhMDJjNGYyOTk3YmU4ZWRlNGZk
15
- ZGQ3NDFmNmRiZjgxMjdjZWRkNmI4YzFmZDk4NjJjYmRmNWJjOTc=
13
+ NTM0ZDExMTcyMTM4MGIyNzU1ZmRjM2RkZTY4NTU2NGUxYTJjYzQ5YzliZmEy
14
+ ZmVjMmVjMGQ1NWI2N2U5YjdhNTc2YWU1YmY4NmI5ZGQ0MWU4ZGQwMDM3ODcw
15
+ MjU3Njg3OTE1ZDAwZWMyMWE4ZjQ5ZTM2Mzk3ZTFmZTZmYTUzYTE=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gorgon (0.8.3)
4
+ gorgon (0.8.4)
5
5
  amqp (~> 1.1.0)
6
6
  awesome_print
7
7
  colorize (~> 0.5.8)
data/README.md CHANGED
@@ -21,7 +21,7 @@ Installing listener as a Daemon process (Ubuntu 9.10 or later)
21
21
  Gotchas
22
22
  ----------------------------------------------------------------
23
23
 
24
- * if you get `cannot load such file -- qrack/qrack (LoadError)`, just add `gem 'gorgon', '~> 0.4.1' , :group => :remote_test` to your Gemfile, and run tests using `bundle exec gorgon`
24
+ * if you get `cannot load such file -- qrack/qrack (LoadError)`, just add `gem 'gorgon', '~> 0.8.3' , :group => :remote_test` to your Gemfile, and run tests using `bundle exec gorgon`
25
25
  * If `gorgon install_listener` didn't work for you, you can try [these steps](/daemon_with_upstart_and_rvm.md)
26
26
 
27
27
  Also note that the steps in the tutorial are **not** meant to work on every project, they will only give you initial settings. You will probably have to modify the following files:
@@ -65,9 +65,6 @@ Credits
65
65
  Gorgon is maintained by:
66
66
  * Justin Fitzsimmons
67
67
  * Arturo Pie
68
- * Sean Kirby
69
- * Clemens Park
70
- * Victor Savkin
71
68
 
72
69
  Gorgon is funded by [Nulogy Corp](http://www.nulogy.com/).
73
70
  Thank you to all the [contributors](https://github.com/Fitzsimmons/Gorgon/contributors).
data/gorgon.json.sample CHANGED
@@ -2,34 +2,31 @@
2
2
  "connection": {
3
3
  "host": "localhost"
4
4
  },
5
-
5
+ "failed_files": "tmp/gorgon-failed-files.json",
6
6
  "file_server": {
7
7
  "host": "localhost"
8
8
  },
9
-
9
+ "files": [
10
+ "test/unit/**/*_test.rb",
11
+ "test/functional/**/*_test.rb",
12
+ "test/integration/**/*_test.rb"
13
+ ],
10
14
  "job": {
15
+ "callbacks": {
16
+ "callbacks_class_file": "test/gorgon_callbacks.rb"
17
+ }
11
18
  "sync": {
12
19
  "exclude": [
13
20
  ".git",
14
21
  ".rvmrc",
15
- "tmp",
22
+ "doc",
16
23
  "log",
17
- "doc"
24
+ "tmp"
18
25
  ],
19
26
 
20
27
  "rsync_transport": "ssh" // or "anonymous"
21
28
  },
22
-
23
- "callbacks": {
24
- "callbacks_class_file": "test/gorgon_callbacks.rb"
25
- }
26
29
  },
27
-
28
- "files": [
29
- "test/unit/**/*_test.rb",
30
- "test/functional/**/*_test.rb",
31
- "test/integration/**/*_test.rb"
32
- ],
33
- "runtime_file": "tmp/recorded_specs_list.json",
34
- "originator_log_file": "log/gorgon-orginator.log"
30
+ "originator_log_file": "log/gorgon-orginator.log",
31
+ "runtime_file": "gorgon-runtime-file.json"
35
32
  }
@@ -1,17 +1,20 @@
1
1
  require 'yajl'
2
2
 
3
3
  class FailuresPrinter
4
- OUTPUT_FILE = "/tmp/gorgon-failed-files.json"
4
+ DEFAULT_OUTPUT_FILE = "/tmp/gorgon-failed-files.json"
5
5
 
6
- def initialize job_state
6
+ attr_reader :output_file
7
+
8
+ def initialize(configuration, job_state)
7
9
  @job_state = job_state
8
10
  @job_state.add_observer(self)
11
+ @output_file = configuration.fetch(:failed_files) { DEFAULT_OUTPUT_FILE }
9
12
  end
10
13
 
11
14
  def update payload
12
15
  return unless @job_state.is_job_complete? || @job_state.is_job_cancelled?
13
16
 
14
- File.open(OUTPUT_FILE, 'w+') do |fd|
17
+ File.open(@output_file, 'w+') do |fd|
15
18
  fd.write(Yajl::Encoder.encode(failed_files + unfinished_files))
16
19
  end
17
20
  end
@@ -140,7 +140,7 @@ class Originator
140
140
  RuntimeRecorder.new @job_state, configuration[:runtime_file]
141
141
  @progress_bar_view = ProgressBarView.new @job_state
142
142
  @progress_bar_view.show
143
- FailuresPrinter.new @job_state
143
+ FailuresPrinter.new(configuration, @job_state)
144
144
  end
145
145
 
146
146
  def on_disconnect
@@ -1,7 +1,7 @@
1
1
  module Settings
2
2
  class FilesContent
3
3
  attr_accessor :amqp_host, :file_server_host, :sync_exclude, :files, :originator_log_file,
4
- :callbacks
4
+ :callbacks, :runtime_file, :failed_files
5
5
 
6
6
  TEST_UNIT_GLOB = "test/**/*_test.rb"
7
7
  RSPEC_GLOB = "spec/**/*_spec.rb"
@@ -10,6 +10,7 @@ module Settings
10
10
  @files = []
11
11
  @files << FilesContent::TEST_UNIT_GLOB if Dir.exist?('test')
12
12
  @files << FilesContent::RSPEC_GLOB if Dir.exist?('spec')
13
+ @runtime_file = 'gorgon-runtime-file.json'
13
14
  end
14
15
 
15
16
  DEFAULT_HOST = 'localhost'
@@ -31,19 +31,19 @@ module Settings
31
31
 
32
32
  config = {
33
33
  connection: {host: content.amqp_host},
34
+ failed_files: content.failed_files,
34
35
  file_server: {host: content.file_server_host},
36
+ files: content.files,
35
37
  job: {
36
38
  sync: {
37
39
  exclude: content.sync_exclude,
38
40
  rsync_transport: "ssh"
39
41
  }
40
42
  },
41
- files: content.files
43
+ originator_log_file: content.originator_log_file,
44
+ runtime_file: content.runtime_file,
42
45
  }
43
46
 
44
- log_file = content.originator_log_file
45
- config[:originator_log_file] = log_file if log_file
46
-
47
47
  if content.callbacks
48
48
  create_callback_file(content)
49
49
 
@@ -6,8 +6,9 @@ module Settings
6
6
  super
7
7
  @amqp_host = FilesContent.get_amqp_host
8
8
  @file_server_host = FilesContent.get_file_server_host
9
- @sync_exclude = [".git", ".rvmrc","tmp","log","doc"]
9
+ @sync_exclude = [".git", ".rvmrc","doc","log","tmp"]
10
10
  @originator_log_file = 'log/gorgon-originator.log'
11
+ @failed_files = 'tmp/gorgon-failed-files.json'
11
12
  create_callbacks
12
13
  end
13
14
 
@@ -8,6 +8,7 @@ module Settings
8
8
  @file_server_host = FilesContent.get_file_server_host
9
9
  @sync_exclude = [".git", ".rvmrc"]
10
10
  @originator_log_file = 'gorgon-originator.log'
11
+ @failed_files = 'gorgon-failed-files.json'
11
12
  end
12
13
  end
13
14
  end
@@ -1,3 +1,3 @@
1
1
  module Gorgon
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
@@ -8,7 +8,7 @@ describe FailuresPrinter do
8
8
  let(:fd) {double("File descriptor", :write => nil)}
9
9
 
10
10
  subject do
11
- FailuresPrinter.new(job_state)
11
+ FailuresPrinter.new({}, job_state)
12
12
  end
13
13
 
14
14
  it { should respond_to :update }
@@ -16,13 +16,13 @@ describe FailuresPrinter do
16
16
  describe "#initialize" do
17
17
  it "add its self to observers of job_state" do
18
18
  job_state.should_receive(:add_observer)
19
- FailuresPrinter.new job_state
19
+ FailuresPrinter.new({}, job_state)
20
20
  end
21
21
  end
22
22
 
23
23
  describe "#update" do
24
24
  before do
25
- @printer = FailuresPrinter.new job_state
25
+ @printer = FailuresPrinter.new({}, job_state)
26
26
  end
27
27
 
28
28
  context "job is not completed nor cancelled" do
@@ -36,10 +36,16 @@ describe FailuresPrinter do
36
36
  context "job is completed" do
37
37
  it "outputs failed tests return by job_state#each_failed_test" do
38
38
  job_state.stub(:each_failed_test).and_yield({:filename => "file1.rb"}).and_yield({:filename => "file2.rb"})
39
- File.should_receive(:open).with(FailuresPrinter::OUTPUT_FILE, 'w+').and_yield fd
39
+ File.should_receive(:open).with(FailuresPrinter::DEFAULT_OUTPUT_FILE, 'w+').and_yield fd
40
40
  fd.should_receive(:write).with(Yajl::Encoder.encode(["file1.rb", "file2.rb"]))
41
41
  @printer.update({})
42
42
  end
43
+
44
+ it "outputs failed tests to 'failed_files' in configuration" do
45
+ printer = FailuresPrinter.new({failed_files: 'a-file-somewhere.json'}, job_state)
46
+ File.should_receive(:open).with('a-file-somewhere.json', 'w+')
47
+ printer.update({})
48
+ end
43
49
  end
44
50
 
45
51
  context "job is cancelled" do
@@ -50,7 +56,7 @@ describe FailuresPrinter do
50
56
 
51
57
  it "outputs failed tests return by job_state#each_failed_test" do
52
58
  job_state.stub(:each_failed_test).and_yield({:filename => "file1.rb"}).and_yield({:filename => "file2.rb"})
53
- File.should_receive(:open).with(FailuresPrinter::OUTPUT_FILE, 'w+').and_yield fd
59
+ File.should_receive(:open).with(FailuresPrinter::DEFAULT_OUTPUT_FILE, 'w+').and_yield fd
54
60
  fd.should_receive(:write).once.with(Yajl::Encoder.encode(["file1.rb", "file2.rb"]))
55
61
  @printer.update({})
56
62
  end
data/tutorial.md CHANGED
@@ -21,7 +21,7 @@ Run `rspec` and make sure all tests pass.
21
21
 
22
22
  1. Install [RabbitMQ](https://www.rabbitmq.com/download.html).
23
23
 
24
- 2. Add Gorgon to the Gemfile: `gem 'gorgon', '0.8.1'`
24
+ 2. Add Gorgon to the Gemfile: `gem 'gorgon', '0.8.3'`
25
25
 
26
26
  3. `bundle`
27
27
 
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.8.3
4
+ version: 0.8.4
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: 2015-02-03 00:00:00.000000000 Z
15
+ date: 2015-02-16 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake