test_launcher 2.29.0 → 2.31.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1d886eff98d8422bd07a4f52087ec6870f56490229d1a183f75a28243a6906f
|
4
|
+
data.tar.gz: dd0e3428597ce81a458c4f6c53c8a2727ffc472cba25212e785c9a26c364304b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8716630ff0acbec78259c505f3b2ace25902573ef79ba88556af205d3a5caf469e953d01a00ea965f81ed7e722f0b8add33f2a7f6918845212daa6f5397f5a0
|
7
|
+
data.tar.gz: f8e3b5fcc096c8c04391934f0151134bde571003b5ad962595ef3204cefee07e14764dd17e1cae6113f9316b73a37bbc9cff21f5b54e5459daaa188e5c1e6a5d
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
1
3
|
module TestLauncher
|
2
4
|
module Frameworks
|
3
5
|
module Implementation
|
@@ -28,21 +30,20 @@ module TestLauncher
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def app_root
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
33
|
+
test_dir_parent = nil
|
34
|
+
|
35
|
+
Pathname.new(file).parent.ascend do |path|
|
36
|
+
if test_dir_parent.nil? && path.basename.to_s == test_root_dir_name
|
37
|
+
test_dir_parent = path.parent.to_s
|
38
|
+
next
|
39
|
+
elsif test_dir_parent.nil?
|
40
|
+
next
|
41
|
+
elsif path.entries.any? { |e| e.to_s.match /Gemfile|gemspec|mix.exs|config.ru/ }
|
42
|
+
return path.to_s
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
44
|
-
|
45
|
-
File.join("/", path)
|
46
|
+
test_dir_parent || Pathname.new(file).parent.to_s
|
46
47
|
end
|
47
48
|
|
48
49
|
def test_root
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "test_launcher/base_error"
|
2
|
+
require "shellwords"
|
2
3
|
|
3
4
|
module TestLauncher
|
4
5
|
module Search
|
@@ -16,15 +17,11 @@ module TestLauncher
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def grep(regex, file_pattern)
|
19
|
-
shell.run("ag
|
20
|
+
shell.run("ag #{Shellwords.escape(regex)} --file-search-regex '#{pattern_to_regex(file_pattern)}'")
|
20
21
|
end
|
21
22
|
|
22
23
|
def root_path
|
23
|
-
|
24
|
-
if $? != 0
|
25
|
-
raise NotInRepoError, "test_launcher must be used in a git repository"
|
26
|
-
end
|
27
|
-
end
|
24
|
+
@result ||= (ENV['TEST_LAUNCHER__DIR'] || Dir.pwd)
|
28
25
|
end
|
29
26
|
|
30
27
|
def pattern_to_regex(pattern)
|
data/lib/test_launcher/search.rb
CHANGED
@@ -4,15 +4,11 @@ require 'test_launcher/search/git'
|
|
4
4
|
module TestLauncher
|
5
5
|
module Search
|
6
6
|
def self.searcher(shell)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# Search::Git
|
13
|
-
# end
|
14
|
-
|
15
|
-
Search::Git.new(shell)
|
7
|
+
if ENV.key?('TEST_LAUNCHER__AG')
|
8
|
+
Search::Ag.new(shell)
|
9
|
+
else
|
10
|
+
Search::Git.new(shell)
|
11
|
+
end
|
16
12
|
end
|
17
13
|
end
|
18
14
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Kinnecom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|