what_to_run 0.0.1.pre → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/README.md +2 -0
- data/Rakefile +12 -0
- data/ext/coverage_peeker/coverage_peeker.c +43 -0
- data/lib/coverage_peeker.rb +2 -2
- data/lib/what_to_run/rspec.rb +2 -0
- metadata +32 -11
- data/lib/coverage_peeker/coverage_peeker.bundle +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NWI3ZjRiMTMzYmQ5YzA0NmM4NjJkNTViM2VkOTJkZTI2NDQxNmE4MQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MmE2Yzc1YWVhMjA3NDliZjk4YTQ5NzdlNjljNTg4NzZjMjBjODM1Mg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmY3Yzk3ZmY1ZmMwMTMzNTc3ZWYyYzRjNjU5NjVhODY0NmNkODI2MTM4YzJi
|
10
|
+
NGNjYTRhNTg5MjRkMTdhY2NhNWNhYjBhZDE4M2VjYjEwOTI1MTJhNWFiNWRh
|
11
|
+
NDAxNjFiMjc1NDUyYTI0YTllYzBlNTk0NmQ2MWQ2MWYyM2NiMmQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZGZmMzBiYjZkZmUzMzcxNDZhZWU5MjgxZTAwMDQwMjAwOGY0MTQwZTliMDdm
|
14
|
+
MmNjNjczNTdlN2YzNjg5YWUyZWFlYzkwZTlhMTIwMWY0YWQ1MDk1MjRhNjY0
|
15
|
+
MmIxYzM3M2NjYWYxYTM3OTM4ZTgzOTNhOGRlOWRkY2JhYjQzNjI=
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# What To Run
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/DyegoCosta/what_to_run.svg?branch=master)](https://travis-ci.org/DyegoCosta/what_to_run)
|
4
|
+
|
3
5
|
What To Run is a lib for regression test selection, use it to predict which tests you should run when you make any modification on your codebase.
|
4
6
|
|
5
7
|
This lib is based on [@tenderlove](https://github.com/tenderlove) idea and guidance, make sure to read his [blog post](http://tenderlovemaking.com/2015/02/13/predicting-test-failues.html) on the subject.
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require 'rake/extensiontask'
|
3
|
+
|
4
|
+
Rake::ExtensionTask.new('coverage_peeker') do |ext|
|
5
|
+
ext.lib_dir = 'lib/coverage_peeker'
|
6
|
+
end
|
7
|
+
|
8
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
|
+
|
10
|
+
Rake::Task[:spec].prerequisites << :compile
|
11
|
+
|
12
|
+
task :default => :spec
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#include <ruby.h>
|
2
|
+
|
3
|
+
VALUE CoveragePeeker = Qnil;
|
4
|
+
|
5
|
+
extern VALUE rb_get_coverages(void);
|
6
|
+
|
7
|
+
static int
|
8
|
+
coverage_peek_result_i(st_data_t key, st_data_t val, st_data_t h)
|
9
|
+
{
|
10
|
+
VALUE path = (VALUE)key;
|
11
|
+
VALUE coverage = (VALUE)val;
|
12
|
+
VALUE coverages = (VALUE)h;
|
13
|
+
coverage = rb_ary_dup(coverage);
|
14
|
+
rb_ary_freeze(coverage);
|
15
|
+
rb_hash_aset(coverages, path, coverage);
|
16
|
+
return ST_CONTINUE;
|
17
|
+
}
|
18
|
+
|
19
|
+
/*
|
20
|
+
* call-seq:
|
21
|
+
* Coverage.peek_result => hash
|
22
|
+
*
|
23
|
+
* Returns a hash that contains filename as key and coverage array as value.
|
24
|
+
*/
|
25
|
+
static VALUE
|
26
|
+
rb_coverage_peek_result(VALUE klass)
|
27
|
+
{
|
28
|
+
VALUE coverages = rb_get_coverages();
|
29
|
+
VALUE ncoverages = rb_hash_new();
|
30
|
+
if (!RTEST(coverages)) {
|
31
|
+
rb_raise(rb_eRuntimeError, "coverage measurement is not enabled");
|
32
|
+
}
|
33
|
+
st_foreach(RHASH_TBL(coverages), coverage_peek_result_i, ncoverages);
|
34
|
+
rb_hash_freeze(ncoverages);
|
35
|
+
return ncoverages;
|
36
|
+
}
|
37
|
+
|
38
|
+
void
|
39
|
+
Init_coverage_peeker(void)
|
40
|
+
{
|
41
|
+
VALUE rb_mCoveragePeeker = rb_define_module("CoveragePeeker");
|
42
|
+
rb_define_module_function(rb_mCoveragePeeker, "peek_result", rb_coverage_peek_result, 0);
|
43
|
+
}
|
data/lib/coverage_peeker.rb
CHANGED
data/lib/what_to_run/rspec.rb
CHANGED
@@ -13,7 +13,9 @@ RSpec.configuration.after(:suite) {
|
|
13
13
|
|
14
14
|
RSpec.configuration.around(:example) do |example|
|
15
15
|
before = CoveragePeeker.peek_result
|
16
|
+
puts 'before:' + before.object_id.to_s
|
16
17
|
example.call
|
17
18
|
after = CoveragePeeker.peek_result
|
19
|
+
puts 'after:' + after.object_id.to_s
|
18
20
|
LOGS << [ example.full_description, before, after ]
|
19
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: what_to_run
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -11,24 +11,44 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2015-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake-compiler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.9'
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.9.0
|
24
|
+
type: :development
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.9'
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.9.0
|
14
34
|
- !ruby/object:Gem::Dependency
|
15
35
|
name: rugged
|
16
36
|
requirement: !ruby/object:Gem::Requirement
|
17
37
|
requirements:
|
18
|
-
- -
|
38
|
+
- - ~>
|
19
39
|
- !ruby/object:Gem::Version
|
20
40
|
version: '0.21'
|
21
|
-
- -
|
41
|
+
- - ! '>='
|
22
42
|
- !ruby/object:Gem::Version
|
23
43
|
version: 0.21.0
|
24
44
|
type: :runtime
|
25
45
|
prerelease: false
|
26
46
|
version_requirements: !ruby/object:Gem::Requirement
|
27
47
|
requirements:
|
28
|
-
- -
|
48
|
+
- - ~>
|
29
49
|
- !ruby/object:Gem::Version
|
30
50
|
version: '0.21'
|
31
|
-
- -
|
51
|
+
- - ! '>='
|
32
52
|
- !ruby/object:Gem::Version
|
33
53
|
version: 0.21.0
|
34
54
|
description: Predict which tests are likely to fail after you’ve changed the code
|
@@ -40,10 +60,11 @@ extensions:
|
|
40
60
|
extra_rdoc_files: []
|
41
61
|
files:
|
42
62
|
- README.md
|
63
|
+
- Rakefile
|
43
64
|
- bin/what_to_run
|
65
|
+
- ext/coverage_peeker/coverage_peeker.c
|
44
66
|
- ext/coverage_peeker/extconf.rb
|
45
67
|
- lib/coverage_peeker.rb
|
46
|
-
- lib/coverage_peeker/coverage_peeker.bundle
|
47
68
|
- lib/what_to_run.rb
|
48
69
|
- lib/what_to_run/minitest.rb
|
49
70
|
- lib/what_to_run/rspec.rb
|
@@ -57,17 +78,17 @@ require_paths:
|
|
57
78
|
- lib
|
58
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
80
|
requirements:
|
60
|
-
- -
|
81
|
+
- - ! '>='
|
61
82
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
83
|
+
version: 1.9.3
|
63
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
85
|
requirements:
|
65
|
-
- -
|
86
|
+
- - ! '>='
|
66
87
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
88
|
+
version: '0'
|
68
89
|
requirements: []
|
69
90
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.4.6
|
71
92
|
signing_key:
|
72
93
|
specification_version: 4
|
73
94
|
summary: Regression test selection
|
Binary file
|