stream-ci-ruby-rspec 0.10.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -1
- data/Gemfile.lock +2 -2
- data/README.md +4 -0
- data/TODO.md +7 -0
- data/lib/stream_ci/ruby/rspec/runner.rb +32 -14
- data/lib/stream_ci/ruby/rspec/version.rb +1 -1
- data/lib/tasks/stream_ci.rake +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5e35372bd1f6db81234c74128bbf0db4aa233ddd
|
4
|
+
data.tar.gz: e7f2234cb25eaaf48e53b4e8d7a1d28637545dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe21f3865a4e724f828bffe4a04a35e4257e53510bc459d74a4b34e2cef6a4bf04d0e305f621419ac5a5a1ca702b7301350eee6955ced277170320d3f6c29255
|
7
|
+
data.tar.gz: 61eb21e5cf52b72c680480003e183c9bc8f450c65aad839c1798ddeaa5ecd68801f67deb0a118f38191e002c2f16843129be4d0e43710a9eb4fbe2f12e663892
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/TODO.md
ADDED
@@ -17,19 +17,36 @@ module StreamCi
|
|
17
17
|
)
|
18
18
|
t1 = Time.now
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
# set manifest based on args files/directories or default test directory/directories
|
21
|
+
|
22
|
+
binding.pry
|
23
|
+
# targets =
|
24
|
+
|
25
|
+
# OLD Setup
|
26
|
+
|
27
|
+
# this needs to be setup via a config option, as non-rails apps might use this
|
28
|
+
project_root = Rails.root.to_s
|
29
|
+
|
30
|
+
# pull from rspec config?
|
31
|
+
spec_root = '/spec'
|
32
|
+
|
22
33
|
test_manifest = Dir["#{project_root}#{spec_root}/**/*_spec.rb"].map do |fp|
|
23
34
|
fp.gsub("#{project_root}/", '')
|
24
35
|
end
|
25
36
|
|
26
37
|
# this does not currently handle directories -- need to fix.
|
27
|
-
given_files_or_directories = @options.args
|
38
|
+
given_files_or_directories = if @options.args.any?
|
39
|
+
@options.args.first.split(" ")
|
40
|
+
else
|
41
|
+
[]
|
42
|
+
end
|
28
43
|
|
29
|
-
if given_files_or_directories
|
44
|
+
if given_files_or_directories.any?
|
30
45
|
test_manifest = test_manifest & given_files_or_directories
|
31
46
|
end
|
32
47
|
|
48
|
+
# OLD Setup - end
|
49
|
+
|
33
50
|
opts = {
|
34
51
|
query: {
|
35
52
|
api_key: '12345',
|
@@ -39,8 +56,9 @@ module StreamCi
|
|
39
56
|
}
|
40
57
|
}
|
41
58
|
|
42
|
-
|
43
|
-
|
59
|
+
base_url = "http://#{ENV['STREAM_CI_URL']}" || 'https://api.streamci.com'
|
60
|
+
full_url = "#{base_url}/v1/tests"
|
61
|
+
HTTParty.post(full_url, opts)
|
44
62
|
|
45
63
|
t2 = Time.now
|
46
64
|
@configuration.output_stream.print "#\n# Test manifest sent to StreamCI - (#{((t2 - t1) * 1000).round} ms)\n#\n"
|
@@ -63,20 +81,20 @@ module StreamCi
|
|
63
81
|
@no_failures = true
|
64
82
|
|
65
83
|
opts = { query: { api_key: '12345', branch: 'test', build: '1' } }
|
66
|
-
|
67
|
-
|
84
|
+
base_url = "http://#{ENV['STREAM_CI_URL']}" || 'https://api.streamci.com'
|
85
|
+
full_url = "#{base_url}/v1/tests/next"
|
68
86
|
|
69
|
-
|
70
|
-
until response.code == 204 || response.code >= 300 do
|
87
|
+
until ((response = HTTParty.get(full_url, opts)) && (response.code == 204 || response.code >= 300)) do
|
71
88
|
# should we clear the world / example groups before each one?
|
72
89
|
# will that mess up reporting?
|
73
90
|
#
|
74
91
|
# does this need to be the full path or just spec/some/spec/path ?
|
75
|
-
binding.pry
|
76
92
|
if response.code == 200
|
77
|
-
puts "Running #{response.body}"
|
78
|
-
binding.pry
|
79
93
|
load JSON.parse(response.body)['test']
|
94
|
+
|
95
|
+
RSpec.configuration.files_or_directories_to_run = [JSON.parse(response.body)['test']]
|
96
|
+
RSpec.configuration.load_spec_files
|
97
|
+
|
80
98
|
unless @world.example_groups.last.run(reporter)
|
81
99
|
@no_failures = false
|
82
100
|
end
|
@@ -92,4 +110,4 @@ module StreamCi
|
|
92
110
|
end
|
93
111
|
end
|
94
112
|
end
|
95
|
-
end
|
113
|
+
end
|
data/lib/tasks/stream_ci.rake
CHANGED
@@ -5,7 +5,7 @@ namespace :stream_ci do
|
|
5
5
|
namespace :rspec do
|
6
6
|
desc 'Run and report on RSpec specs via StreamCI'
|
7
7
|
task :run, [:rspec_args] do |_, args|
|
8
|
-
StreamCi::Ruby::Rspec::Runner.run(args[:rspec_args].split
|
8
|
+
StreamCi::Ruby::Rspec::Runner.run(args[:rspec_args].try(:split, ";") || [])
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stream-ci-ruby-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Conant
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- LICENSE.txt
|
143
143
|
- README.md
|
144
144
|
- Rakefile
|
145
|
+
- TODO.md
|
145
146
|
- bin/console
|
146
147
|
- bin/setup
|
147
148
|
- lib/stream_ci/ruby/rspec/runner.rb
|
@@ -170,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
171
|
version: '0'
|
171
172
|
requirements: []
|
172
173
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
174
|
+
rubygems_version: 2.5.2.1
|
174
175
|
signing_key:
|
175
176
|
specification_version: 4
|
176
177
|
summary: StreamCI rspec runner
|