webvalve 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +28 -2
- data/lib/webvalve.rb +1 -0
- data/lib/webvalve/monkey_patches.rb +30 -0
- data/lib/webvalve/version.rb +1 -1
- data/spec/examples.txt +29 -29
- metadata +3 -4
- data/spec/dummy/log/test.log +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee21f56868562d76912798f434460bb7373336b5
|
4
|
+
data.tar.gz: 1a272c0725e2dd5797d233f76f687262fe51cf9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2e6a9654e68364a26ddee0ff97da75b3d720d39af191842ef8507fc210490e2816ee2ffb650a7bf840c48b58523bf0d34c3a7f747cebd408dfd2bd0415540ac
|
7
|
+
data.tar.gz: aafb419aac580481b09d740da59f689b563b5554042f795104e46b0ddd62e84477cd8d3059f6a826be994bbee56bffa6ca0fb5926494e60f9ef4eba36c7ff379
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,10 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
9
9
|
### Added
|
10
10
|
### Removed
|
11
11
|
|
12
|
+
## [0.9.9] - 2019-05-24
|
13
|
+
### Changed
|
14
|
+
- fix integration with `webdrivers` gem so Rails 6 should work out of the box (https://github.com/Betterment/webvalve/pull/32)
|
15
|
+
|
12
16
|
## [0.9.8] - 2019-01-22
|
13
17
|
### Changed
|
14
18
|
- fix load order of webvalve initializer from @jmileham (https://github.com/Betterment/webvalve/pull/26)
|
@@ -26,7 +30,8 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
26
30
|
### Changed
|
27
31
|
- WebMock 3+ support from @messanjah (https://github.com/Betterment/webvalve/pull/22)
|
28
32
|
|
29
|
-
[Unreleased]: https://github.com/Betterment/webvalve/compare/v0.9.
|
33
|
+
[Unreleased]: https://github.com/Betterment/webvalve/compare/v0.9.9...HEAD
|
34
|
+
[0.9.9]: https://github.com/Betterment/webvalve/compare/v0.9.8...v0.9.9
|
30
35
|
[0.9.8]: https://github.com/Betterment/webvalve/compare/v0.9.7...v0.9.8
|
31
36
|
[0.9.7]: https://github.com/Betterment/webvalve/compare/v0.9.6...v0.9.7
|
32
37
|
[0.9.6]: https://github.com/Betterment/webvalve/compare/v0.9.5...v0.9.6
|
data/README.md
CHANGED
@@ -151,8 +151,34 @@ is a configuration provided.
|
|
151
151
|
require 'webvalve/rspec'
|
152
152
|
```
|
153
153
|
|
154
|
-
|
155
|
-
|
154
|
+
If you are using
|
155
|
+
[rspec-retry](https://github.com/NoRedInk/rspec-retry), you'll have to
|
156
|
+
manually register your around hook, instead, to ensure that WebValve
|
157
|
+
resets its configuration for each retry, e.g.:
|
158
|
+
|
159
|
+
```ruby
|
160
|
+
# spec/[rails|spec]_helper.rb
|
161
|
+
|
162
|
+
# your require lines omitted ...
|
163
|
+
require 'webmock/rspec' # set up webmock lifecycle hooks - required
|
164
|
+
|
165
|
+
RSpec.configure do |config|
|
166
|
+
# your config lines omitted ...
|
167
|
+
|
168
|
+
config.around :each do |ex|
|
169
|
+
ex.run_with_retry retry: 2
|
170
|
+
end
|
171
|
+
|
172
|
+
config.around :each do |ex|
|
173
|
+
WebValve.setup
|
174
|
+
ex.run
|
175
|
+
end
|
176
|
+
end
|
177
|
+
```
|
178
|
+
|
179
|
+
For any other test framework, you will want to similarly set up webmock
|
180
|
+
lifecycle hooks, and add a custom hook that will run `WebValve.setup` before
|
181
|
+
each test.
|
156
182
|
|
157
183
|
## Setting deterministic fake results in tests
|
158
184
|
|
data/lib/webvalve.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
# if the webdrivers gem is included, patch it so that it can make HTTP requests to download
|
2
|
+
# drivers when necessary.
|
3
|
+
#
|
4
|
+
# based on the v3.9.4 release of webdrivers gem
|
5
|
+
# https://github.com/titusfortner/webdrivers/blob/v3.9.4/lib/webdrivers/network.rb#L47-L54
|
6
|
+
#
|
7
|
+
# and the v3.5.1 release of webmock gem
|
8
|
+
# https://github.com/bblimke/webmock/blob/v3.5.1/lib/webmock/http_lib_adapters/net_http.rb#L12
|
9
|
+
webdrivers = begin
|
10
|
+
require "webdrivers"
|
11
|
+
true
|
12
|
+
rescue LoadError
|
13
|
+
false
|
14
|
+
end
|
15
|
+
|
16
|
+
if webdrivers
|
17
|
+
class Webdrivers::Network
|
18
|
+
class << self
|
19
|
+
def http
|
20
|
+
client = WebMock::HttpLibAdapters::NetHttpAdapter::OriginalNetHTTP
|
21
|
+
if using_proxy
|
22
|
+
client.Proxy(Webdrivers.proxy_addr, Webdrivers.proxy_port,
|
23
|
+
Webdrivers.proxy_user, Webdrivers.proxy_pass)
|
24
|
+
else
|
25
|
+
client
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/webvalve/version.rb
CHANGED
data/spec/examples.txt
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------------------------ | ------ | --------------- |
|
3
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:1:1] | passed | 0.
|
3
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:1:1] | passed | 0.0003 seconds |
|
4
4
|
./spec/webvalve/fake_service_config_spec.rb[1:1:1:2] | passed | 0.00014 seconds |
|
5
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:2:1] | passed | 0.
|
6
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:2:2] | passed | 0.
|
7
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:2:3] | passed | 0.
|
8
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:3:1] | passed | 0.
|
9
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:3:2] | passed | 0.
|
10
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:1] | passed | 0.
|
11
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:2] | passed | 0.
|
12
|
-
./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.
|
13
|
-
./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.
|
14
|
-
./spec/webvalve/fake_service_config_spec.rb[1:2:3] | passed | 0.
|
15
|
-
./spec/webvalve/fake_service_spec.rb[1:1] | passed | 0.
|
16
|
-
./spec/webvalve/fake_service_spec.rb[1:2:1] | passed | 0.
|
17
|
-
./spec/webvalve/fake_service_spec.rb[1:2:2] | passed | 0.
|
18
|
-
./spec/webvalve/manager_spec.rb[1:1] | passed | 0.
|
19
|
-
./spec/webvalve/manager_spec.rb[1:2:1] | passed | 0.
|
20
|
-
./spec/webvalve/manager_spec.rb[1:3:1] | passed | 0.
|
21
|
-
./spec/webvalve/manager_spec.rb[1:4:1] | passed | 0.
|
22
|
-
./spec/webvalve/manager_spec.rb[1:5:1] | passed | 0.
|
23
|
-
./spec/webvalve/manager_spec.rb[1:5:2] | passed | 0.
|
24
|
-
./spec/webvalve/manager_spec.rb[1:5:3] | passed | 0.
|
25
|
-
./spec/webvalve/manager_spec.rb[1:5:4:1] | passed | 0.
|
26
|
-
./spec/webvalve/manager_spec.rb[1:5:5:1] | passed | 0.
|
27
|
-
./spec/webvalve/manager_spec.rb[1:5:5:2] | passed | 0.
|
28
|
-
./spec/webvalve/manager_spec.rb[1:5:5:3] | passed | 0.
|
29
|
-
./spec/webvalve_spec.rb[1:1] | passed | 0.
|
30
|
-
./spec/webvalve_spec.rb[1:2] | passed | 0.
|
31
|
-
./spec/webvalve_spec.rb[1:3] | passed | 0.
|
32
|
-
./spec/webvalve_spec.rb[1:4] | passed | 0.
|
5
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:2:1] | passed | 0.0002 seconds |
|
6
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:2:2] | passed | 0.00017 seconds |
|
7
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:2:3] | passed | 0.00019 seconds |
|
8
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:3:1] | passed | 0.00013 seconds |
|
9
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:3:2] | passed | 0.00014 seconds |
|
10
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:1] | passed | 0.00015 seconds |
|
11
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:2] | passed | 0.00039 seconds |
|
12
|
+
./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.00247 seconds |
|
13
|
+
./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.00161 seconds |
|
14
|
+
./spec/webvalve/fake_service_config_spec.rb[1:2:3] | passed | 0.0002 seconds |
|
15
|
+
./spec/webvalve/fake_service_spec.rb[1:1] | passed | 0.00354 seconds |
|
16
|
+
./spec/webvalve/fake_service_spec.rb[1:2:1] | passed | 0.02646 seconds |
|
17
|
+
./spec/webvalve/fake_service_spec.rb[1:2:2] | passed | 0.02043 seconds |
|
18
|
+
./spec/webvalve/manager_spec.rb[1:1] | passed | 0.00008 seconds |
|
19
|
+
./spec/webvalve/manager_spec.rb[1:2:1] | passed | 0.00228 seconds |
|
20
|
+
./spec/webvalve/manager_spec.rb[1:3:1] | passed | 0.00022 seconds |
|
21
|
+
./spec/webvalve/manager_spec.rb[1:4:1] | passed | 0.0001 seconds |
|
22
|
+
./spec/webvalve/manager_spec.rb[1:5:1] | passed | 0.00046 seconds |
|
23
|
+
./spec/webvalve/manager_spec.rb[1:5:2] | passed | 0.00065 seconds |
|
24
|
+
./spec/webvalve/manager_spec.rb[1:5:3] | passed | 0.01468 seconds |
|
25
|
+
./spec/webvalve/manager_spec.rb[1:5:4:1] | passed | 0.00055 seconds |
|
26
|
+
./spec/webvalve/manager_spec.rb[1:5:5:1] | passed | 0.00053 seconds |
|
27
|
+
./spec/webvalve/manager_spec.rb[1:5:5:2] | passed | 0.00093 seconds |
|
28
|
+
./spec/webvalve/manager_spec.rb[1:5:5:3] | passed | 0.00188 seconds |
|
29
|
+
./spec/webvalve_spec.rb[1:1] | passed | 0.00006 seconds |
|
30
|
+
./spec/webvalve_spec.rb[1:2] | passed | 0.00013 seconds |
|
31
|
+
./spec/webvalve_spec.rb[1:3] | passed | 0.00008 seconds |
|
32
|
+
./spec/webvalve_spec.rb[1:4] | passed | 0.00182 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webvalve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/webvalve/instrumentation/log_subscriber.rb
|
157
157
|
- lib/webvalve/instrumentation/middleware.rb
|
158
158
|
- lib/webvalve/manager.rb
|
159
|
+
- lib/webvalve/monkey_patches.rb
|
159
160
|
- lib/webvalve/railtie.rb
|
160
161
|
- lib/webvalve/rspec.rb
|
161
162
|
- lib/webvalve/version.rb
|
@@ -189,7 +190,6 @@ files:
|
|
189
190
|
- spec/dummy/config/locales/en.yml
|
190
191
|
- spec/dummy/config/routes.rb
|
191
192
|
- spec/dummy/config/secrets.yml
|
192
|
-
- spec/dummy/log/test.log
|
193
193
|
- spec/dummy/public/404.html
|
194
194
|
- spec/dummy/public/422.html
|
195
195
|
- spec/dummy/public/500.html
|
@@ -260,7 +260,6 @@ test_files:
|
|
260
260
|
- spec/dummy/public/422.html
|
261
261
|
- spec/dummy/public/500.html
|
262
262
|
- spec/dummy/public/404.html
|
263
|
-
- spec/dummy/log/test.log
|
264
263
|
- spec/dummy/README.rdoc
|
265
264
|
- spec/examples.txt
|
266
265
|
- spec/webvalve/fake_service_spec.rb
|
data/spec/dummy/log/test.log
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
2
|
-
[1m[33mWebValve Request Captured (4.8ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
3
|
-
[1m[33mWebValve Request Captured (3.0ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
4
|
-
[1m[33mWebValve Request Captured (0.8ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
5
|
-
[1m[33mWebValve Request Captured (3.9ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
6
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
7
|
-
[1m[33mWebValve Request Captured (2.6ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
8
|
-
[1m[33mWebValve Request Captured (0.5ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
9
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
10
|
-
[1m[33mWebValve Request Captured (2.2ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
11
|
-
[1m[33mWebValve Request Captured (0.5ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
12
|
-
[1m[33mWebValve Request Captured (3.9ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
13
|
-
[1m[33mWebValve Request Captured (2.1ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
14
|
-
[1m[33mWebValve Request Captured (0.3ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
15
|
-
[1m[33mWebValve Request Captured (2.9ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
16
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
17
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
18
|
-
[1m[33mWebValve Request Captured (4.9ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
19
|
-
[1m[33mWebValve Request Captured (2.1ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
20
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
21
|
-
[1m[33mWebValve Request Captured (0.5ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
22
|
-
[1m[33mWebValve Request Captured (2.2ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
23
|
-
[1m[33mWebValve Request Captured (0.5ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
24
|
-
[1m[33mWebValve Request Captured (2.6ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
25
|
-
[1m[33mWebValve Request Captured (6.6ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
26
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
27
|
-
[1m[33mWebValve Request Captured (0.5ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
28
|
-
[1m[33mWebValve Request Captured (2.5ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
29
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
30
|
-
[1m[33mWebValve Request Captured (2.2ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
31
|
-
[1m[33mWebValve Request Captured (2.1ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
32
|
-
[1m[33mWebValve Request Captured (0.3ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
33
|
-
[1m[33mWebValve Request Captured (2.4ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|
34
|
-
[1m[33mWebValve Request Captured (0.3ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
35
|
-
[1m[33mWebValve Request Captured (0.4ms)[0m [1m[1mdummy.dev GET /foos [][0m
|
36
|
-
[1m[33mWebValve Request Captured (2.2ms)[0m [1m[1mdummy.dev GET /widgets [200][0m
|