nonnative 1.84.1 → 1.85.1

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
2
  SHA256:
3
- metadata.gz: ff480fe0c80d2f8aea2767d81dc0d64a5467875ee4c7aae41e29db61d8297bb4
4
- data.tar.gz: fb5c830a040acd4531f5106e51afce5b5b15d6b608a1dbb41fce4239983651d1
3
+ metadata.gz: 370acc5de7d851686a126f10fd1ba96137d3065957fb0073ce34994971721d3d
4
+ data.tar.gz: 894ab159c74027083e80fc56fc5f63f06057f5584546a658dee0b084df5585b2
5
5
  SHA512:
6
- metadata.gz: 4608d44faf23a3f00adc43b91343e1a002bd06af4d8ef7609ebfff34652e2bdbe8ee999fb987c1c52ed0ad4c631045d04ebd40130ea19f88196c5e447ea7549f
7
- data.tar.gz: c8b62a28660022f0f5bc40d6e28223c0b64231798c1c1eea63979d9d69b39a0251045196d76ad185399d713ea0aea31aaf5c775ec5c41f6a2c0bc7dcc7d20f6e
6
+ metadata.gz: 3e45f3fd1aeb50a89be7f782d942fc0b720596d210d29823a889b35291dcfd3e8ce1e28a69050d56b76e048aa1b1353163bfe9fe92b4ab57a9eeeaa7a07cf6af
7
+ data.tar.gz: a6ab1ba44dcc594a371316091351c8de38ec05d3f15b73eba254c700742e11037f696978952e09e7b42c99fb0ce6202d08a90c90b2049b666b35d22d2155087d
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ version: 2.1
3
3
  jobs:
4
4
  build:
5
5
  docker:
6
- - image: alexfalkowski/ruby:3.3
6
+ - image: alexfalkowski/ruby:1.5
7
7
  working_directory: ~/nonnative
8
8
  steps:
9
9
  - checkout
@@ -15,6 +15,7 @@ jobs:
15
15
  - nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}
16
16
  - nonnative-ruby-cache-
17
17
  - run: make dep
18
+ - run: make clean-dep
18
19
  - save_cache:
19
20
  name: save deps
20
21
  key: nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}
@@ -30,7 +31,7 @@ jobs:
30
31
  resource_class: large
31
32
  release:
32
33
  docker:
33
- - image: alexfalkowski/release:3.1
34
+ - image: alexfalkowski/release:3.5
34
35
  working_directory: ~/nonnative
35
36
  steps:
36
37
  - checkout
data/.rubocop.yml CHANGED
@@ -3,9 +3,9 @@ AllCops:
3
3
  DisplayCopNames: true
4
4
  NewCops: enable
5
5
  Exclude:
6
- - 'bin/**/*'
7
- - 'vendor/**/*'
8
- - 'test/grpc/**/*'
6
+ - "bin/**/*"
7
+ - "vendor/**/*"
8
+ - "test/grpc/**/*"
9
9
 
10
10
  Layout/LineLength:
11
11
  Max: 150
@@ -14,7 +14,7 @@ Metrics/MethodLength:
14
14
  Max: 20
15
15
 
16
16
  Metrics/BlockLength:
17
- Max: 80
17
+ Max: 90
18
18
 
19
19
  Metrics/AbcSize:
20
20
  Max: 25
@@ -24,3 +24,6 @@ Style/Documentation:
24
24
 
25
25
  Lint/HashCompareByIdentity:
26
26
  Enabled: false
27
+
28
+ Style/NumericPredicate:
29
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -6,6 +6,60 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## [v1.85.1](https://github.com/alexfalkowski/nonnative/releases/tag/v1.85.1) - 2025-01-25
10
+
11
+ - [`14b648f`](https://github.com/alexfalkowski/nonnative/commit/14b648f96addc49163e14a22ae904f2fafec79ca) fix(socket_pair): handle nil from recv (#488)
12
+
13
+ ## [v1.85.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.85.0) - 2025-01-25
14
+
15
+ - [`e6fad27`](https://github.com/alexfalkowski/nonnative/commit/e6fad27ead0df16c5260972fe1bda0471125f4bd) feat(http_server): handle shutdown correctly (#487)
16
+
17
+ ## [v1.84.10](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.10) - 2025-01-23
18
+
19
+ - [`bcf4c9b`](https://github.com/alexfalkowski/nonnative/commit/bcf4c9b375c692215677b229aae0e0bac23c63d5) fix(deps): bump rubocop from 1.70.0 to 1.71.0 (#486)
20
+ - [`f37b9ac`](https://github.com/alexfalkowski/nonnative/commit/f37b9ac3cea49e218280a03aebd250c0468760bc) build(ci): update ruby:1.5 (#485)
21
+
22
+ ## [v1.84.9](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.9) - 2025-01-17
23
+
24
+ - [`fa74928`](https://github.com/alexfalkowski/nonnative/commit/fa74928d7927cbb797d0b7348b10ba42be00aea9) fix(deps): bump ruby-lsp from 0.23.5 to 0.23.6 (#484)
25
+
26
+ ## [v1.84.8](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.8) - 2025-01-16
27
+
28
+ - [`c9d488a`](https://github.com/alexfalkowski/nonnative/commit/c9d488ae8a73424dfb3125e639ad551c2f7cf2d0) fix(deps): bump concurrent-ruby from 1.3.4 to 1.3.5 (#483)
29
+ - [`2b7f2a9`](https://github.com/alexfalkowski/nonnative/commit/2b7f2a998032196eeabf7a9373d97da0fa831c2e) build(ci): update ruby:1.3 (#482)
30
+
31
+ ## [v1.84.7](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.7) - 2025-01-13
32
+
33
+ - [`af10e51`](https://github.com/alexfalkowski/nonnative/commit/af10e51fd4b2115df69d84c341b5e2c76672484a) fix(deps): bump rubocop from 1.69.2 to 1.70.0 (#480)
34
+
35
+ ## [v1.84.6](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.6) - 2025-01-13
36
+
37
+ - [`f7420d4`](https://github.com/alexfalkowski/nonnative/commit/f7420d4387eb01755a2acd555dd06bb9f06cd985) fix(deps): bump ruby-lsp from 0.23.3 to 0.23.5 (#481)
38
+
39
+ ## [v1.84.5](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.5) - 2025-01-13
40
+
41
+ - [`c4435ec`](https://github.com/alexfalkowski/nonnative/commit/c4435ec1cb787d776761d8c3886f556ece701962) fix(deps): bump cucumber from 9.2.0 to 9.2.1 (#479)
42
+
43
+ ## [v1.84.4](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.4) - 2025-01-10
44
+
45
+ - [`85363ba`](https://github.com/alexfalkowski/nonnative/commit/85363ba28291e6fc6c07cf04b951349f5919fead) fix(deps): bump grpc from 1.68.1 to 1.69.0 (#476)
46
+
47
+ ## [v1.84.3](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.3) - 2025-01-10
48
+
49
+ - [`f2635c9`](https://github.com/alexfalkowski/nonnative/commit/f2635c9a53d22fe1dfb9be955ed319f555765443) fix(deps): bump ruby-lsp from 0.23.1 to 0.23.3 (#477)
50
+ - [`9ab3987`](https://github.com/alexfalkowski/nonnative/commit/9ab3987d629298e397804e1c1ba01c2d14d933c4) build(deps): bump bin from `a278340` to `cb313fe` (#478)
51
+
52
+ ## [v1.84.2](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.2) - 2025-01-07
53
+
54
+ - [`82194e1`](https://github.com/alexfalkowski/nonnative/commit/82194e14b69691860a3d289448f94711a5d18db7) fix(deps): bump ruby-lsp from 0.22.1 to 0.23.1 (#475)
55
+ - [`66da445`](https://github.com/alexfalkowski/nonnative/commit/66da445e63ff2488594ec3298cde30963f576dcb) build(deps): bump bin from `08600e7` to `a278340` (#474)
56
+ - [`7ca543c`](https://github.com/alexfalkowski/nonnative/commit/7ca543c78f0d61f7357cb1b9d9988a5ea28cec20) build(ci): add make clean-dep (#473)
57
+ - [`982e551`](https://github.com/alexfalkowski/nonnative/commit/982e5514b9f698e53d1a175e717c41192a2987f2) build(deps): bump bin from `bde1e44` to `08600e7` (#472)
58
+ - [`10b1db6`](https://github.com/alexfalkowski/nonnative/commit/10b1db64908e7200d86dfb7f8690d9c673f1227e) test(deps): upgraded bundler to 2.6.1 (#471)
59
+ - [`f5b0c17`](https://github.com/alexfalkowski/nonnative/commit/f5b0c17b33d1af1b58e8f6d5d757a29c89c2bb15) build(deps): bump bin from `a433391` to `bde1e44` (#470)
60
+ - [`e4da404`](https://github.com/alexfalkowski/nonnative/commit/e4da4049682b648351815ecc28820d38d027a661) build(deps): bump bin from `9fa29e2` to `a433391` (#469)
61
+ - [`cd74167`](https://github.com/alexfalkowski/nonnative/commit/cd7416731e9c882b315aac3b5dae9f4f463c2e2b) build(deps): bump bin from `10049eb` to `9fa29e2` (#468)
62
+
9
63
  ## [v1.84.1](https://github.com/alexfalkowski/nonnative/releases/tag/v1.84.1) - 2024-12-17
10
64
 
11
65
  - [`1fb44bd`](https://github.com/alexfalkowski/nonnative/commit/1fb44bdb781b6d5d9f88e3d6565eca848aad189e) fix(config): make sure we set properties (#467)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.84.1)
4
+ nonnative (1.85.1)
5
5
  concurrent-ruby (>= 1, < 2)
6
6
  config (>= 5, < 6)
7
7
  cucumber (>= 7, < 10)
@@ -22,13 +22,13 @@ GEM
22
22
  benchmark-malloc (0.2.0)
23
23
  benchmark-perf (0.6.0)
24
24
  benchmark-trend (0.4.0)
25
- bigdecimal (3.1.8)
25
+ bigdecimal (3.1.9)
26
26
  builder (3.3.0)
27
- concurrent-ruby (1.3.4)
27
+ concurrent-ruby (1.3.5)
28
28
  config (5.5.2)
29
29
  deep_merge (~> 1.2, >= 1.2.1)
30
30
  ostruct
31
- cucumber (9.2.0)
31
+ cucumber (9.2.1)
32
32
  builder (~> 3.2)
33
33
  cucumber-ci-environment (> 9, < 11)
34
34
  cucumber-core (> 13, < 14)
@@ -49,7 +49,7 @@ GEM
49
49
  bigdecimal
50
50
  cucumber-gherkin (27.0.0)
51
51
  cucumber-messages (>= 19.1.4, < 23)
52
- cucumber-html-formatter (21.7.0)
52
+ cucumber-html-formatter (21.8.0)
53
53
  cucumber-messages (> 19, < 27)
54
54
  cucumber-messages (22.0.0)
55
55
  cucumber-tag-expressions (6.1.1)
@@ -57,42 +57,42 @@ GEM
57
57
  diff-lcs (1.5.1)
58
58
  docile (1.4.1)
59
59
  domain_name (0.6.20240107)
60
- ffi (1.17.0-arm64-darwin)
61
- ffi (1.17.0-x86_64-darwin)
62
- ffi (1.17.0-x86_64-linux-gnu)
60
+ ffi (1.17.1-arm64-darwin)
61
+ ffi (1.17.1-x86_64-darwin)
62
+ ffi (1.17.1-x86_64-linux-gnu)
63
63
  get_process_mem (1.0.0)
64
64
  bigdecimal (>= 2.0)
65
65
  ffi (~> 1.0)
66
- google-protobuf (4.29.1-arm64-darwin)
66
+ google-protobuf (4.29.3-arm64-darwin)
67
67
  bigdecimal
68
68
  rake (>= 13)
69
- google-protobuf (4.29.1-x86_64-darwin)
69
+ google-protobuf (4.29.3-x86_64-darwin)
70
70
  bigdecimal
71
71
  rake (>= 13)
72
- google-protobuf (4.29.1-x86_64-linux)
72
+ google-protobuf (4.29.3-x86_64-linux)
73
73
  bigdecimal
74
74
  rake (>= 13)
75
- googleapis-common-protos-types (1.16.0)
75
+ googleapis-common-protos-types (1.18.0)
76
76
  google-protobuf (>= 3.18, < 5.a)
77
- grpc (1.68.1-arm64-darwin)
77
+ grpc (1.69.0-arm64-darwin)
78
78
  google-protobuf (>= 3.25, < 5.0)
79
79
  googleapis-common-protos-types (~> 1.0)
80
- grpc (1.68.1-x86_64-darwin)
80
+ grpc (1.69.0-x86_64-darwin)
81
81
  google-protobuf (>= 3.25, < 5.0)
82
82
  googleapis-common-protos-types (~> 1.0)
83
- grpc (1.68.1-x86_64-linux)
83
+ grpc (1.69.0-x86_64-linux)
84
84
  google-protobuf (>= 3.25, < 5.0)
85
85
  googleapis-common-protos-types (~> 1.0)
86
86
  http-accept (1.7.0)
87
87
  http-cookie (1.0.8)
88
88
  domain_name (~> 0.5)
89
- json (2.9.0)
89
+ json (2.9.1)
90
90
  language_server-protocol (3.17.0.3)
91
- logger (1.6.3)
91
+ logger (1.6.5)
92
92
  mime-types (3.6.0)
93
93
  logger
94
94
  mime-types-data (~> 3.2015)
95
- mime-types-data (3.2024.1203)
95
+ mime-types-data (3.2025.0107)
96
96
  mini_mime (1.1.5)
97
97
  multi_test (1.1.0)
98
98
  mustermann (3.0.3)
@@ -101,10 +101,10 @@ GEM
101
101
  nio4r (2.7.4)
102
102
  ostruct (0.6.1)
103
103
  parallel (1.26.3)
104
- parser (3.3.6.0)
104
+ parser (3.3.7.0)
105
105
  ast (~> 2.4.1)
106
106
  racc
107
- prism (1.2.0)
107
+ prism (1.3.0)
108
108
  puma (6.5.0)
109
109
  nio4r (~> 2.0)
110
110
  racc (1.8.1)
@@ -113,13 +113,14 @@ GEM
113
113
  base64 (>= 0.1.0)
114
114
  logger (>= 1.6.0)
115
115
  rack (>= 3.0.0, < 4)
116
- rack-session (2.0.0)
116
+ rack-session (2.1.0)
117
+ base64 (>= 0.1.0)
117
118
  rack (>= 3.0.0)
118
119
  rainbow (3.1.1)
119
120
  rake (13.2.1)
120
- rbs (3.7.0)
121
+ rbs (3.8.1)
121
122
  logger
122
- regexp_parser (2.9.3)
123
+ regexp_parser (2.10.0)
123
124
  rest-client (2.1.0)
124
125
  http-accept (>= 1.7.0, < 2.0)
125
126
  http-cookie (>= 1.0.2, < 2.0)
@@ -146,7 +147,7 @@ GEM
146
147
  rspec-support (3.13.2)
147
148
  rspec-wait (1.0.1)
148
149
  rspec (>= 3.4)
149
- rubocop (1.69.2)
150
+ rubocop (1.71.0)
150
151
  json (~> 2.3)
151
152
  language_server-protocol (>= 3.17.0)
152
153
  parallel (~> 1.10)
@@ -158,7 +159,7 @@ GEM
158
159
  unicode-display_width (>= 2.4.0, < 4.0)
159
160
  rubocop-ast (1.37.0)
160
161
  parser (>= 3.3.1.0)
161
- ruby-lsp (0.22.1)
162
+ ruby-lsp (0.23.6)
162
163
  language_server-protocol (~> 3.17.0)
163
164
  prism (>= 1.2, < 2.0)
164
165
  rbs (>= 3, < 4)
@@ -181,11 +182,11 @@ GEM
181
182
  rack-protection (= 4.1.1)
182
183
  rack-session (>= 2.0.0, < 3)
183
184
  tilt (~> 2.0)
184
- sorbet-runtime (0.5.11699)
185
+ sorbet-runtime (0.5.11781)
185
186
  sys-uname (1.3.1)
186
187
  ffi (~> 1.1)
187
- tilt (2.4.0)
188
- unicode-display_width (3.1.2)
188
+ tilt (2.6.0)
189
+ unicode-display_width (3.1.4)
189
190
  unicode-emoji (~> 4.0, >= 4.0.4)
190
191
  unicode-emoji (4.0.4)
191
192
 
@@ -204,4 +205,4 @@ DEPENDENCIES
204
205
  simplecov-cobertura
205
206
 
206
207
  BUNDLED WITH
207
- 2.5.9
208
+ 2.6.2
data/README.md CHANGED
@@ -37,6 +37,7 @@ 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).
40
41
  - Process, Server or Service that you want to start.
41
42
  - A timeout value.
42
43
  - A time to wait.
@@ -64,6 +65,7 @@ require 'nonnative'
64
65
  Nonnative.configure do |config|
65
66
  config.version = '1.0'
66
67
  config.url = 'http://localhost:4567'
68
+ config.wait = 2.0
67
69
 
68
70
  config.process do |p|
69
71
  p.name = 'start_1'
@@ -94,6 +96,7 @@ Setup it up through configuration:
94
96
  ```yaml
95
97
  version: "1.0"
96
98
  url: http://localhost:4567
99
+ wait: 2.0
97
100
  processes:
98
101
  -
99
102
  name: start_1
@@ -8,13 +8,14 @@ module Nonnative
8
8
  @services = []
9
9
  end
10
10
 
11
- attr_accessor :version, :url, :processes, :servers, :services
11
+ attr_accessor :version, :url, :wait, :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
18
19
 
19
20
  add_processes(cfg)
20
21
  add_servers(cfg)
@@ -23,16 +23,22 @@ 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
26
28
  end
27
29
 
28
30
  Given('I set the proxy for server {string} to {string}') do |name, operation|
29
31
  server = Nonnative.pool.server_by_name(name)
30
32
  server.proxy.send(operation)
33
+
34
+ Nonnative.wait
31
35
  end
32
36
 
33
37
  Given('I set the proxy for service {string} to {string}') do |name, operation|
34
38
  service = Nonnative.pool.service_by_name(name)
35
39
  service.proxy.send(operation)
40
+
41
+ Nonnative.wait
36
42
  end
37
43
 
38
44
  Given('I start the system') do
@@ -4,7 +4,10 @@ module Nonnative
4
4
  class HTTPServer < Nonnative::Server
5
5
  def initialize(service)
6
6
  log = File.open(service.log, 'a')
7
- options = { log_writer: Puma::LogWriter.new(log, log) }
7
+ options = {
8
+ log_writer: Puma::LogWriter.new(log, log),
9
+ force_shutdown_after: service.timeout
10
+ }
8
11
  @server = Puma::Server.new(app, Puma::Events.new, options)
9
12
 
10
13
  super
@@ -14,22 +17,22 @@ module Nonnative
14
17
 
15
18
  def perform_start
16
19
  server.add_tcp_listener proxy.host, proxy.port
17
- server.run.join
20
+ server.run(false)
18
21
  end
19
22
 
20
23
  def perform_stop
21
- server.stop(true)
24
+ server.graceful_shutdown
22
25
  end
23
26
 
24
27
  def wait_start
25
28
  timeout.perform do
26
- super until server.running
29
+ super while server.running == 0
27
30
  end
28
31
  end
29
32
 
30
33
  def wait_stop
31
34
  timeout.perform do
32
- super while server.running
35
+ super while server.running != 0
33
36
  end
34
37
  end
35
38
 
@@ -40,7 +40,7 @@ module Nonnative
40
40
  end
41
41
 
42
42
  def read(socket)
43
- socket.recv(1024)
43
+ socket.recv(1024) || ''
44
44
  end
45
45
 
46
46
  def write(socket, data)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.84.1'
4
+ VERSION = '1.85.1'
5
5
  end
data/lib/nonnative.rb CHANGED
@@ -58,6 +58,12 @@ module Nonnative
58
58
  class << self
59
59
  attr_reader :pool
60
60
 
61
+ def wait
62
+ wait = Nonnative.configuration.wait
63
+
64
+ sleep wait if wait
65
+ end
66
+
61
67
  def configurations(*files)
62
68
  Config.load_files(files)
63
69
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.84.1
4
+ version: 1.85.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-17 00:00:00.000000000 Z
10
+ date: 2025-01-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: concurrent-ruby
@@ -292,7 +291,6 @@ licenses:
292
291
  - MIT
293
292
  metadata:
294
293
  rubygems_mfa_required: 'true'
295
- post_install_message:
296
294
  rdoc_options: []
297
295
  require_paths:
298
296
  - lib
@@ -310,8 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
308
  - !ruby/object:Gem::Version
311
309
  version: '0'
312
310
  requirements: []
313
- rubygems_version: 3.5.22
314
- signing_key:
311
+ rubygems_version: 3.6.2
315
312
  specification_version: 4
316
313
  summary: Allows you to keep using the power of ruby to test other systems
317
314
  test_files: []