nonnative 1.86.0 → 1.88.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/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +27 -12
- data/lib/nonnative/configuration.rb +2 -2
- data/lib/nonnative/configuration_proxy.rb +2 -1
- data/lib/nonnative/configuration_runner.rb +1 -0
- data/lib/nonnative/cucumber.rb +0 -6
- data/lib/nonnative/fault_injection_proxy.rb +2 -0
- data/lib/nonnative/http_client.rb +1 -1
- data/lib/nonnative/proxy.rb +4 -0
- data/lib/nonnative/version.rb +1 -1
- data/lib/nonnative.rb +0 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bdc49e5b22f9cf623a0e49b96483ffeee4a44803cfc615f57edf5e766839cba
|
4
|
+
data.tar.gz: e255bb99e8a1d4f50054978607f95938adf08974c35fdaff17bf61484a508995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4faebc5b4beb4d2feee285d9f6b083c8cb607c92214269478c3c409f06c7ffe5702420af5f09cb51ff84eecbe75501224be77e3c869c59f72d9a9905eef2f0
|
7
|
+
data.tar.gz: 19c1bb3d62d376c3525ab9070b170a1bc0d6c497437b2b277e4683925a8a7751777c72697822e7189daf2b4652e3ef3e737d019f87b5086cc4205203b1c4eb51
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## [v1.88.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.88.0) - 2025-01-26
|
10
|
+
|
11
|
+
- [`897e4d4`](https://github.com/alexfalkowski/nonnative/commit/897e4d421cdb72378c9f241d2ecee152b75b7f13) feat(http_client): handle RestClient::Exception (#494)
|
12
|
+
|
13
|
+
## [v1.87.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.87.0) - 2025-01-26
|
14
|
+
|
15
|
+
- [`c370c66`](https://github.com/alexfalkowski/nonnative/commit/c370c664ff1f6f83a8f2afe7075afd1b34bc333a) feat(proxy): add wait to the proxy, not globally (#493)
|
16
|
+
- [`39cc986`](https://github.com/alexfalkowski/nonnative/commit/39cc9867157c0d68ac78670e656b0aaa55773cfe) docs(readme): http app is a class not a instance (#492)
|
17
|
+
|
9
18
|
## [v1.86.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.86.0) - 2025-01-25
|
10
19
|
|
11
20
|
- [`9f3be69`](https://github.com/alexfalkowski/nonnative/commit/9f3be69130570a6842d6559c929fe6cb480dd1df) feat(http_server): use webrick (#490)
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -37,7 +37,6 @@ Configure nonnative with the following:
|
|
37
37
|
|
38
38
|
- The version of the configuration (1.0).
|
39
39
|
- The URL of the service.
|
40
|
-
- The time to wait on proxy changes (fault injection).
|
41
40
|
- Process, Server or Service that you want to start.
|
42
41
|
- A timeout value.
|
43
42
|
- A time to wait.
|
@@ -65,7 +64,6 @@ require 'nonnative'
|
|
65
64
|
Nonnative.configure do |config|
|
66
65
|
config.version = '1.0'
|
67
66
|
config.url = 'http://localhost:4567'
|
68
|
-
config.wait = 2.0
|
69
67
|
|
70
68
|
config.process do |p|
|
71
69
|
p.name = 'start_1'
|
@@ -96,13 +94,12 @@ Setup it up through configuration:
|
|
96
94
|
```yaml
|
97
95
|
version: "1.0"
|
98
96
|
url: http://localhost:4567
|
99
|
-
wait: 2.0
|
100
97
|
processes:
|
101
98
|
-
|
102
99
|
name: start_1
|
103
100
|
command: features/support/bin/start 12_321
|
104
101
|
timeout: 5
|
105
|
-
wait:
|
102
|
+
wait: 1
|
106
103
|
port: 12321
|
107
104
|
log: 12_321.log
|
108
105
|
signal: INT # Possible values are described in Signal.list.keys.
|
@@ -112,7 +109,7 @@ processes:
|
|
112
109
|
name: start_2
|
113
110
|
command: features/support/bin/start 12_322
|
114
111
|
timeout: 5
|
115
|
-
wait:
|
112
|
+
wait: 1
|
116
113
|
port: 12322
|
117
114
|
log: 12_322.log
|
118
115
|
```
|
@@ -141,21 +138,30 @@ Define your server:
|
|
141
138
|
|
142
139
|
```ruby
|
143
140
|
module Nonnative
|
144
|
-
class
|
145
|
-
def
|
146
|
-
|
141
|
+
class TCPServer < Nonnative::Server
|
142
|
+
def initialize(service)
|
143
|
+
super
|
144
|
+
|
145
|
+
@socket_server = ::TCPServer.new(proxy.host, proxy.port)
|
146
|
+
end
|
147
147
|
|
148
|
+
def perform_start
|
148
149
|
loop do
|
149
|
-
client_socket =
|
150
|
+
client_socket = socket_server.accept
|
150
151
|
client_socket.puts 'Hello World!'
|
151
152
|
client_socket.close
|
152
153
|
end
|
153
154
|
rescue StandardError
|
155
|
+
socket_server.close
|
154
156
|
end
|
155
157
|
|
156
158
|
def perform_stop
|
157
|
-
|
159
|
+
socket_server.close
|
158
160
|
end
|
161
|
+
|
162
|
+
private
|
163
|
+
|
164
|
+
attr_reader :socket_server
|
159
165
|
end
|
160
166
|
end
|
161
167
|
```
|
@@ -226,7 +232,7 @@ module Nonnative
|
|
226
232
|
module Features
|
227
233
|
class Application < Sinatra::Application
|
228
234
|
configure do
|
229
|
-
set :
|
235
|
+
set :logging, false
|
230
236
|
end
|
231
237
|
|
232
238
|
get '/hello' do
|
@@ -236,7 +242,7 @@ module Nonnative
|
|
236
242
|
|
237
243
|
class HTTPServer < Nonnative::HTTPServer
|
238
244
|
def app
|
239
|
-
Application
|
245
|
+
Application
|
240
246
|
end
|
241
247
|
end
|
242
248
|
end
|
@@ -380,6 +386,7 @@ Setup it up through configuration:
|
|
380
386
|
|
381
387
|
```yaml
|
382
388
|
version: "1.0"
|
389
|
+
url: http://localhost:4567
|
383
390
|
processes:
|
384
391
|
-
|
385
392
|
name: postgres
|
@@ -421,6 +428,7 @@ Nonnative.configure do |config|
|
|
421
428
|
kind: 'fault_injection',
|
422
429
|
port: 20_000,
|
423
430
|
log: 'proxy_server.log',
|
431
|
+
wait: 1,
|
424
432
|
options: {
|
425
433
|
delay: 5
|
426
434
|
}
|
@@ -440,6 +448,7 @@ processes:
|
|
440
448
|
kind: fault_injection
|
441
449
|
port: 20000
|
442
450
|
log: proxy_server.log
|
451
|
+
wait: 1
|
443
452
|
options:
|
444
453
|
delay: 5
|
445
454
|
```
|
@@ -460,6 +469,7 @@ Nonnative.configure do |config|
|
|
460
469
|
kind: 'fault_injection',
|
461
470
|
port: 20_000,
|
462
471
|
log: 'proxy_server.log',
|
472
|
+
wait: 1,
|
463
473
|
options: {
|
464
474
|
delay: 5
|
465
475
|
}
|
@@ -479,6 +489,7 @@ servers:
|
|
479
489
|
kind: fault_injection
|
480
490
|
port: 20000
|
481
491
|
log: proxy_server.log
|
492
|
+
wait: 1
|
482
493
|
options:
|
483
494
|
delay: 5
|
484
495
|
```
|
@@ -493,12 +504,14 @@ require 'nonnative'
|
|
493
504
|
Nonnative.configure do |config|
|
494
505
|
config.version = '1.0'
|
495
506
|
config.url = 'http://localhost:4567'
|
507
|
+
config.wait = 1
|
496
508
|
|
497
509
|
config.service do |s|
|
498
510
|
s.proxy = {
|
499
511
|
kind: 'fault_injection',
|
500
512
|
port: 20_000,
|
501
513
|
log: 'proxy_server.log',
|
514
|
+
wait: 1,
|
502
515
|
options: {
|
503
516
|
delay: 5
|
504
517
|
}
|
@@ -512,12 +525,14 @@ Setup it up through configuration:
|
|
512
525
|
```yaml
|
513
526
|
version: "1.0"
|
514
527
|
url: http://localhost:4567
|
528
|
+
wait: 1
|
515
529
|
services:
|
516
530
|
-
|
517
531
|
proxy:
|
518
532
|
kind: fault_injection
|
519
533
|
port: 20000
|
520
534
|
log: proxy_server.log
|
535
|
+
wait: 1
|
521
536
|
options:
|
522
537
|
delay: 5
|
523
538
|
```
|
@@ -8,14 +8,13 @@ module Nonnative
|
|
8
8
|
@services = []
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_accessor :version, :url, :
|
11
|
+
attr_accessor :version, :url, :processes, :servers, :services
|
12
12
|
|
13
13
|
def load_file(path)
|
14
14
|
cfg = Nonnative.configurations(path)
|
15
15
|
|
16
16
|
self.version = cfg.version
|
17
17
|
self.url = cfg.url
|
18
|
-
self.wait = cfg.wait
|
19
18
|
|
20
19
|
add_processes(cfg)
|
21
20
|
add_servers(cfg)
|
@@ -122,6 +121,7 @@ module Nonnative
|
|
122
121
|
}
|
123
122
|
|
124
123
|
p[:host] = proxy.host if proxy.host
|
124
|
+
p[:wait] = proxy.wait if proxy.wait
|
125
125
|
|
126
126
|
runner.proxy = p
|
127
127
|
end
|
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
module Nonnative
|
4
4
|
class ConfigurationProxy
|
5
|
-
attr_accessor :kind, :host, :port, :log, :options
|
5
|
+
attr_accessor :kind, :host, :port, :log, :wait, :options
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
self.kind = 'none'
|
9
9
|
self.host = '0.0.0.0'
|
10
10
|
self.port = 0
|
11
|
+
self.wait = 0.1
|
11
12
|
self.options = {}
|
12
13
|
end
|
13
14
|
end
|
data/lib/nonnative/cucumber.rb
CHANGED
@@ -23,22 +23,16 @@ end
|
|
23
23
|
Given('I set the proxy for process {string} to {string}') do |name, operation|
|
24
24
|
process = Nonnative.pool.process_by_name(name)
|
25
25
|
process.proxy.send(operation)
|
26
|
-
|
27
|
-
Nonnative.wait
|
28
26
|
end
|
29
27
|
|
30
28
|
Given('I set the proxy for server {string} to {string}') do |name, operation|
|
31
29
|
server = Nonnative.pool.server_by_name(name)
|
32
30
|
server.proxy.send(operation)
|
33
|
-
|
34
|
-
Nonnative.wait
|
35
31
|
end
|
36
32
|
|
37
33
|
Given('I set the proxy for service {string} to {string}') do |name, operation|
|
38
34
|
service = Nonnative.pool.service_by_name(name)
|
39
35
|
service.proxy.send(operation)
|
40
|
-
|
41
|
-
Nonnative.wait
|
42
36
|
end
|
43
37
|
|
44
38
|
Given('I start the system') do
|
data/lib/nonnative/proxy.rb
CHANGED
data/lib/nonnative/version.rb
CHANGED
data/lib/nonnative.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nonnative
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.88.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Falkowski
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-26 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: concurrent-ruby
|