stream-ci-ruby-rspec 0.1.0 → 0.2.0
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 +12 -1
- data/README.md +1 -1
- data/lib/stream_ci/ruby/rspec/runner.rb +64 -0
- data/lib/stream_ci/ruby/rspec/version.rb +7 -0
- data/lib/stream_ci_ruby_rspec.rb +43 -1
- data/lib/tasks/stream_ci.rake +13 -0
- data/stream_ci_ruby_rspec.gemspec +7 -3
- metadata +48 -4
- data/lib/stream_ci_ruby_rspec/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b1c827a1d806a6745b6922eee6d89681605bd5d7bbed1b45d4ecf72db23ba85
|
4
|
+
data.tar.gz: f44d48e09ac84a5de1e5df7166d371c7fbbd0537f4398d285fd84c580f1223c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df12af5722967919d24b3d60b8b8a44546d75ff92daa1946d92fb412a170a42490cc9182843ba837e10f89330b80b3fe6650209b145e3703115b849828634429
|
7
|
+
data.tar.gz: d2a162aae39f112e8de1fc8309e5c0aebecf21a0d3143d4e796ba9f079963a8dafc5f7b1ce7b639cf2401fadb3645d56945e1478a3de52de06eec71b4f9066fa
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stream-ci-ruby-rspec (0.
|
4
|
+
stream-ci-ruby-rspec (0.2.0)
|
5
|
+
httparty (~> 0.16.2)
|
6
|
+
rspec (~> 3.7)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
8
10
|
specs:
|
11
|
+
coderay (1.1.2)
|
9
12
|
diff-lcs (1.3)
|
13
|
+
httparty (0.16.2)
|
14
|
+
multi_xml (>= 0.5.2)
|
15
|
+
method_source (0.9.0)
|
16
|
+
multi_xml (0.6.0)
|
17
|
+
pry (0.11.3)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.9.0)
|
10
20
|
rake (12.3.1)
|
11
21
|
rspec (3.7.0)
|
12
22
|
rspec-core (~> 3.7.0)
|
@@ -27,6 +37,7 @@ PLATFORMS
|
|
27
37
|
|
28
38
|
DEPENDENCIES
|
29
39
|
bundler (~> 1.16, >= 1.16.2)
|
40
|
+
pry (~> 0.11.3)
|
30
41
|
rake (~> 12.3, >= 12.3.1)
|
31
42
|
rspec (~> 3.7)
|
32
43
|
stream-ci-ruby-rspec!
|
data/README.md
CHANGED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'rspec/core'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
module StreamCi
|
5
|
+
module Ruby
|
6
|
+
module Rspec
|
7
|
+
class Runner < RSpec::Core::Runner
|
8
|
+
def setup(err, out)
|
9
|
+
@configuration.error_stream = err
|
10
|
+
@configuration.output_stream = out if @configuration.output_stream == $stdout
|
11
|
+
@options.configure(@configuration)
|
12
|
+
|
13
|
+
# TODO
|
14
|
+
# * What do these commands do / mean?
|
15
|
+
#
|
16
|
+
# @configuration.load_spec_files
|
17
|
+
# @world.announce_filters
|
18
|
+
end
|
19
|
+
|
20
|
+
def run_specs(example_groups)
|
21
|
+
examples_count = @world.example_count(example_groups)
|
22
|
+
success = @configuration.reporter.report(examples_count) do |reporter|
|
23
|
+
@configuration.with_suite_hooks do
|
24
|
+
# TODO
|
25
|
+
# * what does !@world.non_example_failure return?
|
26
|
+
# * what does @configuration.failure_exit_code return?
|
27
|
+
|
28
|
+
@no_failures = true
|
29
|
+
|
30
|
+
#
|
31
|
+
# until the return status code is 204, keep pulling data
|
32
|
+
#
|
33
|
+
|
34
|
+
opts = { query: { api_key: '12345' } } # need to include other params as well
|
35
|
+
response = HTTParty.get('https://api.streamci.com/v1/results', opts)
|
36
|
+
|
37
|
+
# until (file_path = open(stream_ci_url).read) == '>>done<<' do
|
38
|
+
until response.code == 204 do
|
39
|
+
# should we clear the world / example groups before each one?
|
40
|
+
# will that mess up reporting?
|
41
|
+
#
|
42
|
+
# does this need to be the full path or just spec/some/spec/path ?
|
43
|
+
load response.body
|
44
|
+
unless @world.example_groups.last.run(reporter)
|
45
|
+
@no_failures = false
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
@no_failures
|
50
|
+
end
|
51
|
+
end && !@world.non_example_failure
|
52
|
+
|
53
|
+
success ? 0 : @configuration.failure_exit_code
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def stream_ci_url
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/lib/stream_ci_ruby_rspec.rb
CHANGED
@@ -1 +1,43 @@
|
|
1
|
-
require '
|
1
|
+
require 'stream_ci/ruby/rspec/version'
|
2
|
+
|
3
|
+
# require 'stream_ci_ruby_rspec/version'
|
4
|
+
|
5
|
+
# a_proc = Proc.new {|a, *b| b.collect {|i| i*a }}
|
6
|
+
# a_proc.call(9, 1, 2, 3) #=> [9, 18, 27]
|
7
|
+
# a_proc[9, 1, 2, 3] #=> [9, 18, 27]
|
8
|
+
# a_proc = lambda {|a,b| a}
|
9
|
+
# a_proc.call(1,2,3)
|
10
|
+
#
|
11
|
+
# # @param args [Array] command-line-supported arguments
|
12
|
+
# # @param err [IO] error stream
|
13
|
+
# # @param out [IO] output stream
|
14
|
+
# # @return [Fixnum] exit status code. 0 if all specs passed,
|
15
|
+
# # or the configured failure exit code (1 by default) if specs
|
16
|
+
# # failed.
|
17
|
+
# def self.run(args, err=$stderr, out=$stdout)
|
18
|
+
# trap_interrupt
|
19
|
+
# options = ConfigurationOptions.new(args)
|
20
|
+
#
|
21
|
+
# if options.options[:runner]
|
22
|
+
# options.options[:runner].call(options, err, out)
|
23
|
+
# else
|
24
|
+
# new(options).run(err, out)
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
# class StreamCI::Ruby::Rspec::Runner
|
29
|
+
# def initialize(options); end
|
30
|
+
# end
|
31
|
+
#
|
32
|
+
# args[:runner] = Proc.new do |options, err, out|
|
33
|
+
# StreamCI::Ruby::Rspec::Runner.new(options).run(err, out)
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
|
37
|
+
# `rake streamci:ruby:rspec`
|
38
|
+
#
|
39
|
+
# StreamCI::Ruby::Rspec::Runner.invoke
|
40
|
+
#
|
41
|
+
# class StreamCI::Ruby::Rspec::Runner < Rspec::Core::Runner
|
42
|
+
# # see Apoc::Runner
|
43
|
+
# end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'stream_ci_ruby_rspec'
|
2
|
+
|
3
|
+
namespace :stream_ci do
|
4
|
+
namespace :ruby do
|
5
|
+
namespace :rspec do
|
6
|
+
desc 'Run and report on RSpec specs via StreamCI'
|
7
|
+
task :run, [:rspec_args] do |_, args|
|
8
|
+
puts "Ran with: #{args[:rspec_args].join(' ')}"
|
9
|
+
# StreamCi::Ruby::Rspec::Runner.run(args[:rspec_args])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
lib = File.expand_path("../lib", __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require "
|
3
|
+
require "stream_ci/ruby/rspec/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "stream-ci-ruby-rspec"
|
7
|
-
spec.version =
|
7
|
+
spec.version = StreamCi::Ruby::Rspec::VERSION
|
8
8
|
spec.authors = ["James Conant"]
|
9
9
|
spec.email = ["james@conant.io"]
|
10
10
|
|
11
11
|
spec.summary = "StreamCI rspec runner"
|
12
12
|
spec.description = "StreamCI rspec runner"
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://github.com/stream-ci/stream-ci-ruby-rspec"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -20,7 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
+
spec.add_runtime_dependency 'rspec', '~> 3.7'
|
24
|
+
spec.add_runtime_dependency 'httparty', '~> 0.16.2'
|
25
|
+
|
23
26
|
spec.add_development_dependency 'bundler', '~> 1.16', '>= 1.16.2'
|
24
27
|
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.1'
|
25
28
|
spec.add_development_dependency 'rspec', '~> 3.7'
|
29
|
+
spec.add_development_dependency 'pry', '~> 0.11.3'
|
26
30
|
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
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.2.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-07-
|
11
|
+
date: 2018-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.16.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.16.2
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: bundler
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +92,20 @@ dependencies:
|
|
64
92
|
- - "~>"
|
65
93
|
- !ruby/object:Gem::Version
|
66
94
|
version: '3.7'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: pry
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.11.3
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 0.11.3
|
67
109
|
description: StreamCI rspec runner
|
68
110
|
email:
|
69
111
|
- james@conant.io
|
@@ -82,10 +124,12 @@ files:
|
|
82
124
|
- Rakefile
|
83
125
|
- bin/console
|
84
126
|
- bin/setup
|
127
|
+
- lib/stream_ci/ruby/rspec/runner.rb
|
128
|
+
- lib/stream_ci/ruby/rspec/version.rb
|
85
129
|
- lib/stream_ci_ruby_rspec.rb
|
86
|
-
- lib/
|
130
|
+
- lib/tasks/stream_ci.rake
|
87
131
|
- stream_ci_ruby_rspec.gemspec
|
88
|
-
homepage: https://
|
132
|
+
homepage: https://github.com/stream-ci/stream-ci-ruby-rspec
|
89
133
|
licenses:
|
90
134
|
- MIT
|
91
135
|
metadata: {}
|