rspec-ordering-mttf 0.1.0 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +13 -3
- data/lib/rspec/ordering/mttf/example_result_data.rb +5 -1
- data/lib/rspec/ordering/mttf/version.rb +1 -1
- metadata +6 -7
- data/sig/rspec/ordering/mttf.rbs +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb159f1062fce11a07f8fde84f39bf46913ee274e35b0908a12a8ff746603428
|
4
|
+
data.tar.gz: 98506da60381b82450aa77fd92c2ea5a811ed35f13fc5389f0fc88a8236d7b5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9918d4cca84822ecdd39f4c843e4c19753e59514b6a6cc4d7b5a4f36cc14480835f7e3bd0d3ac083994526c70e1ecf38bb6372031cf8b254ddf1e9f04f9b273a
|
7
|
+
data.tar.gz: e952139fddca36e7a959d0bff10c8c3ec9f5e6a19ae5098b070157c81702eff7a7f67a609ca87c94d51337fe01ec3547e05ff729a6b44a560dd3a75ff8aa86a6
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,14 +4,18 @@ A custom orderer for RSpec that optimizes for test latency (mean time to failure
|
|
4
4
|
|
5
5
|
## Why would I want this?
|
6
6
|
|
7
|
-
If you do Test-Driven Development, you
|
7
|
+
If you do Test-Driven Development, you probably implement some version of this algorithm manually all the time. It's likely you have too many tests to run them all on every change, so you decide which tests to run based on those that are likely to fail and how quickly they run. This orderer uses a basic set of heuristics to automate that work:
|
8
8
|
|
9
9
|
1. Never-run tests first, in arbitrary order
|
10
10
|
1. Group remaining tests by the date at which they most recently failed.
|
11
11
|
1. Sort groups such that the most recent failure date is first, and never-failing tests are at the end.
|
12
12
|
1. Within a group, run the fastest tests first.
|
13
13
|
|
14
|
-
These heuristics are taken from [JUnitMax](https://junit.org/junit4/javadoc/latest/org/junit/experimental/max/MaxCore.html).
|
14
|
+
These heuristics are taken from [JUnitMax](https://junit.org/junit4/javadoc/latest/org/junit/experimental/max/MaxCore.html). In fact, this project is basically my attempt to port the core ordering functionality, as I understand it, to RSpec.
|
15
|
+
|
16
|
+
In practice, I encourage you to try running as large a subset of your tests as you reasonably can to let the tool gather runtime data. Then start TDDing and simply rerunning that large group. Use RSpec's `--fail-fast` option as well for the quickest feedback.
|
17
|
+
|
18
|
+
If you get strange failures, try deleting the history file (`.rspec-run-data.store` by default). Please feel free to report a bug or submit a fix!
|
15
19
|
|
16
20
|
## Installation
|
17
21
|
|
@@ -25,7 +29,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
25
29
|
|
26
30
|
## Usage
|
27
31
|
|
28
|
-
Call `RSpec::Ordering::Mttf.configure` with the RSpec configuration. This will configure a default global ordering of "mean time to failure."
|
32
|
+
Call `RSpec::Ordering::Mttf.configure` with the RSpec configuration. This will configure a default global ordering of "mean time to failure."
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
RSpec.configure do |config|
|
36
|
+
RSpec::Ordering::Mttf.configure(config)
|
37
|
+
end
|
38
|
+
```
|
29
39
|
|
30
40
|
## Development
|
31
41
|
|
@@ -44,7 +44,7 @@ module RSpec
|
|
44
44
|
@run_time = run_time
|
45
45
|
end
|
46
46
|
|
47
|
-
|
47
|
+
attr_accessor :status, :last_failed_date, :last_run_date, :run_time
|
48
48
|
|
49
49
|
def <=>(other)
|
50
50
|
if last_run_date.nil?
|
@@ -66,6 +66,10 @@ module RSpec
|
|
66
66
|
run_time <=> other.run_time
|
67
67
|
end
|
68
68
|
end
|
69
|
+
|
70
|
+
def members
|
71
|
+
[:status, :last_failed_date, :last_run_date, :run_time]
|
72
|
+
end
|
69
73
|
end
|
70
74
|
end
|
71
75
|
end
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-ordering-mttf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Duff
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2022-08-06 00:00:00.000000000 Z
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description:
|
27
|
+
description:
|
28
28
|
email:
|
29
29
|
- bduff@hey.com
|
30
30
|
executables: []
|
@@ -49,7 +49,6 @@ files:
|
|
49
49
|
- lib/rspec/ordering/mttf/run_results.rb
|
50
50
|
- lib/rspec/ordering/mttf/version.rb
|
51
51
|
- rspec-ordering-mttf.gemspec
|
52
|
-
- sig/rspec/ordering/mttf.rbs
|
53
52
|
homepage: https://github.com/brandonduff/rspec-ordering-mttf
|
54
53
|
licenses:
|
55
54
|
- MIT
|
@@ -57,7 +56,7 @@ metadata:
|
|
57
56
|
homepage_uri: https://github.com/brandonduff/rspec-ordering-mttf
|
58
57
|
source_code_uri: https://github.com/brandonduff/rspec-ordering-mttf
|
59
58
|
changelog_uri: https://github.com/brandonduff/rspec-ordering-mttf/blob/main/changelog.md
|
60
|
-
post_install_message:
|
59
|
+
post_install_message:
|
61
60
|
rdoc_options: []
|
62
61
|
require_paths:
|
63
62
|
- lib
|
@@ -72,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
71
|
- !ruby/object:Gem::Version
|
73
72
|
version: '0'
|
74
73
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
74
|
+
rubygems_version: 3.3.13
|
75
|
+
signing_key:
|
77
76
|
specification_version: 4
|
78
77
|
summary: Order tests optimizing for Mean Time to Failure
|
79
78
|
test_files: []
|