specjour 2.0.0.rc1 → 2.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b2e786f14b5e926503fdadd4a4504fc188ded2c
4
- data.tar.gz: e2de43dfdccc720d0befdad67fd51ffc239cc63a
3
+ metadata.gz: 25c6007ab5a18e0e75c6b75121fe1c4a1c08792e
4
+ data.tar.gz: b754110e3ba182341e0cf88fc3a9b0aeb7c76ed6
5
5
  SHA512:
6
- metadata.gz: 0228128342542bf82575bcbd36a1a00e42852dec83735dbdb1b46186647eec849b11cb7fae53294b6087250af505ac28a60b7406f38926133e4eb1b6ffe8f195
7
- data.tar.gz: 1db0922eac8c9552bade26f9669bc9149393e780741ffb4d359d70a598d83c322ba250ad2fb61de783926a24c628436ff76e6f241d39e6f18561f2d59027b2bc
6
+ metadata.gz: f46ab3c33f34934a834adc13fd4a8b0c76f4bf1840c7beb2ec266310328d7fea663a5ec99489628d4f757733cd04c735e3deaeab6e3f877cf2ec73d976dfdca6
7
+ data.tar.gz: 3d26b413944d6c04bfb5615db696bc197ef15ee6d3b1a130340cc8990b8085b6a67700f5be0da48ea73f4b40739087e6277a2996a580ad0a8da4961788d6d1c9
data/History.markdown CHANGED
@@ -1,6 +1,24 @@
1
1
  History
2
2
  =======
3
3
 
4
+ 2.0.0 (v2)
5
+ ----------
6
+ * Specjour always starts a listener daemon unless one is already running. This means you're always sharing your cores by default.
7
+ * `specjour stop` stops the daemon running for the current project
8
+ * Your machine will share half available cores when running tests for a remote machine. This enables you to continue working while sharing your cpu.
9
+ * The listener can be run in the foreground with `specjour -f listen`.
10
+ * A constant number of workers can be set by the `-w` flag. Use this to set up a daemon on a machine devoted to specjour: `nohup specjour listen -w 4`
11
+ * Failing tests will be rerun after the suite completes. Disable with: `Specjour.configuration.rspec_rerun = false`
12
+ * The bonjour register/browse design has been flipped. Now, the listeners synchronously browse while the printer asynchronously advertises. This allows a listener to join the workers midway through a test run.
13
+ * You can run specjour on a single file, wherein all examples in the file will be distributed.
14
+ * Rspec and Rails are now treated as plugins. The plugins system is still a little rough, but should allow for adapting specjour to other testin frameworks like minitest and cucumber.
15
+ * Specjour uses its own formatter, instead of reusing an rspec formatter. The formatter is configurable which allows plugin authors to create the fomatter which best suits them.
16
+ * Specjour now launches a separate listener per project. This supports running specjour on two or more projects that have different Ruby versions.
17
+ * Removed the dependency on DRB.
18
+ * Removed the dependency on thor.
19
+ * Introduce a global specjour directory ($HOME/.specjour) to hold the lock file and daemon pids
20
+
21
+
4
22
  0.7.1 / (master)
5
23
  ---------------------------
6
24
  * [fixed] printer exit\_status returns false if there are no reporters
@@ -15,6 +15,7 @@ module Specjour
15
15
  backtrace_exclusion_pattern: DEFAULT_BACKTRACE_EXCLUSION,
16
16
  formatter: Formatter.new,
17
17
  full_backtrace: false,
18
+ global_path: File.join("#{ENV['HOME']}", ".specjour"),
18
19
  printer_port: nil,
19
20
  printer_uri: nil,
20
21
  project_aliases: [],
@@ -1,6 +1,5 @@
1
1
  module Specjour
2
2
  class Formatter
3
- require 'json'
4
3
  include Colors
5
4
  # description, status [pending,failed,passed] file_path, line_number, exception => [class, message, backtrace]
6
5
 
@@ -1,6 +1,7 @@
1
1
  module Specjour
2
2
  class Listener
3
3
  require 'dnssd'
4
+ require 'fileutils'
4
5
  Thread.abort_on_exception = true
5
6
 
6
7
  LOCK_FILE = "listener.lock"
@@ -37,7 +38,7 @@ module Specjour
37
38
 
38
39
  def config_directory
39
40
  return @config_directory if @config_directory
40
- @config_directory = File.join(Dir.tmpdir, "specjour")
41
+ @config_directory = Specjour.configuration.global_path
41
42
  FileUtils.mkdir_p @config_directory
42
43
  @config_directory
43
44
  end
@@ -69,25 +70,32 @@ module Specjour
69
70
  end
70
71
  end
71
72
 
73
+ def resolve(reply)
74
+ Timeout.timeout(2) do
75
+ DNSSD.resolve!(reply.name, reply.type, reply.domain, flags=0, reply.interface) do |resolved|
76
+ log "Bonjour discovered #{resolved.target} #{resolved.text_record.inspect}"
77
+ if resolved.text_record && resolved.text_record['version'] == Specjour::VERSION
78
+ if available_for?(resolved.text_record['project_alias'].to_s)
79
+ resolved_ip = ip_from_hostname(resolved.target)
80
+ uri = URI::Generic.build :host => resolved_ip, :port => resolved.port
81
+ add_printer(name: resolved.name, uri: uri, ip: resolved_ip)
82
+ else
83
+ $stderr.puts "Found #{resolved.target} but not listening to project alias: #{resolved.text_record['project_alias']}. Skipping..."
84
+ end
85
+ else
86
+ $stderr.puts "Found #{resolved.target} but its version doesn't match v#{Specjour::VERSION}. Skipping..."
87
+ end
88
+ break
89
+ end
90
+ end
91
+ rescue TimeoutError
92
+ end
93
+
72
94
  def gather
73
95
  @dnssd_service = DNSSD.browse!('_specjour._tcp') do |reply|
74
96
  log ['reply', reply.name, reply.service_name, reply.domain,reply.flags, reply.interface]
75
97
  if reply.flags.add?
76
- DNSSD.resolve!(reply.name, reply.type, reply.domain, flags=0, reply.interface) do |resolved|
77
- log "Bonjour discovered #{resolved.target} #{resolved.text_record.inspect}"
78
- if resolved.text_record && resolved.text_record['version'] == Specjour::VERSION
79
- if available_for?(resolved.text_record['project_alias'].to_s)
80
- resolved_ip = ip_from_hostname(resolved.target)
81
- uri = URI::Generic.build :host => resolved_ip, :port => resolved.port
82
- add_printer(name: resolved.name, uri: uri, ip: resolved_ip)
83
- else
84
- $stderr.puts "Found #{resolved.target} but not listening to project alias: #{resolved.text_record['project_alias']}. Skipping..."
85
- end
86
- else
87
- $stderr.puts "Found #{resolved.target} but its version doesn't match v#{Specjour::VERSION}. Skipping..."
88
- end
89
- break
90
- end
98
+ resolve(reply)
91
99
  break if printer
92
100
  else
93
101
  log "REMOVING #{reply.name} #{reply}"
@@ -1,6 +1,5 @@
1
1
  module Specjour
2
2
  module Protocol
3
- require 'json'
4
3
 
5
4
  def recv_data
6
5
  bytes = socket.gets.to_i
data/lib/specjour.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'tmpdir'
2
-
3
1
  autoload :URI, 'uri'
4
2
  autoload :Forwardable, 'forwardable'
5
3
  autoload :Timeout, 'timeout'
@@ -35,7 +33,7 @@ module Specjour
35
33
  autoload :Cucumber, 'specjour/cucumber'
36
34
  autoload :RSpec, 'specjour/rspec'
37
35
 
38
- VERSION ||= "2.0.0.rc1"
36
+ VERSION ||= "2.0.0.rc2"
39
37
  HOOKS_PATH ||= "./.specjour/hooks.rb"
40
38
  PROGRAM_NAME ||= $PROGRAM_NAME # keep a reference of the original program name
41
39
  Time = Time.dup
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specjour
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc1
4
+ version: 2.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Turriate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnssd
@@ -160,3 +160,4 @@ signing_key:
160
160
  specification_version: 4
161
161
  summary: Distribute your spec suite amongst your LAN via Bonjour.
162
162
  test_files: []
163
+ has_rdoc: