lab_bench 0.3.0 → 0.3.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.
- data/README.rdoc +3 -2
- data/VERSION +1 -1
- data/assets/js/app.js +2 -2
- data/lab_bench.gemspec +2 -2
- data/lib/lab_bench/test_runner.rb +29 -21
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -23,6 +23,8 @@ Send your browser to http://localhost:9020/ then run your tests like this:
|
|
23
23
|
== TODO
|
24
24
|
|
25
25
|
* Give me more context on the test suite (names of files being run, command line, project directory, etc)
|
26
|
+
* Trim dependencies, or break into two gems (client / server) so we can minimize the number of dependencies we pull into the test runner
|
27
|
+
* Rails 3 compatability
|
26
28
|
* Allow me to rerun a suite
|
27
29
|
* Allow me to rerun a test
|
28
30
|
* Allow me to rerun all failed tests within a suite
|
@@ -43,6 +45,5 @@ Send your browser to http://localhost:9020/ then run your tests like this:
|
|
43
45
|
|
44
46
|
== Copyright
|
45
47
|
|
46
|
-
Copyright (c) 2010 Bradley Buda. See LICENSE.txt for
|
47
|
-
further details.
|
48
|
+
Copyright (c) 2010 Bradley Buda. See LICENSE.txt for further details.
|
48
49
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/assets/js/app.js
CHANGED
@@ -72,8 +72,8 @@ head.ready(function(){
|
|
72
72
|
return false;
|
73
73
|
});
|
74
74
|
|
75
|
-
// TODO
|
76
|
-
var socket = new WebSocket('ws://
|
75
|
+
// TODO any way to detect the hostname from the current page context, or construct a relative URI?
|
76
|
+
var socket = new WebSocket('ws://0.0.0.0:9021/');
|
77
77
|
|
78
78
|
var suites = {};
|
79
79
|
|
data/lab_bench.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{lab_bench}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bradley Buda"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-09}
|
13
13
|
s.default_executable = %q{lab_bench_server}
|
14
14
|
s.description = %q{Like autotest, but in your browser. Currently unsuitable for use by anyone.}
|
15
15
|
s.email = %q{bradleybuda@gmail.com}
|
@@ -8,34 +8,44 @@ class LabBench::TestRunner < Test::Unit::UI::Console::TestRunner
|
|
8
8
|
def initialize(*args)
|
9
9
|
super(*args)
|
10
10
|
|
11
|
-
|
11
|
+
# TODO which info do we want to extract from the test suite
|
12
|
+
# suite has a name, and an array of tests
|
13
|
+
# looks like the tests can recursively be either suites, or test instances (subclasses of TestCase?)
|
14
|
+
# or should be be looking at rake? do we even know about rake here, or is this in a non rake-y subprocess?
|
15
|
+
# it's probably in a rake_test_loader.rb process
|
16
|
+
# what info do we need to persist and remanufacture the suite?
|
17
|
+
STDERR.puts @suite.inspect
|
18
|
+
|
19
|
+
if @lab_bench_enabled = mothership_alive?
|
20
|
+
STDERR.puts "LabBench enabled - go to http://0.0.0.0:9020/ to see test results"
|
21
|
+
else
|
22
|
+
STDERR.puts "WARNING - could not detect LabBench server. Run lab_bench_server to start it."
|
23
|
+
end
|
24
|
+
|
12
25
|
@guid = "suite_#{rand(2**64).to_s}"
|
13
26
|
end
|
14
27
|
|
15
28
|
private
|
16
29
|
|
17
30
|
def attach_to_mediator
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
31
|
+
if @lab_bench_enabled
|
32
|
+
# Add listeners for the five main testing events and relay then to the server
|
33
|
+
[
|
34
|
+
Test::Unit::UI::TestRunnerMediator::STARTED,
|
35
|
+
Test::Unit::UI::TestRunnerMediator::FINISHED,
|
36
|
+
Test::Unit::TestResult::FAULT,
|
37
|
+
Test::Unit::TestCase::STARTED,
|
38
|
+
Test::Unit::TestCase::FINISHED,
|
39
|
+
].each do |event|
|
40
|
+
@mediator.add_listener(event) do |*args|
|
41
|
+
Net::HTTP.post_form(mothership_uri('test_event'), {:event => event, :args => args, :guid => @guid})
|
42
|
+
end
|
28
43
|
end
|
29
44
|
end
|
30
|
-
|
45
|
+
|
31
46
|
super
|
32
47
|
end
|
33
48
|
|
34
|
-
def connect_to_mothership
|
35
|
-
# TODO probably don't want to abort tests if can't connect, maybe just warn
|
36
|
-
raise 'could not communicate with mothership' unless mothership_alive?
|
37
|
-
end
|
38
|
-
|
39
49
|
def mothership_alive?
|
40
50
|
Net::HTTP.get(mothership_uri('ping'))
|
41
51
|
true
|
@@ -43,14 +53,12 @@ class LabBench::TestRunner < Test::Unit::UI::Console::TestRunner
|
|
43
53
|
false
|
44
54
|
end
|
45
55
|
|
46
|
-
# TODO memoize
|
47
56
|
def mothership_uri(method)
|
48
|
-
URI.parse("http://
|
57
|
+
URI.parse("http://0.0.0.0:9020/#{method}")
|
49
58
|
end
|
50
|
-
|
51
59
|
end
|
52
60
|
|
53
|
-
# Register myself
|
61
|
+
# Register myself on load
|
54
62
|
require 'test/unit/autorunner'
|
55
63
|
Test::Unit::AutoRunner::RUNNERS[:lab_bench] = proc do |r|
|
56
64
|
LabBench::TestRunner
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lab_bench
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bradley Buda
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-09 00:00:00 -08:00
|
19
19
|
default_executable: lab_bench_server
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|