stream-ci-ruby-rspec 0.10.0 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 0afbe379cdcdbdea2288ca5107ba3bb1dcbc486f2d0608f5715f400b706306f2
4
- data.tar.gz: '06049060ca8494174aeb89107b59df3b3ea7a3b3ebba6b2183f8cbf4440a6f9f'
2
+ SHA1:
3
+ metadata.gz: 5e35372bd1f6db81234c74128bbf0db4aa233ddd
4
+ data.tar.gz: e7f2234cb25eaaf48e53b4e8d7a1d28637545dfb
5
5
  SHA512:
6
- metadata.gz: 295a4ad1ab74471ee0f1ee42ab2a2762b23cb709cbd34618350467bb4b38b210a4a978c8802a9a1765c7a40fbf74de71a762a05fc93b2ba20fad3a6f69ea18f7
7
- data.tar.gz: 3f8482f49f8e51ad8b5b6cdb3be24478cd694e36e611b1b99192e7cf7fbb2382e7bd26a559aaa28af95e2e53ac11a2fa49aa730f13985e558e0350973c3ee455
6
+ metadata.gz: fe21f3865a4e724f828bffe4a04a35e4257e53510bc459d74a4b34e2cef6a4bf04d0e305f621419ac5a5a1ca702b7301350eee6955ced277170320d3f6c29255
7
+ data.tar.gz: 61eb21e5cf52b72c680480003e183c9bc8f450c65aad839c1798ddeaa5ecd68801f67deb0a118f38191e002c2f16843129be4d0e43710a9eb4fbe2f12e663892
data/.gitignore CHANGED
@@ -10,4 +10,6 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
 
13
- /.idea/*
13
+ /.idea/*
14
+
15
+ /vendor
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stream-ci-ruby-rspec (0.10.0)
4
+ stream-ci-ruby-rspec (0.12.0)
5
5
  httparty (~> 0.16.2)
6
6
  rake (~> 12.3, >= 12.3.1)
7
7
  rspec (~> 3.7)
@@ -44,4 +44,4 @@ DEPENDENCIES
44
44
  stream-ci-ruby-rspec!
45
45
 
46
46
  BUNDLED WITH
47
- 1.16.2
47
+ 1.16.6
data/README.md CHANGED
@@ -15,6 +15,10 @@ And then execute:
15
15
  Or install it yourself as:
16
16
 
17
17
  $ gem install stream-ci-ruby-rspec
18
+
19
+ Need to set
20
+ 1. rails root dir
21
+ 2. STREAM_CI_URL (i.e. localhost:3000)
18
22
 
19
23
  ## Usage
20
24
 
data/TODO.md ADDED
@@ -0,0 +1,7 @@
1
+ # To Do
2
+
3
+ * re-work how file_path manifests are generated to:
4
+ * handle directories
5
+ * scope to passed in files / directories
6
+ * log results to csv file
7
+ * after tests are done (or blow up), send results
@@ -17,19 +17,36 @@ module StreamCi
17
17
  )
18
18
  t1 = Time.now
19
19
 
20
- project_root = Rails.root.to_s # this needs to be setup via a config option, as non-rails apps might use this
21
- spec_root = '/spec' # pull from rspec config?
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
- stream_ci_url = ENV['STREAM_CI_URL'] || 'https://api.streamci.com'
43
- HTTParty.post("#{stream_ci_url}/v1/tests", opts)
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
- stream_ci_url = ENV['STREAM_CI_URL'] || 'https://api.streamci.com'
67
- response = HTTParty.get("#{stream_ci_url}/v1/tests/next", opts)
84
+ base_url = "http://#{ENV['STREAM_CI_URL']}" || 'https://api.streamci.com'
85
+ full_url = "#{base_url}/v1/tests/next"
68
86
 
69
- binding.pry
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
@@ -1,7 +1,7 @@
1
1
  module StreamCi
2
2
  module Ruby
3
3
  module Rspec
4
- VERSION = '0.10.0'
4
+ VERSION = '0.12.0'
5
5
  end
6
6
  end
7
7
  end
@@ -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.10.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-07-04 00:00:00.000000000 Z
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.7.3
174
+ rubygems_version: 2.5.2.1
174
175
  signing_key:
175
176
  specification_version: 4
176
177
  summary: StreamCI rspec runner