nonnative 1.103.0 → 1.104.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/.circleci/config.yml +2 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -3
- data/README.md +36 -9
- data/lib/nonnative/configuration.rb +2 -1
- data/lib/nonnative/http_client.rb +4 -4
- data/lib/nonnative/observability.rb +10 -4
- data/lib/nonnative/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a156d00f9bb25f8708a472ad883786792d1157f3cbcebc397b82b67e43b7d96
|
4
|
+
data.tar.gz: abe720e0fc99143fb9ad42e87cb44f7b752a8d1e4f0a0caf09c68b3efa483d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dedf8147ac61d2f5f798cb69e87ddac0b145427b41fcd5c7d5b63209694cf2bc96b8f7a0818d703a5af6cb057a8a7ef80fd3198f089e33e31dbd17a773d3aec
|
7
|
+
data.tar.gz: f497eccc784286d9f51a32d2ce33df1cfefa129e507a130e7e7367fdaaefacb2168219fe80844afb5ca55d634819b24fbd810ba5243148a68b91091b28e0ed2a
|
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:1.
|
6
|
+
- image: alexfalkowski/ruby:1.35
|
7
7
|
working_directory: ~/nonnative
|
8
8
|
steps:
|
9
9
|
- checkout
|
@@ -31,7 +31,7 @@ jobs:
|
|
31
31
|
resource_class: large
|
32
32
|
release:
|
33
33
|
docker:
|
34
|
-
- image: alexfalkowski/release:3.
|
34
|
+
- image: alexfalkowski/release:3.24
|
35
35
|
working_directory: ~/nonnative
|
36
36
|
steps:
|
37
37
|
- checkout
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## [v1.104.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.104.0) - 2025-06-09
|
10
|
+
|
11
|
+
- [`834596d`](https://github.com/alexfalkowski/nonnative/commit/834596d18be24b990238c3abcd0cefbced1132e9) feat(observability): prefix with name (#578)
|
12
|
+
- [`e169924`](https://github.com/alexfalkowski/nonnative/commit/e169924fc0a1d31414951dc426bab97bb836f9ea) test(deps): bump ruby-lsp from 0.23.24 to 0.24.1 (#577)
|
13
|
+
|
9
14
|
## [v1.103.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.103.0) - 2025-06-06
|
10
15
|
|
11
16
|
- [`2e2b7e4`](https://github.com/alexfalkowski/nonnative/commit/2e2b7e46a6005a265bb00baa600bdc0e954486f3) feat(socket): use predicate method (#576)
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nonnative (1.
|
4
|
+
nonnative (1.104.0)
|
5
5
|
concurrent-ruby (>= 1, < 2)
|
6
6
|
config (>= 5, < 6)
|
7
7
|
cucumber (>= 7, < 10)
|
@@ -157,7 +157,7 @@ GEM
|
|
157
157
|
rubocop-ast (1.45.0)
|
158
158
|
parser (>= 3.3.7.2)
|
159
159
|
prism (~> 1.4)
|
160
|
-
ruby-lsp (0.
|
160
|
+
ruby-lsp (0.24.1)
|
161
161
|
language_server-protocol (~> 3.17.0)
|
162
162
|
prism (>= 1.2, < 2.0)
|
163
163
|
rbs (>= 3, < 5)
|
@@ -180,7 +180,7 @@ GEM
|
|
180
180
|
rack-protection (= 4.1.1)
|
181
181
|
rack-session (>= 2.0.0, < 3)
|
182
182
|
tilt (~> 2.0)
|
183
|
-
sorbet-runtime (0.5.
|
183
|
+
sorbet-runtime (0.5.12163)
|
184
184
|
sys-uname (1.3.1)
|
185
185
|
ffi (~> 1.1)
|
186
186
|
tilt (2.6.0)
|
data/README.md
CHANGED
@@ -25,17 +25,22 @@ gem 'nonnative'
|
|
25
25
|
|
26
26
|
And then execute:
|
27
27
|
|
28
|
-
|
28
|
+
```bash
|
29
|
+
bundle
|
30
|
+
```
|
29
31
|
|
30
32
|
Or install it yourself as:
|
31
33
|
|
32
|
-
|
34
|
+
```bash
|
35
|
+
gem install nonnative
|
36
|
+
```
|
33
37
|
|
34
38
|
## Usage
|
35
39
|
|
36
40
|
Configure nonnative with the following:
|
37
41
|
|
38
42
|
- The version of the configuration (1.0).
|
43
|
+
- The name of the service.
|
39
44
|
- The URL of the service.
|
40
45
|
- A log file.
|
41
46
|
- Process, Server or Service that you want to start.
|
@@ -49,6 +54,7 @@ Configure nonnative with the following:
|
|
49
54
|
### Strategy
|
50
55
|
|
51
56
|
The strategy can be one of the following values:
|
57
|
+
|
52
58
|
- startup - When we include `nonnative/startup`, it will start it once.
|
53
59
|
- before - When we tag our features with `@startup` it will start and stop after the scenario.
|
54
60
|
- manual - When we tag our features with `@manual` it will stop after the scenario.
|
@@ -64,6 +70,7 @@ require 'nonnative'
|
|
64
70
|
|
65
71
|
Nonnative.configure do |config|
|
66
72
|
config.version = '1.0'
|
73
|
+
config.name = 'test'
|
67
74
|
config.url = 'http://localhost:4567'
|
68
75
|
config.log = 'nonnative.log'
|
69
76
|
|
@@ -95,6 +102,7 @@ Setup it up through configuration:
|
|
95
102
|
|
96
103
|
```yaml
|
97
104
|
version: "1.0"
|
105
|
+
name: test
|
98
106
|
url: http://localhost:4567
|
99
107
|
log: nonnative.log
|
100
108
|
processes:
|
@@ -176,6 +184,7 @@ require 'nonnative'
|
|
176
184
|
|
177
185
|
Nonnative.configure do |config|
|
178
186
|
config.version = '1.0'
|
187
|
+
config.name = 'test'
|
179
188
|
config.url = 'http://localhost:4567'
|
180
189
|
config.log = 'nonnative.log'
|
181
190
|
|
@@ -201,6 +210,7 @@ Setup it up through configuration:
|
|
201
210
|
|
202
211
|
```yaml
|
203
212
|
version: "1.0"
|
213
|
+
name: test
|
204
214
|
url: http://localhost:4567
|
205
215
|
log: nonnative.log
|
206
216
|
servers:
|
@@ -257,6 +267,7 @@ require 'nonnative'
|
|
257
267
|
|
258
268
|
Nonnative.configure do |config|
|
259
269
|
config.version = '1.0'
|
270
|
+
config.name = 'test'
|
260
271
|
config.url = 'http://localhost:4567'
|
261
272
|
config.log = 'nonnative.log'
|
262
273
|
|
@@ -274,6 +285,7 @@ Setup it up through configuration:
|
|
274
285
|
|
275
286
|
```yaml
|
276
287
|
version: "1.0"
|
288
|
+
name: test
|
277
289
|
url: http://localhost:4567
|
278
290
|
log: nonnative.log
|
279
291
|
servers:
|
@@ -320,6 +332,7 @@ require 'nonnative'
|
|
320
332
|
|
321
333
|
Nonnative.configure do |config|
|
322
334
|
config.version = '1.0'
|
335
|
+
config.name = 'test'
|
323
336
|
config.url = 'http://localhost:4567'
|
324
337
|
config.log = 'nonnative.log'
|
325
338
|
|
@@ -337,6 +350,7 @@ Setup it up through configuration:
|
|
337
350
|
|
338
351
|
```yaml
|
339
352
|
version: "1.0"
|
353
|
+
name: test
|
340
354
|
url: http://localhost:4567
|
341
355
|
log: nonnative.log
|
342
356
|
servers:
|
@@ -387,6 +401,7 @@ require 'nonnative'
|
|
387
401
|
|
388
402
|
Nonnative.configure do |config|
|
389
403
|
config.version = '1.0'
|
404
|
+
config.name = 'test'
|
390
405
|
config.url = 'http://localhost:4567'
|
391
406
|
config.log = 'nonnative.log'
|
392
407
|
|
@@ -404,6 +419,7 @@ Setup it up through configuration:
|
|
404
419
|
|
405
420
|
```yaml
|
406
421
|
version: "1.0"
|
422
|
+
name: test
|
407
423
|
url: http://localhost:4567
|
408
424
|
log: nonnative.log
|
409
425
|
servers:
|
@@ -436,6 +452,7 @@ require 'nonnative'
|
|
436
452
|
|
437
453
|
Nonnative.configure do |config|
|
438
454
|
config.version = '1.0'
|
455
|
+
config.name = 'test'
|
439
456
|
config.url = 'http://localhost:4567'
|
440
457
|
config.log = 'nonnative.log'
|
441
458
|
|
@@ -455,6 +472,7 @@ Setup it up through configuration:
|
|
455
472
|
|
456
473
|
```yaml
|
457
474
|
version: "1.0"
|
475
|
+
name: test
|
458
476
|
url: http://localhost:4567
|
459
477
|
log: nonnative.log
|
460
478
|
processes:
|
@@ -479,10 +497,11 @@ end
|
|
479
497
|
#### Proxies
|
480
498
|
|
481
499
|
We allow different proxies to be configured. These proxies can be used to simulate all kind of situations. The proxies that can be configured are:
|
500
|
+
|
482
501
|
- `none` (this is the default)
|
483
502
|
- `fault_injection`
|
484
503
|
|
485
|
-
##### Processes
|
504
|
+
##### Proxies Processes
|
486
505
|
|
487
506
|
Setup it up programmatically:
|
488
507
|
|
@@ -491,6 +510,7 @@ require 'nonnative'
|
|
491
510
|
|
492
511
|
Nonnative.configure do |config|
|
493
512
|
config.version = '1.0'
|
513
|
+
config.name = 'test'
|
494
514
|
config.url = 'http://localhost:4567'
|
495
515
|
config.log = 'nonnative.log'
|
496
516
|
|
@@ -512,6 +532,7 @@ Setup it up through configuration:
|
|
512
532
|
|
513
533
|
```yaml
|
514
534
|
version: "1.0"
|
535
|
+
name: test
|
515
536
|
url: http://localhost:4567
|
516
537
|
log: nonnative.log
|
517
538
|
processes:
|
@@ -525,7 +546,7 @@ processes:
|
|
525
546
|
delay: 5
|
526
547
|
```
|
527
548
|
|
528
|
-
##### Servers
|
549
|
+
##### Proxies Servers
|
529
550
|
|
530
551
|
Setup it up programmatically:
|
531
552
|
|
@@ -534,6 +555,7 @@ require 'nonnative'
|
|
534
555
|
|
535
556
|
Nonnative.configure do |config|
|
536
557
|
config.version = '1.0'
|
558
|
+
config.name = 'test'
|
537
559
|
config.url = 'http://localhost:4567'
|
538
560
|
config.log = 'nonnative.log'
|
539
561
|
|
@@ -555,6 +577,7 @@ Setup it up through configuration:
|
|
555
577
|
|
556
578
|
```yaml
|
557
579
|
version: "1.0"
|
580
|
+
name: test
|
558
581
|
url: http://localhost:4567
|
559
582
|
log: nonnative.log
|
560
583
|
servers:
|
@@ -568,7 +591,7 @@ servers:
|
|
568
591
|
delay: 5
|
569
592
|
```
|
570
593
|
|
571
|
-
##### Services
|
594
|
+
##### Proxies Services
|
572
595
|
|
573
596
|
Setup it up programmatically:
|
574
597
|
|
@@ -577,6 +600,7 @@ require 'nonnative'
|
|
577
600
|
|
578
601
|
Nonnative.configure do |config|
|
579
602
|
config.version = '1.0'
|
603
|
+
config.name = 'test'
|
580
604
|
config.url = 'http://localhost:4567'
|
581
605
|
config.log = 'nonnative.log'
|
582
606
|
config.wait = 1
|
@@ -599,6 +623,7 @@ Setup it up through configuration:
|
|
599
623
|
|
600
624
|
```yaml
|
601
625
|
version: "1.0"
|
626
|
+
name: test
|
602
627
|
url: http://localhost:4567
|
603
628
|
log: nonnative.log
|
604
629
|
wait: 1
|
@@ -616,11 +641,12 @@ services:
|
|
616
641
|
##### Fault Injection
|
617
642
|
|
618
643
|
The `fault_injection` proxy allows you to simulate failures by injecting them. We currently support the following:
|
644
|
+
|
619
645
|
- `close_all` - Closes the socket as soon as it connects.
|
620
646
|
- `delay` - This delays the communication between the connection. Default is 2 secs can be configured through options.
|
621
647
|
- `invalid_data` - This takes the input and rearranges it to produce invalid data.
|
622
648
|
|
623
|
-
###### Processes
|
649
|
+
###### Fault Injection Processes
|
624
650
|
|
625
651
|
Setup it up programmatically:
|
626
652
|
|
@@ -639,7 +665,7 @@ Given I set the proxy for process 'process_1' to 'close_all'
|
|
639
665
|
Then I should reset the proxy for process 'process_1'
|
640
666
|
```
|
641
667
|
|
642
|
-
###### Servers
|
668
|
+
###### Fault Injection Servers
|
643
669
|
|
644
670
|
Setup it up programmatically:
|
645
671
|
|
@@ -658,7 +684,7 @@ Given I set the proxy for server 'server_1' to 'close_all'
|
|
658
684
|
Then I should reset the proxy for server 'server_1'
|
659
685
|
```
|
660
686
|
|
661
|
-
###### Services
|
687
|
+
###### Fault Injection Services
|
662
688
|
|
663
689
|
Setup it up programmatically:
|
664
690
|
|
@@ -691,7 +717,7 @@ package main
|
|
691
717
|
import "testing"
|
692
718
|
|
693
719
|
func TestFeatures(t *testing.T) {
|
694
|
-
|
720
|
+
main()
|
695
721
|
}
|
696
722
|
```
|
697
723
|
|
@@ -713,6 +739,7 @@ Setup it up through configuration:
|
|
713
739
|
|
714
740
|
```yaml
|
715
741
|
version: "1.0"
|
742
|
+
name: test
|
716
743
|
url: http://localhost:4567
|
717
744
|
log: nonnative.log
|
718
745
|
processes:
|
@@ -8,12 +8,13 @@ module Nonnative
|
|
8
8
|
@services = []
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_accessor :version, :url, :log, :processes, :servers, :services
|
11
|
+
attr_accessor :name, :version, :url, :log, :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
|
+
self.name = cfg.name
|
17
18
|
self.url = cfg.url
|
18
19
|
self.log = cfg.log
|
19
20
|
|
@@ -4,7 +4,7 @@ module Nonnative
|
|
4
4
|
class HTTPClient
|
5
5
|
def initialize(host)
|
6
6
|
@host = host
|
7
|
-
@
|
7
|
+
@exceptions = [
|
8
8
|
RestClient::Exceptions::Timeout,
|
9
9
|
RestClient::ServerBrokeConnection
|
10
10
|
]
|
@@ -13,7 +13,7 @@ module Nonnative
|
|
13
13
|
protected
|
14
14
|
|
15
15
|
def with_retry(tries, wait, &)
|
16
|
-
Retriable.retriable(tries: tries, base_interval: wait, on:
|
16
|
+
Retriable.retriable(tries: tries, base_interval: wait, on: exceptions, &)
|
17
17
|
end
|
18
18
|
|
19
19
|
def get(pathname, opts = {})
|
@@ -46,11 +46,11 @@ module Nonnative
|
|
46
46
|
|
47
47
|
private
|
48
48
|
|
49
|
-
attr_reader :host, :
|
49
|
+
attr_reader :host, :exceptions
|
50
50
|
|
51
51
|
def with_exception
|
52
52
|
yield
|
53
|
-
rescue *
|
53
|
+
rescue *exceptions => e
|
54
54
|
raise e
|
55
55
|
rescue RestClient::Exception => e
|
56
56
|
e.response
|
@@ -3,19 +3,25 @@
|
|
3
3
|
module Nonnative
|
4
4
|
class Observability < Nonnative::HTTPClient
|
5
5
|
def health(opts = {})
|
6
|
-
get(
|
6
|
+
get("#{name}/healthz", opts)
|
7
7
|
end
|
8
8
|
|
9
9
|
def liveness(opts = {})
|
10
|
-
get(
|
10
|
+
get("#{name}/livez", opts)
|
11
11
|
end
|
12
12
|
|
13
13
|
def readiness(opts = {})
|
14
|
-
get(
|
14
|
+
get("#{name}/readyz", opts)
|
15
15
|
end
|
16
16
|
|
17
17
|
def metrics(opts = {})
|
18
|
-
get(
|
18
|
+
get("#{name}/metrics", opts)
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def name
|
24
|
+
Nonnative.configuration.name
|
19
25
|
end
|
20
26
|
end
|
21
27
|
end
|
data/lib/nonnative/version.rb
CHANGED