sfb_scripts 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sfb_scripts/dependency_loader.rb +2 -0
- data/lib/sfb_scripts/needs_manager.rb +1 -1
- data/lib/sfb_scripts/repositories/repo.rb +1 -0
- data/lib/sfb_scripts/test_running/status_checker.rb +2 -2
- data/lib/sfb_scripts/test_running/status_test_runner.rb +11 -8
- data/lib/sfb_scripts/test_running/test_collection.rb +1 -0
- data/lib/sfb_scripts/test_running/test_filter.rb +15 -0
- data/lib/sfb_scripts/test_running/test_finder.rb +1 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aab86c1ecf4b9c1691a7a4e686c823c10f9b6c36
|
4
|
+
data.tar.gz: b8ad1717e0cc3bbe363db504efb78e655c870d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1765662a968df5a669370bf54287973a8b7726e921e6f1cd809b750387edc3ef39c904f5f5fdc9b8f0bed37e13c95acf87de5e28fb71de23ef27784a81626012
|
7
|
+
data.tar.gz: 09179f2e6c970043af511743ec2a6ca46793850dc1fb7acb092bcdd251351bb4d3d52e02501d04bfe6f1e5b9dfb4d724765da1392d0ad9828bce06765d34a04f
|
@@ -4,6 +4,7 @@ require 'work_queue'
|
|
4
4
|
require_relative 'monkey_patches/string_extension'
|
5
5
|
require_relative 'bundler/bundle_manager'
|
6
6
|
require_relative 'hooks/pre_push_hook'
|
7
|
+
require_relative 'hook_manager'
|
7
8
|
require_relative 'migrations/migrator'
|
8
9
|
require_relative 'repositories/repo'
|
9
10
|
require_relative 'repositories/active_repo'
|
@@ -17,4 +18,5 @@ require_relative 'test_running/test_collection'
|
|
17
18
|
require_relative 'test_running/status_test_runner'
|
18
19
|
require_relative 'test_running/test_runner'
|
19
20
|
require_relative 'test_running/test_finder'
|
21
|
+
require_relative 'test_running/test_filter'
|
20
22
|
require_relative 'folder_guard'
|
@@ -37,11 +37,11 @@ class StatusChecker
|
|
37
37
|
private
|
38
38
|
|
39
39
|
def test_files
|
40
|
-
|
40
|
+
TestFilter.select_tests(file_names)
|
41
41
|
end
|
42
42
|
|
43
43
|
def non_test_files
|
44
|
-
|
44
|
+
TestFilter.reject_tests(file_names)
|
45
45
|
end
|
46
46
|
|
47
47
|
def file_names
|
@@ -4,35 +4,38 @@ class StatusTestRunner
|
|
4
4
|
new(env, ignore_selenium).status
|
5
5
|
end
|
6
6
|
|
7
|
-
attr_reader :repo, :shell, :test_runner, :
|
7
|
+
attr_reader :repo, :shell, :test_runner, :status_tests, :ignore_selenium
|
8
8
|
def initialize(env, ignore_selenium)
|
9
9
|
@repo = env[:repo]
|
10
10
|
@shell = env[:shell]
|
11
11
|
@test_runner = env[:test_runner]
|
12
12
|
@ignore_selenium = ignore_selenium
|
13
|
+
@status_tests = get_status_tests
|
13
14
|
end
|
14
15
|
|
15
16
|
def status
|
16
|
-
|
17
|
-
@tests = TestCollection.new(files)
|
18
|
-
|
19
|
-
if tests.include_selenium?
|
17
|
+
if status_tests.include_selenium?
|
20
18
|
handle_selenium
|
21
19
|
end
|
22
20
|
|
23
|
-
if
|
21
|
+
if status_tests.empty?
|
24
22
|
shell.notify 'No tests to run'
|
25
23
|
exit
|
26
24
|
end
|
27
25
|
|
28
|
-
test_runner.run_files(
|
26
|
+
test_runner.run_files(status_tests)
|
29
27
|
end
|
30
28
|
|
31
29
|
private
|
32
30
|
|
33
31
|
def handle_selenium
|
34
32
|
if ignore_selenium || shell.deny?("The status includes some selenium files. Do you wish to run those?")
|
35
|
-
|
33
|
+
status_tests.remove_selenium!
|
36
34
|
end
|
37
35
|
end
|
36
|
+
|
37
|
+
def get_status_tests
|
38
|
+
files = TestFilter.select_tests(repo.status_files)
|
39
|
+
TestCollection.new(files)
|
40
|
+
end
|
38
41
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class TestFilter
|
2
|
+
def self.select_tests(files)
|
3
|
+
filter(action: :select, files: files)
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.reject_tests(files)
|
7
|
+
filter(action: :reject, files: files)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def self.filter(action:, files:)
|
13
|
+
files.send(action) {|f| f.match(/_test(\.rb)?$/) }
|
14
|
+
end
|
15
|
+
end
|
@@ -54,9 +54,7 @@ class TestFinder
|
|
54
54
|
def tests_found_by_file_name
|
55
55
|
@tests_found_by_file_name ||=
|
56
56
|
begin
|
57
|
-
files =
|
58
|
-
files << repo.find_files(query).select {|f| f.match /_test\.rb\Z/ }.map {|f| {:file => f} }
|
59
|
-
files.flatten!
|
57
|
+
files = TestFilter.select_tests(repo.find_files(query))
|
60
58
|
TestCollection.new(files)
|
61
59
|
end
|
62
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfb_scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Kinnecom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/sfb_scripts/test_running/status_test_runner.rb
|
79
79
|
- lib/sfb_scripts/test_running/test_case.rb
|
80
80
|
- lib/sfb_scripts/test_running/test_collection.rb
|
81
|
+
- lib/sfb_scripts/test_running/test_filter.rb
|
81
82
|
- lib/sfb_scripts/test_running/test_finder.rb
|
82
83
|
- lib/sfb_scripts/test_running/test_runner.rb
|
83
84
|
- lib/sfb_scripts/tester.rb
|