priority_test 0.0.2 → 0.0.3
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/.travis.yml +8 -0
- data/LICENSE +21 -0
- data/README.md +12 -6
- data/Rakefile +3 -6
- data/lib/priority_test/core/option_parser.rb +6 -8
- data/lib/priority_test/core/test.rb +2 -2
- data/lib/priority_test/version.rb +1 -1
- data/priority_test.gemspec +5 -1
- data/spec/spec_helper.rb +3 -5
- metadata +108 -40
data/.travis.yml
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2012 Jingwen Owen Ou
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
PriorityTest
|
2
2
|
============
|
3
3
|
|
4
|
-
|
4
|
+
[](http://travis-ci.org/jingweno/priority_test)
|
5
|
+
|
6
|
+
## DESCRIPTION
|
5
7
|
|
6
8
|
PriorityTest is a gem that delivers fast feedback for your tests by
|
7
9
|
prioritizing them.
|
@@ -14,20 +16,20 @@ It prioritizes tests based on two assumptions discovered by [Kent Beck](https://
|
|
14
16
|
PriorityTest inherits from these two assumptions with a simple
|
15
17
|
algorithm and prioritizes your tests by looking at the test running history.
|
16
18
|
|
17
|
-
|
19
|
+
## ALGORITHM
|
18
20
|
|
19
21
|
PriorityTest captures and stores your test running hisotry.
|
20
22
|
Before each test runs, it looks back X number of the previous test results to calculate the test's Degree of Significant (DoS).
|
21
23
|
It then prioritizes the running order of all the tests based on each test's DoS.
|
22
24
|
Two factors determines a test's DoS: test run time and recent failure times.
|
23
25
|
|
24
|
-
|
26
|
+
## INSTALLATION
|
25
27
|
|
26
|
-
|
28
|
+
### RubyGems
|
27
29
|
|
28
30
|
[sudo] gem install priority_test
|
29
31
|
|
30
|
-
|
32
|
+
### RSpec
|
31
33
|
|
32
34
|
In your ```Gemfile```, insert the following line:
|
33
35
|
|
@@ -41,7 +43,7 @@ In ```spec_helper.rb```, require the RSpec adapter:
|
|
41
43
|
require 'priority_test/rspec'
|
42
44
|
```
|
43
45
|
|
44
|
-
|
46
|
+
## USAGE
|
45
47
|
|
46
48
|
Getting help:
|
47
49
|
|
@@ -71,3 +73,7 @@ Directly passing arguments to RSpec:
|
|
71
73
|
Run tests in a Rake task:
|
72
74
|
|
73
75
|
$ rake spec PT_OPTS="--priority"
|
76
|
+
|
77
|
+
## LICENSE
|
78
|
+
|
79
|
+
See LICENSE.
|
data/Rakefile
CHANGED
@@ -55,12 +55,9 @@ RSpec::Core::RakeTask.new(:rcov) do |t|
|
|
55
55
|
t.rcov_opts = '--exclude /gems/,/Library/,/usr/,lib/tasks,.bundle,config,/lib/rspec/,/lib/rspec-,spec'
|
56
56
|
end
|
57
57
|
|
58
|
-
require '
|
59
|
-
Rake::
|
60
|
-
|
61
|
-
rdoc.title = "#{name} #{version}"
|
62
|
-
rdoc.rdoc_files.include('README*')
|
63
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
58
|
+
require 'yard'
|
59
|
+
YARD::Rake::YardocTask.new do |t|
|
60
|
+
t.files = ['lib/**/*.rb']
|
64
61
|
end
|
65
62
|
|
66
63
|
desc "Open an irb session preloaded with this library"
|
@@ -10,15 +10,15 @@ module PriorityTest
|
|
10
10
|
new.parse!(args)
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.parse_options(args)
|
14
|
-
new.parse_options(args)
|
15
|
-
end
|
16
|
-
|
17
13
|
def parse_options(args)
|
18
|
-
return {} if args.empty?
|
19
|
-
|
20
14
|
options = {}
|
21
15
|
opts_parser = parser(options)
|
16
|
+
|
17
|
+
if args.empty?
|
18
|
+
puts opts_parser
|
19
|
+
return options
|
20
|
+
end
|
21
|
+
|
22
22
|
begin
|
23
23
|
opts_parser.parse!(args.clone)
|
24
24
|
rescue ::OptionParser::InvalidOption
|
@@ -30,8 +30,6 @@ module PriorityTest
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def parse!(args)
|
33
|
-
return {} if args.empty?
|
34
|
-
|
35
33
|
options = parse_options(args)
|
36
34
|
options[:test_framework] = parse_test_framework(args)
|
37
35
|
|
@@ -15,8 +15,8 @@ module PriorityTest
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def <=>(other)
|
18
|
-
result = (priority <=> other.priority)
|
19
|
-
result = (avg_run_time <=> other.avg_run_time) if result == 0 || !result
|
18
|
+
result = (priority <=> other.priority) if priority && other.priority
|
19
|
+
result = (avg_run_time <=> other.avg_run_time) if (result == 0 || !result) && avg_run_time && other.avg_run_time
|
20
20
|
result
|
21
21
|
end
|
22
22
|
|
data/priority_test.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'priority_test/version'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "priority_test"
|
7
7
|
s.version = PriorityTest::VERSION
|
8
|
-
s.authors = ["Owen Ou"]
|
8
|
+
s.authors = ["Jingwen Owen Ou"]
|
9
9
|
s.email = ["jingweno@gmail.com"]
|
10
10
|
s.homepage = ""
|
11
11
|
s.summary = %q{Run tests in priority}
|
@@ -19,5 +19,9 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_runtime_dependency "sequel"
|
22
|
+
s.add_runtime_dependency "sqlite3"
|
23
|
+
|
24
|
+
s.add_development_dependency "rake"
|
22
25
|
s.add_development_dependency "rspec"
|
26
|
+
s.add_development_dependency "yard"
|
23
27
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
ENV['PRIORITY_TEST_ENV'] = 'test'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require_path 'rspec2'
|
7
|
-
end
|
3
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
4
|
+
require 'priority_test'
|
5
|
+
require_path 'rspec2'
|
8
6
|
|
9
7
|
Dir[File.expand_path("support/**/*.rb", File.dirname(__FILE__))].each {|f| require f}
|
10
8
|
|
metadata
CHANGED
@@ -1,50 +1,108 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: priority_test
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
- Owen Ou
|
12
|
+
authors:
|
13
|
+
- Jingwen Owen Ou
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-01-09 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
type: :runtime
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
23
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
requirement: *id001
|
32
|
+
prerelease: false
|
33
|
+
name: sequel
|
34
|
+
- !ruby/object:Gem::Dependency
|
22
35
|
type: :runtime
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 3
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
requirement: *id002
|
23
46
|
prerelease: false
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
|
27
|
-
|
47
|
+
name: sqlite3
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
type: :development
|
50
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
28
51
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
requirement: *id003
|
60
|
+
prerelease: false
|
61
|
+
name: rake
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
type: :development
|
64
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
version: "0"
|
73
|
+
requirement: *id004
|
74
|
+
prerelease: false
|
75
|
+
name: rspec
|
76
|
+
- !ruby/object:Gem::Dependency
|
33
77
|
type: :development
|
78
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
version: "0"
|
87
|
+
requirement: *id005
|
34
88
|
prerelease: false
|
35
|
-
|
89
|
+
name: yard
|
36
90
|
description: Run tests in priority
|
37
|
-
email:
|
91
|
+
email:
|
38
92
|
- jingweno@gmail.com
|
39
|
-
executables:
|
93
|
+
executables:
|
40
94
|
- pt
|
41
95
|
extensions: []
|
96
|
+
|
42
97
|
extra_rdoc_files: []
|
43
|
-
|
98
|
+
|
99
|
+
files:
|
44
100
|
- .gitignore
|
45
101
|
- .rspec
|
46
102
|
- .rvmrc
|
103
|
+
- .travis.yml
|
47
104
|
- Gemfile
|
105
|
+
- LICENSE
|
48
106
|
- README.md
|
49
107
|
- Rakefile
|
50
108
|
- bin/pt
|
@@ -89,31 +147,40 @@ files:
|
|
89
147
|
- spec/rspec2/formatter_spec.rb
|
90
148
|
- spec/spec_helper.rb
|
91
149
|
- spec/support/rspec_factory.rb
|
92
|
-
homepage:
|
150
|
+
homepage: ""
|
93
151
|
licenses: []
|
152
|
+
|
94
153
|
post_install_message:
|
95
154
|
rdoc_options: []
|
96
|
-
|
155
|
+
|
156
|
+
require_paths:
|
97
157
|
- lib
|
98
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
159
|
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: 3
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
168
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
hash: 3
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
version: "0"
|
110
176
|
requirements: []
|
177
|
+
|
111
178
|
rubyforge_project: priority_test
|
112
|
-
rubygems_version: 1.8.
|
179
|
+
rubygems_version: 1.8.6
|
113
180
|
signing_key:
|
114
181
|
specification_version: 3
|
115
182
|
summary: Run tests in priority
|
116
|
-
test_files:
|
183
|
+
test_files:
|
117
184
|
- spec/core/all_tests_spec.rb
|
118
185
|
- spec/core/config_spec.rb
|
119
186
|
- spec/core/configuration_options_spec.rb
|
@@ -126,3 +193,4 @@ test_files:
|
|
126
193
|
- spec/rspec2/formatter_spec.rb
|
127
194
|
- spec/spec_helper.rb
|
128
195
|
- spec/support/rspec_factory.rb
|
196
|
+
has_rdoc:
|