nonnative 1.31.0 → 1.39.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 +17 -12
- data/.config/cucumber.yml +1 -1
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +169 -0
- data/Gemfile.lock +92 -63
- data/Makefile +8 -8
- data/README.md +2 -6
- data/lib/nonnative.rb +4 -0
- data/lib/nonnative/close_all_socket_pair.rb +1 -0
- data/lib/nonnative/fault_injection_proxy.rb +30 -11
- data/lib/nonnative/go_command.rb +7 -12
- data/lib/nonnative/socket_pair.rb +2 -5
- data/lib/nonnative/socket_pair_factory.rb +2 -2
- data/lib/nonnative/version.rb +1 -1
- data/nonnative.gemspec +3 -3
- metadata +13 -19
- data/sonar-project.properties +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 05eabed13ed77a7eea02eb898db4a670c53286639168190c1f068e8683606e9d
|
|
4
|
+
data.tar.gz: a50f29b97792cf8248187e30f3aabfb5d204fae05235821b5b358176feca7997
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbed996363616c31404a70079bdfa475aa8917b8f7edc492af04cff257db468599ffc04ab68ac452f47071bee00ffefc0d4e49186f9c58c7cb8a242bb0ea9240
|
|
7
|
+
data.tar.gz: 2190e7f96f504645c9e4069660d3af06309a08e48ecb13984656dcc68ee93edd813bbf8ab275eea7f3fee9c7efe2fa9a2c22df9017b5fbfcc673c244a35c0fba
|
data/.circleci/config.yml
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
version: 2.1
|
|
2
|
-
orbs:
|
|
3
|
-
sonarcloud: sonarsource/sonarcloud@1.0.1
|
|
4
2
|
|
|
5
3
|
jobs:
|
|
6
4
|
build:
|
|
7
5
|
docker:
|
|
8
|
-
- image:
|
|
9
|
-
environment:
|
|
10
|
-
BUNDLE_JOBS: "3"
|
|
11
|
-
BUNDLE_PATH: vendor/bundle
|
|
12
|
-
BUNDLE_RETRY: "3"
|
|
6
|
+
- image: alexfalkowski/ruby:2.7
|
|
13
7
|
steps:
|
|
14
8
|
- checkout
|
|
15
9
|
- restore_cache:
|
|
16
10
|
keys:
|
|
17
11
|
- nonnative-gem-cache-{{ checksum "Gemfile.lock" }}
|
|
18
12
|
- nonnative-gem-cache-
|
|
19
|
-
- run: make
|
|
13
|
+
- run: make dep
|
|
20
14
|
- save_cache:
|
|
21
15
|
key: nonnative-gem-cache-{{ checksum "Gemfile.lock" }}
|
|
22
16
|
paths:
|
|
@@ -24,15 +18,26 @@ jobs:
|
|
|
24
18
|
- run: make features
|
|
25
19
|
- store_test_results:
|
|
26
20
|
path: reports
|
|
27
|
-
- run: make
|
|
21
|
+
- run: make lint
|
|
28
22
|
- store_artifacts:
|
|
29
23
|
path: coverage
|
|
30
24
|
- store_artifacts:
|
|
31
25
|
path: features/logs
|
|
32
|
-
|
|
26
|
+
release:
|
|
27
|
+
docker:
|
|
28
|
+
- image: alexfalkowski/release:2.0
|
|
29
|
+
steps:
|
|
30
|
+
- checkout
|
|
31
|
+
- run: release.sh
|
|
33
32
|
|
|
34
33
|
workflows:
|
|
35
34
|
nonnative:
|
|
36
35
|
jobs:
|
|
37
|
-
- build
|
|
38
|
-
|
|
36
|
+
- build
|
|
37
|
+
- release:
|
|
38
|
+
context: gh
|
|
39
|
+
requires:
|
|
40
|
+
- build
|
|
41
|
+
filters:
|
|
42
|
+
branches:
|
|
43
|
+
only: master
|
data/.config/cucumber.yml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
report: --format junit --out reports --format html --out reports/index.html --format pretty
|
|
1
|
+
report: --format junit --out reports --format html --out reports/index.html --format pretty --publish-quiet
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby-2.7.
|
|
1
|
+
ruby-2.7.2
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## [1.39.0](https://github.com/alexfalkowski/nonnative/compare/v1.38.0...v1.39.0) (2021-04-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* log interruptions ([#75](https://github.com/alexfalkowski/nonnative/issues/75)) ([bde3e05](https://github.com/alexfalkowski/nonnative/commit/bde3e052b422a0ca659cfb54fcf3ca9d8a1fb20c))
|
|
11
|
+
|
|
12
|
+
## [1.38.0](https://github.com/alexfalkowski/nonnative/compare/v1.37.0...v1.38.0) (2021-04-22)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* terminate connections on change ([#74](https://github.com/alexfalkowski/nonnative/issues/74)) ([6c1cc8e](https://github.com/alexfalkowski/nonnative/commit/6c1cc8e1c3f15d11848889852897b523f5848794))
|
|
18
|
+
|
|
19
|
+
## [1.37.0](https://github.com/alexfalkowski/nonnative/compare/v1.36.0...v1.37.0) (2021-04-22)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* simplify go exeutable ([#73](https://github.com/alexfalkowski/nonnative/issues/73)) ([95e4cf4](https://github.com/alexfalkowski/nonnative/commit/95e4cf44180ee84d32cc42ee058d6742732b57b9))
|
|
25
|
+
|
|
26
|
+
## [1.36.0](https://github.com/alexfalkowski/nonnative/compare/v1.35.2...v1.36.0) (2021-04-21)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* remove badge from docs ([#72](https://github.com/alexfalkowski/nonnative/issues/72)) ([2cd384c](https://github.com/alexfalkowski/nonnative/commit/2cd384cb9f73da1f131829f1eaf9b0c9e1ae3cdf))
|
|
32
|
+
|
|
33
|
+
### [1.35.2](https://github.com/alexfalkowski/nonnative/compare/v1.35.1...v1.35.2) (2021-04-21)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* go command ([#71](https://github.com/alexfalkowski/nonnative/issues/71)) ([fe28cf3](https://github.com/alexfalkowski/nonnative/commit/fe28cf345be108780b47ac4c96d212b215d721a8))
|
|
39
|
+
|
|
40
|
+
### [1.35.1](https://github.com/alexfalkowski/nonnative/compare/v1.35.0...v1.35.1) (2021-04-04)
|
|
41
|
+
|
|
42
|
+
## [1.35.0](https://github.com/alexfalkowski/nonnative/compare/v1.34.0...v1.35.0) (2021-04-03)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* **deps:** udate to latest ([#69](https://github.com/alexfalkowski/nonnative/issues/69)) ([8989b5d](https://github.com/alexfalkowski/nonnative/commit/8989b5dd960cc7064ed196545625c9ef8b9ee280))
|
|
48
|
+
* update ruby to version 2.7.2 [ci skip] ([90d3cb7](https://github.com/alexfalkowski/nonnative/commit/90d3cb7b24d2c4a70dd8e4fad809f008c849b34b))
|
|
49
|
+
|
|
50
|
+
## [1.34.0](https://github.com/alexfalkowski/nonnative/compare/v1.33.0...v1.34.0) (2020-10-30)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* bump to version 1.34.0 ([882f3db](https://github.com/alexfalkowski/nonnative/commit/882f3db513a8ffae7661dd000d50a380c2c004d0))
|
|
56
|
+
|
|
57
|
+
## [1.33.0](https://github.com/alexfalkowski/nonnative/compare/v1.32.0...v1.33.0) (2020-10-30)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* bump to version 1.33.0 ([538ebf5](https://github.com/alexfalkowski/nonnative/commit/538ebf54c9d49ac3227f9c0a14ce9074d961c42d))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
* make sure we don't run ci again ([bf40e54](https://github.com/alexfalkowski/nonnative/commit/bf40e5471d7701040e64c035e652df534db7e783))
|
|
68
|
+
|
|
69
|
+
## [1.32.0](https://github.com/alexfalkowski/nonnative/compare/v1.31.0...v1.32.0) (2020-10-30)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
### Features
|
|
73
|
+
|
|
74
|
+
* update deps ([a18e739](https://github.com/alexfalkowski/nonnative/commit/a18e739285cab1e75b2c4bb2da573e4b437d05b5))
|
|
75
|
+
|
|
76
|
+
## 1.31.0 (2020-10-30)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Features
|
|
80
|
+
|
|
81
|
+
* abort on exception for threads ([16c236a](https://github.com/alexfalkowski/nonnative/commit/16c236afbd4e434d19d26166bf515def56907369))
|
|
82
|
+
* add ability to create chaos ([5c74b1f](https://github.com/alexfalkowski/nonnative/commit/5c74b1fc732017a658bd5e86ba8d1d849028bfa7))
|
|
83
|
+
* add ability to override strategy ([668f61b](https://github.com/alexfalkowski/nonnative/commit/668f61b3d802958bd2d948ba47f54df7ad4725f4))
|
|
84
|
+
* add chaos proxy ([84f6be8](https://github.com/alexfalkowski/nonnative/commit/84f6be83e5d00a582cf6458e34a1f1c169fe81b8))
|
|
85
|
+
* add concurrent-ruby ([0ba97ae](https://github.com/alexfalkowski/nonnative/commit/0ba97ae9c5d471564d9098e50864565208e941b3))
|
|
86
|
+
* add delay to proxy ([9004d56](https://github.com/alexfalkowski/nonnative/commit/9004d5643d38e530124077f777b7fec494aa5a10))
|
|
87
|
+
* add logging to servers ([a6c16a7](https://github.com/alexfalkowski/nonnative/commit/a6c16a7c43ec52b8a6a4766e92fdfe0179bc9b4b))
|
|
88
|
+
* add name property ([7804c22](https://github.com/alexfalkowski/nonnative/commit/7804c22e1e46bc7031628fd99fbb0e1382b9b438))
|
|
89
|
+
* add no proxy ([b819f6c](https://github.com/alexfalkowski/nonnative/commit/b819f6cf10ec86c52e7429e6948369905e079d38))
|
|
90
|
+
* add proxy logs ([66e0acd](https://github.com/alexfalkowski/nonnative/commit/66e0acd4aa01ae9b7335f6df4ff6d4f3c89239ac))
|
|
91
|
+
* add random-port (0.5.1) ([0cb80f0](https://github.com/alexfalkowski/nonnative/commit/0cb80f0a05189fa9aab4ce5ea01d83f02dfe78f7))
|
|
92
|
+
* add running go command ([4c45a19](https://github.com/alexfalkowski/nonnative/commit/4c45a19c9acfa157c67e2bdd1fd470558fa2f80f))
|
|
93
|
+
* add timeout ([dbe4d9b](https://github.com/alexfalkowski/nonnative/commit/dbe4d9b7e7f4d5ecdaa89a60a5b135ccefecc43d))
|
|
94
|
+
* grpc-tools (1.32.0) ([e2ea2fe](https://github.com/alexfalkowski/nonnative/commit/e2ea2fea8cda36cc97e11d75d7b29a12302ce5b5))
|
|
95
|
+
* invalid data ([f83d35f](https://github.com/alexfalkowski/nonnative/commit/f83d35ffc7374d182d8c3e4b513b460d38121c83))
|
|
96
|
+
* loosen grc dep ([11e8de4](https://github.com/alexfalkowski/nonnative/commit/11e8de4228417483c26213f40caee351dbbdf861))
|
|
97
|
+
* loosen grc dep ([498a6d5](https://github.com/alexfalkowski/nonnative/commit/498a6d56c9e157f15ebe77d57cd0477abdc8ec34))
|
|
98
|
+
* move to use predefined port ([439971f](https://github.com/alexfalkowski/nonnative/commit/439971fa0388380701e80bce18d7bf61f07f9bc7))
|
|
99
|
+
* pass options to socket pair ([7ebb938](https://github.com/alexfalkowski/nonnative/commit/7ebb9389c4cab8639f19bf234d65359fbfdef342))
|
|
100
|
+
* process start and stop in order ([589abe9](https://github.com/alexfalkowski/nonnative/commit/589abe9bee0743dc38a57aef5f73871eb277ec28))
|
|
101
|
+
* remove timeout ([d3dc376](https://github.com/alexfalkowski/nonnative/commit/d3dc376522aefd4856e15bba84309a5e77641db6))
|
|
102
|
+
* rename proxy ([5b87699](https://github.com/alexfalkowski/nonnative/commit/5b87699c622e9db7fed865ea75d8ee294c996b5e))
|
|
103
|
+
* socket pair ([d50112e](https://github.com/alexfalkowski/nonnative/commit/d50112e72f4a3f1af93ba2bc4274282c06690048))
|
|
104
|
+
* store connections in concurrent hash ([6731d95](https://github.com/alexfalkowski/nonnative/commit/6731d9523c933a6598ce07b3d65e9678d188c0ad))
|
|
105
|
+
* update cucumber (4.1.0) ([c38ea01](https://github.com/alexfalkowski/nonnative/commit/c38ea015dad051e494a1aa90b7452193735cad79))
|
|
106
|
+
* update deps ([7c9b11f](https://github.com/alexfalkowski/nonnative/commit/7c9b11fb35c9655f2d8b161498e134ab903c82c9))
|
|
107
|
+
* update grpc (1.30.1) ([98b7262](https://github.com/alexfalkowski/nonnative/commit/98b7262d76d30a0097db138e6236a43c296ce207))
|
|
108
|
+
* update puma ([36ff809](https://github.com/alexfalkowski/nonnative/commit/36ff809264c712240f50db24971f6045faaceac3))
|
|
109
|
+
* update to ruby-2.7.1 ([192ed03](https://github.com/alexfalkowski/nonnative/commit/192ed03c9d929e7fdadc80ab7b48b4a8081daed1))
|
|
110
|
+
* use puma ([2bfbb0f](https://github.com/alexfalkowski/nonnative/commit/2bfbb0f15d7e20647e72332aa3830c9144a1148d))
|
|
111
|
+
* use request ([c757b8b](https://github.com/alexfalkowski/nonnative/commit/c757b8b1d4f513451b08dd0408256244c7a29f7f))
|
|
112
|
+
* **command:** wait for pid ([5bf9a34](https://github.com/alexfalkowski/nonnative/commit/5bf9a34ab96b10365e894dd66b260c2aa902f19b))
|
|
113
|
+
* **grpc:** wait for server ([ba90600](https://github.com/alexfalkowski/nonnative/commit/ba906008ed7a8d72f8ee8f5f37eddf541be97a8a))
|
|
114
|
+
* **http:** add put and delete ([54b7b9a](https://github.com/alexfalkowski/nonnative/commit/54b7b9a906e0e80556c058ec85386cf4997d6a1b))
|
|
115
|
+
* **http:** wait for server to start ([10e0f37](https://github.com/alexfalkowski/nonnative/commit/10e0f37e0da9e0896365c771a8886dc0eb94906b))
|
|
116
|
+
* **process:** allow to pass different signal ([6b80e69](https://github.com/alexfalkowski/nonnative/commit/6b80e690f97e3f16a315a271dca5476647ce4177))
|
|
117
|
+
* add grpc (~> 1.28) ([6cabe9e](https://github.com/alexfalkowski/nonnative/commit/6cabe9e6e6107405459be0cdf93afc9fae742d6e))
|
|
118
|
+
* add overridable waiting ([be78cf4](https://github.com/alexfalkowski/nonnative/commit/be78cf47f2cb338cd98dff5ccfd5af3b41321428))
|
|
119
|
+
* **grpc:** use run instead of run_till_terminated ([f0609af](https://github.com/alexfalkowski/nonnative/commit/f0609afe3878a8d4e5eaef77457b7a868bc234e8))
|
|
120
|
+
* add ability to use configuration file ([f3d9c92](https://github.com/alexfalkowski/nonnative/commit/f3d9c923385ad338d42ec924ea60c16dcc1a6ed7))
|
|
121
|
+
* add puma (4.3.3) ([1b3b01c](https://github.com/alexfalkowski/nonnative/commit/1b3b01c17cb3b634e17a68e8e88404ff66fa6be5))
|
|
122
|
+
* add sinatra (2.0.8.1) ([2f27876](https://github.com/alexfalkowski/nonnative/commit/2f2787648deb641dbd78875433f0928e3b754cdd))
|
|
123
|
+
* add starting servers ([47955d3](https://github.com/alexfalkowski/nonnative/commit/47955d327d251ae0df99c6f99bbe4f5e8fa1acb9))
|
|
124
|
+
* add the ability to see the type that has issues ([d119ccc](https://github.com/alexfalkowski/nonnative/commit/d119ccc0f9575740b4a14c5bf5f1912c3db11692))
|
|
125
|
+
* enable rubocop cops ([00266e5](https://github.com/alexfalkowski/nonnative/commit/00266e52cb20d058ebccc5f09f4787d1f6899400))
|
|
126
|
+
* lock cucumber ([a4817a8](https://github.com/alexfalkowski/nonnative/commit/a4817a8d57edb23ebb93610c86f5539ef79af243))
|
|
127
|
+
* lock rspec-benchmark ([03d9b62](https://github.com/alexfalkowski/nonnative/commit/03d9b627314d859cef9b002e1d903f22bad9efad))
|
|
128
|
+
* lock semantic_logger ([e340785](https://github.com/alexfalkowski/nonnative/commit/e340785fa1e97c991196e1ee1168dac3e4973cb3))
|
|
129
|
+
* make sure we don't do things serially ([d265aac](https://github.com/alexfalkowski/nonnative/commit/d265aaca9f798ab004ee125a55e0406f9b2f7739))
|
|
130
|
+
* remove logger ([b2ae52b](https://github.com/alexfalkowski/nonnative/commit/b2ae52b20ce0cf65f431ceaa315b353ed41fcc80))
|
|
131
|
+
* remove logs ([787e490](https://github.com/alexfalkowski/nonnative/commit/787e490b71884c8dcd0920778b88fd94d520dfab))
|
|
132
|
+
* remove structure ([79604f6](https://github.com/alexfalkowski/nonnative/commit/79604f631990a01f48da066014b52742e0bc71d0))
|
|
133
|
+
* remove writting to STDOUT ([be1f668](https://github.com/alexfalkowski/nonnative/commit/be1f668278a74f5c3a33538dbeda77ac9b93d316))
|
|
134
|
+
* rename to configuration process ([aac5b4c](https://github.com/alexfalkowski/nonnative/commit/aac5b4c435ea1fb3942a0c752f573ff2ca5026b6))
|
|
135
|
+
* rename to process pool ([9e4391e](https://github.com/alexfalkowski/nonnative/commit/9e4391e94fc32d69cdf651eff8995bac91f965fd))
|
|
136
|
+
* start multiple processes ([5a9c8ba](https://github.com/alexfalkowski/nonnative/commit/5a9c8baf22537dc246fc73eab3d1a645bc51f4be))
|
|
137
|
+
* start nonnative with a long start up time server will error ([6770f66](https://github.com/alexfalkowski/nonnative/commit/6770f6657ccb724c311a43e77b03595943504fef))
|
|
138
|
+
* stop nonnative with a long stopping time server will error ([3040227](https://github.com/alexfalkowski/nonnative/commit/3040227113c50aa9a7e84bf44bd03a3c0a6142be))
|
|
139
|
+
* successfully starting of grpc servers programatically ([cc92276](https://github.com/alexfalkowski/nonnative/commit/cc9227620ecb8133277871967eb835f67943ccad))
|
|
140
|
+
* successfully starting of HTTP servers programatically ([93373f1](https://github.com/alexfalkowski/nonnative/commit/93373f1b85d50328b54ee49236f55acd2c5c0180))
|
|
141
|
+
* successfully starting of HTTP servers programatically and getting health ([be9ae06](https://github.com/alexfalkowski/nonnative/commit/be9ae06952e83af666f654a9782b596673709c87))
|
|
142
|
+
* successfully starting of HTTP servers programatically and getting metrics ([4536904](https://github.com/alexfalkowski/nonnative/commit/45369041a8d95e240b5533d2132b60fa4d31278f))
|
|
143
|
+
* successfully starting of HTTP servers programatically with not found message ([111d81d](https://github.com/alexfalkowski/nonnative/commit/111d81da298a7203c08fa5725e2310736b613fb9))
|
|
144
|
+
* update rspec-expectations (3.9.2) ([1f656a9](https://github.com/alexfalkowski/nonnative/commit/1f656a975e2fd6b1af830ca38f24d978a105d0e0))
|
|
145
|
+
* update rubocop (0.82.0) ([48e462d](https://github.com/alexfalkowski/nonnative/commit/48e462d980f858102a45367fc420b7c66596a22f))
|
|
146
|
+
* update solargraph (0.39.7) ([8caff98](https://github.com/alexfalkowski/nonnative/commit/8caff98e5fea79c7123cc49f573ef2122ef14b33))
|
|
147
|
+
* use 0.0.0.0 ([1e77298](https://github.com/alexfalkowski/nonnative/commit/1e77298620666578472220c0e02c5121a4d9838f))
|
|
148
|
+
* use better naming. ([228c9ed](https://github.com/alexfalkowski/nonnative/commit/228c9ed9607c30834f0f5dfa46114a2ed84b67a3))
|
|
149
|
+
* use ruby 2.6.6 ([fdb61da](https://github.com/alexfalkowski/nonnative/commit/fdb61da719e6cf3d35db7d8af6acea19481a8ff9))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### Bug Fixes
|
|
153
|
+
|
|
154
|
+
* add comments ([cb93b23](https://github.com/alexfalkowski/nonnative/commit/cb93b23a3c8ae463b656fb4a43e2b7dab83db2f5))
|
|
155
|
+
* add small sleeps as prcesses and severs take time to start. ([1e3d363](https://github.com/alexfalkowski/nonnative/commit/1e3d36302c0fc0c58f7b2239db39876acf4ec2fc))
|
|
156
|
+
* ignore exceptions ([4076cf2](https://github.com/alexfalkowski/nonnative/commit/4076cf2019924b89f2766edbafed603d08c63cc6))
|
|
157
|
+
* only raise an error after we have finished start or stop ([b7b0b17](https://github.com/alexfalkowski/nonnative/commit/b7b0b17cc4cac53abcb052a76afc29312b0b971b))
|
|
158
|
+
* pass service like in command ([43a961b](https://github.com/alexfalkowski/nonnative/commit/43a961b7bfa5e954371d14553009969f89af87a4))
|
|
159
|
+
* register at exit first ([7dad865](https://github.com/alexfalkowski/nonnative/commit/7dad865a29117b830c7717d167e14f88c9d6f2af))
|
|
160
|
+
* remove rescue ([230ae39](https://github.com/alexfalkowski/nonnative/commit/230ae395406552bbe7610a9c37322573c2d6f92b))
|
|
161
|
+
* remove thwait ([62cf089](https://github.com/alexfalkowski/nonnative/commit/62cf089e3b10bae8290d8cfbb2b8c4e4c50aef1f))
|
|
162
|
+
* remove unused vriables ([0d38d8a](https://github.com/alexfalkowski/nonnative/commit/0d38d8a12d108370682e2f7cad5f5a4f62e5835f))
|
|
163
|
+
* start servers first ([9a483f0](https://github.com/alexfalkowski/nonnative/commit/9a483f02709b4b954205dc66bf7ea7fa20110a37))
|
|
164
|
+
* stop servers first ([a736496](https://github.com/alexfalkowski/nonnative/commit/a73649666010820697539c621fb9a7e8677008a7))
|
|
165
|
+
* sync state ([75ab8e8](https://github.com/alexfalkowski/nonnative/commit/75ab8e8a9ea421aac8e970a3b7b1c2c1c556b425))
|
|
166
|
+
* **chaos:** ignore ECONNRESET ([c5ff8df](https://github.com/alexfalkowski/nonnative/commit/c5ff8dfcb3af8dbe8fb9fb5a6f04dd2308eadbaa))
|
|
167
|
+
* **grpc:** make servers consistent ([ece8404](https://github.com/alexfalkowski/nonnative/commit/ece8404d0a56ded351df317f3dacaac054f67f0a))
|
|
168
|
+
* **grpc:** pass timout to wait ([0a18218](https://github.com/alexfalkowski/nonnative/commit/0a18218ff675a4bf76d39ac2c547a87955013e42))
|
|
169
|
+
* **http:** allow to run multiple servers ([6e640de](https://github.com/alexfalkowski/nonnative/commit/6e640ded9312d89de125f0b2bb9a34c982163a41))
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
nonnative (1.
|
|
4
|
+
nonnative (1.39.0)
|
|
5
5
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
|
6
6
|
cucumber (>= 5, < 6)
|
|
7
7
|
grpc (>= 1, < 2)
|
|
@@ -14,19 +14,21 @@ PATH
|
|
|
14
14
|
GEM
|
|
15
15
|
remote: https://rubygems.org/
|
|
16
16
|
specs:
|
|
17
|
-
activesupport (6.
|
|
17
|
+
activesupport (6.1.3.1)
|
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
19
|
-
i18n (>=
|
|
20
|
-
minitest (
|
|
21
|
-
tzinfo (~>
|
|
22
|
-
zeitwerk (~> 2.
|
|
23
|
-
ast (2.4.
|
|
19
|
+
i18n (>= 1.6, < 2)
|
|
20
|
+
minitest (>= 5.1)
|
|
21
|
+
tzinfo (~> 2.0)
|
|
22
|
+
zeitwerk (~> 2.3)
|
|
23
|
+
ast (2.4.2)
|
|
24
|
+
backport (1.1.2)
|
|
25
|
+
benchmark (0.1.1)
|
|
24
26
|
benchmark-malloc (0.2.0)
|
|
25
27
|
benchmark-perf (0.6.0)
|
|
26
28
|
benchmark-trend (0.4.0)
|
|
27
29
|
builder (3.2.4)
|
|
28
|
-
concurrent-ruby (1.1.
|
|
29
|
-
cucumber (5.
|
|
30
|
+
concurrent-ruby (1.1.8)
|
|
31
|
+
cucumber (5.3.0)
|
|
30
32
|
builder (~> 3.2, >= 3.2.4)
|
|
31
33
|
cucumber-core (~> 8.0, >= 8.0.1)
|
|
32
34
|
cucumber-create-meta (~> 2.0, >= 2.0.2)
|
|
@@ -42,15 +44,15 @@ GEM
|
|
|
42
44
|
cucumber-gherkin (~> 15.0, >= 15.0.2)
|
|
43
45
|
cucumber-messages (~> 13.0, >= 13.0.1)
|
|
44
46
|
cucumber-tag-expressions (~> 2.0, >= 2.0.4)
|
|
45
|
-
cucumber-create-meta (2.0.
|
|
46
|
-
cucumber-messages (~> 13.
|
|
47
|
+
cucumber-create-meta (2.0.4)
|
|
48
|
+
cucumber-messages (~> 13.1, >= 13.1.0)
|
|
47
49
|
sys-uname (~> 1.2, >= 1.2.1)
|
|
48
50
|
cucumber-cucumber-expressions (10.3.0)
|
|
49
51
|
cucumber-gherkin (15.0.2)
|
|
50
52
|
cucumber-messages (~> 13.0, >= 13.0.1)
|
|
51
53
|
cucumber-html-formatter (9.0.0)
|
|
52
54
|
cucumber-messages (~> 13.0, >= 13.0.1)
|
|
53
|
-
cucumber-messages (13.1
|
|
55
|
+
cucumber-messages (13.2.1)
|
|
54
56
|
protobuf-cucumber (~> 3.10, >= 3.10.8)
|
|
55
57
|
cucumber-tag-expressions (2.0.4)
|
|
56
58
|
cucumber-wire (4.0.1)
|
|
@@ -58,108 +60,135 @@ GEM
|
|
|
58
60
|
cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
|
|
59
61
|
cucumber-messages (~> 13.0, >= 13.0.1)
|
|
60
62
|
diff-lcs (1.4.4)
|
|
61
|
-
docile (1.3.
|
|
63
|
+
docile (1.3.5)
|
|
62
64
|
domain_name (0.5.20190701)
|
|
63
65
|
unf (>= 0.0.5, < 1.0.0)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
e2mmap (0.1.0)
|
|
67
|
+
ffi (1.15.0)
|
|
68
|
+
google-protobuf (3.15.8)
|
|
69
|
+
googleapis-common-protos-types (1.0.6)
|
|
70
|
+
google-protobuf (~> 3.14)
|
|
71
|
+
grpc (1.37.0)
|
|
72
|
+
google-protobuf (~> 3.15)
|
|
70
73
|
googleapis-common-protos-types (~> 1.0)
|
|
71
|
-
grpc-tools (1.
|
|
74
|
+
grpc-tools (1.37.0)
|
|
72
75
|
http-accept (1.7.0)
|
|
73
76
|
http-cookie (1.0.3)
|
|
74
77
|
domain_name (~> 0.5)
|
|
75
|
-
i18n (1.8.
|
|
78
|
+
i18n (1.8.10)
|
|
76
79
|
concurrent-ruby (~> 1.0)
|
|
77
|
-
|
|
80
|
+
jaro_winkler (1.5.4)
|
|
81
|
+
kramdown (2.3.1)
|
|
82
|
+
rexml
|
|
83
|
+
kramdown-parser-gfm (1.1.0)
|
|
84
|
+
kramdown (~> 2.0)
|
|
78
85
|
middleware (0.1.0)
|
|
79
86
|
mime-types (3.3.1)
|
|
80
87
|
mime-types-data (~> 3.2015)
|
|
81
|
-
mime-types-data (3.
|
|
82
|
-
|
|
88
|
+
mime-types-data (3.2021.0225)
|
|
89
|
+
mini_portile2 (2.5.0)
|
|
90
|
+
minitest (5.14.4)
|
|
83
91
|
multi_test (0.1.2)
|
|
84
92
|
mustermann (1.1.1)
|
|
85
93
|
ruby2_keywords (~> 0.0.1)
|
|
86
94
|
netrc (0.11.0)
|
|
87
|
-
nio4r (2.5.
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
nio4r (2.5.7)
|
|
96
|
+
nokogiri (1.11.3)
|
|
97
|
+
mini_portile2 (~> 2.5.0)
|
|
98
|
+
racc (~> 1.4)
|
|
99
|
+
parallel (1.20.1)
|
|
100
|
+
parser (3.0.1.0)
|
|
90
101
|
ast (~> 2.4.1)
|
|
91
102
|
protobuf-cucumber (3.10.8)
|
|
92
103
|
activesupport (>= 3.2)
|
|
93
104
|
middleware
|
|
94
105
|
thor
|
|
95
106
|
thread_safe
|
|
96
|
-
puma (5.
|
|
107
|
+
puma (5.2.2)
|
|
97
108
|
nio4r (~> 2.0)
|
|
109
|
+
racc (1.5.2)
|
|
98
110
|
rack (2.2.3)
|
|
99
111
|
rack-protection (2.1.0)
|
|
100
112
|
rack
|
|
101
113
|
rainbow (3.0.0)
|
|
102
|
-
|
|
103
|
-
regexp_parser (1.8.2)
|
|
114
|
+
regexp_parser (2.1.1)
|
|
104
115
|
rest-client (2.1.0)
|
|
105
116
|
http-accept (>= 1.7.0, < 2.0)
|
|
106
117
|
http-cookie (>= 1.0.2, < 2.0)
|
|
107
118
|
mime-types (>= 1.16, < 4.0)
|
|
108
119
|
netrc (~> 0.8)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
rspec-
|
|
120
|
+
reverse_markdown (2.0.0)
|
|
121
|
+
nokogiri
|
|
122
|
+
rexml (3.2.5)
|
|
123
|
+
rspec (3.10.0)
|
|
124
|
+
rspec-core (~> 3.10.0)
|
|
125
|
+
rspec-expectations (~> 3.10.0)
|
|
126
|
+
rspec-mocks (~> 3.10.0)
|
|
114
127
|
rspec-benchmark (0.6.0)
|
|
115
128
|
benchmark-malloc (~> 0.2)
|
|
116
129
|
benchmark-perf (~> 0.6)
|
|
117
130
|
benchmark-trend (~> 0.4)
|
|
118
131
|
rspec (>= 3.0)
|
|
119
|
-
rspec-core (3.
|
|
120
|
-
rspec-support (~> 3.
|
|
121
|
-
rspec-expectations (3.
|
|
132
|
+
rspec-core (3.10.1)
|
|
133
|
+
rspec-support (~> 3.10.0)
|
|
134
|
+
rspec-expectations (3.10.1)
|
|
122
135
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
123
|
-
rspec-support (~> 3.
|
|
124
|
-
rspec-mocks (3.
|
|
136
|
+
rspec-support (~> 3.10.0)
|
|
137
|
+
rspec-mocks (3.10.2)
|
|
125
138
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
126
|
-
rspec-support (~> 3.
|
|
127
|
-
rspec-support (3.
|
|
128
|
-
rubocop (1.
|
|
139
|
+
rspec-support (~> 3.10.0)
|
|
140
|
+
rspec-support (3.10.2)
|
|
141
|
+
rubocop (1.13.0)
|
|
129
142
|
parallel (~> 1.10)
|
|
130
|
-
parser (>=
|
|
143
|
+
parser (>= 3.0.0.0)
|
|
131
144
|
rainbow (>= 2.2.2, < 4.0)
|
|
132
|
-
regexp_parser (>= 1.8)
|
|
145
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
133
146
|
rexml
|
|
134
|
-
rubocop-ast (>=
|
|
147
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
|
135
148
|
ruby-progressbar (~> 1.7)
|
|
136
|
-
unicode-display_width (>= 1.4.0, <
|
|
137
|
-
rubocop-ast (1.
|
|
149
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
150
|
+
rubocop-ast (1.4.1)
|
|
138
151
|
parser (>= 2.7.1.5)
|
|
139
|
-
ruby-progressbar (1.
|
|
140
|
-
ruby2_keywords (0.0.
|
|
141
|
-
simplecov (0.
|
|
152
|
+
ruby-progressbar (1.11.0)
|
|
153
|
+
ruby2_keywords (0.0.4)
|
|
154
|
+
simplecov (0.21.2)
|
|
142
155
|
docile (~> 1.1)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
simplecov-html (0.
|
|
156
|
+
simplecov-html (~> 0.11)
|
|
157
|
+
simplecov_json_formatter (~> 0.1)
|
|
158
|
+
simplecov-html (0.12.3)
|
|
159
|
+
simplecov_json_formatter (0.1.2)
|
|
146
160
|
sinatra (2.1.0)
|
|
147
161
|
mustermann (~> 1.0)
|
|
148
162
|
rack (~> 2.2)
|
|
149
163
|
rack-protection (= 2.1.0)
|
|
150
164
|
tilt (~> 2.0)
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
solargraph (0.40.4)
|
|
166
|
+
backport (~> 1.1)
|
|
167
|
+
benchmark
|
|
168
|
+
bundler (>= 1.17.2)
|
|
169
|
+
e2mmap
|
|
170
|
+
jaro_winkler (~> 1.5)
|
|
171
|
+
kramdown (~> 2.3)
|
|
172
|
+
kramdown-parser-gfm (~> 1.1)
|
|
173
|
+
parser (~> 3.0)
|
|
174
|
+
reverse_markdown (>= 1.0.5, < 3)
|
|
175
|
+
rubocop (>= 0.52)
|
|
176
|
+
thor (~> 1.0)
|
|
177
|
+
tilt (~> 2.0)
|
|
178
|
+
yard (~> 0.9, >= 0.9.24)
|
|
179
|
+
sys-uname (1.2.2)
|
|
180
|
+
ffi (~> 1.1)
|
|
153
181
|
thor (1.0.1)
|
|
154
182
|
thread_safe (0.3.6)
|
|
155
183
|
tilt (2.0.10)
|
|
156
|
-
tzinfo (
|
|
157
|
-
|
|
184
|
+
tzinfo (2.0.4)
|
|
185
|
+
concurrent-ruby (~> 1.0)
|
|
158
186
|
unf (0.1.4)
|
|
159
187
|
unf_ext
|
|
160
188
|
unf_ext (0.0.7.7)
|
|
161
|
-
unicode-display_width (
|
|
162
|
-
|
|
189
|
+
unicode-display_width (2.0.0)
|
|
190
|
+
yard (0.9.26)
|
|
191
|
+
zeitwerk (2.4.2)
|
|
163
192
|
|
|
164
193
|
PLATFORMS
|
|
165
194
|
ruby
|
|
@@ -168,9 +197,9 @@ DEPENDENCIES
|
|
|
168
197
|
bundler (~> 2.1, >= 2.1.4)
|
|
169
198
|
grpc-tools (>= 1, < 2)
|
|
170
199
|
nonnative!
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
200
|
+
rubocop (~> 1.12)
|
|
201
|
+
simplecov (~> 0.21.2)
|
|
202
|
+
solargraph (~> 0.40.4)
|
|
174
203
|
|
|
175
204
|
BUNDLED WITH
|
|
176
205
|
2.1.4
|
data/Makefile
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
.PHONY: features
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
dep:
|
|
4
4
|
bin/setup
|
|
5
5
|
|
|
6
|
-
outdated
|
|
6
|
+
outdated:
|
|
7
7
|
bundle outdated --only-explicit
|
|
8
8
|
|
|
9
9
|
features: clean
|
|
10
10
|
bundle exec cucumber --profile report --fail-fast $(feature)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
lint:
|
|
13
13
|
bundle exec rubocop
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
fix-lint:
|
|
16
16
|
bundle exec rubocop -A
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
clean-logs:
|
|
19
19
|
rm -rf features/logs/*.log
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
clean-reports:
|
|
22
22
|
rm -rf reports
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
clean-coverage:
|
|
25
25
|
rm -rf coverage
|
|
26
26
|
|
|
27
|
-
clean:
|
|
27
|
+
clean: clean-logs clean-reports clean-coverage
|
data/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
[](https://circleci.com/gh/alexfalkowski/nonnative)
|
|
2
|
-
[](https://sonarcloud.io/dashboard?id=alexfalkowski_nonnative)
|
|
3
2
|
|
|
4
3
|
# Nonnative
|
|
5
4
|
|
|
@@ -374,7 +373,6 @@ server.proxy.close_all # To use close_all.
|
|
|
374
373
|
server.proxy.reset # To reset it back to a good state.
|
|
375
374
|
```
|
|
376
375
|
|
|
377
|
-
|
|
378
376
|
### Go
|
|
379
377
|
|
|
380
378
|
As we love using go as a language for services we have added support to start binaries with defined parameters. This expects that you build your services in the format of `command sub_command --params`
|
|
@@ -382,8 +380,6 @@ As we love using go as a language for services we have added support to start bi
|
|
|
382
380
|
To get this to work you will need to create a `main_test.go` file with these contents:
|
|
383
381
|
|
|
384
382
|
```go
|
|
385
|
-
// +build features
|
|
386
|
-
|
|
387
383
|
package main
|
|
388
384
|
|
|
389
385
|
import (
|
|
@@ -401,11 +397,11 @@ func TestFeatures(t *testing.T) {
|
|
|
401
397
|
Then to compile this binary you will need to do the following:
|
|
402
398
|
|
|
403
399
|
```sh
|
|
404
|
-
go test -mod vendor -c -
|
|
400
|
+
go test -mod vendor -c -covermode=count -o your_binary -coverpkg=./... github.com/your_location
|
|
405
401
|
```
|
|
406
402
|
|
|
407
403
|
Then to get an executable you do the following:
|
|
408
404
|
|
|
409
405
|
```ruby
|
|
410
|
-
Nonnative
|
|
406
|
+
Nonnative.go_executable('reports', 'your_binary', 'sub_command', '--config config.yaml')
|
|
411
407
|
```
|
data/lib/nonnative.rb
CHANGED
|
@@ -46,6 +46,10 @@ module Nonnative
|
|
|
46
46
|
class << self
|
|
47
47
|
attr_reader :pool
|
|
48
48
|
|
|
49
|
+
def go_executable(output, exec, cmd, *params)
|
|
50
|
+
Nonnative::GoCommand.new(exec, output).executable(cmd, params)
|
|
51
|
+
end
|
|
52
|
+
|
|
49
53
|
def load_configuration(path)
|
|
50
54
|
@configuration ||= Nonnative::Configuration.load_file(path) # rubocop:disable Naming/MemoizedInstanceVariableName
|
|
51
55
|
end
|
|
@@ -48,27 +48,46 @@ module Nonnative
|
|
|
48
48
|
def perform_start
|
|
49
49
|
loop do
|
|
50
50
|
thread = Thread.start(tcp_server.accept) do |local_socket|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
logger.info "started connection for #{id} with socket #{local_socket.inspect}"
|
|
54
|
-
|
|
55
|
-
connect local_socket
|
|
56
|
-
connections.delete(id)
|
|
57
|
-
|
|
58
|
-
logger.info "finished connection for #{id} with socket #{local_socket.inspect}"
|
|
51
|
+
accept_connection local_socket
|
|
59
52
|
end
|
|
60
53
|
|
|
61
|
-
thread.report_on_exception = false
|
|
62
54
|
connections[thread.object_id] = thread
|
|
63
55
|
end
|
|
64
56
|
end
|
|
65
57
|
|
|
58
|
+
def accept_connection(local_socket)
|
|
59
|
+
id = Thread.current.object_id
|
|
60
|
+
socket_info = local_socket.inspect
|
|
61
|
+
|
|
62
|
+
error = connect(local_socket)
|
|
63
|
+
if error
|
|
64
|
+
logger.error "could not handle the connection for '#{id}' with socket '#{socket_info}' and error '#{error}'"
|
|
65
|
+
else
|
|
66
|
+
logger.info "handled connection for '#{id}' with socket '#{socket_info}'"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
connections.delete(id)
|
|
70
|
+
end
|
|
71
|
+
|
|
66
72
|
def connect(local_socket)
|
|
67
|
-
SocketPairFactory.create(read_state, service.proxy
|
|
73
|
+
pair = SocketPairFactory.create(read_state, service.proxy)
|
|
74
|
+
pair.connect(local_socket)
|
|
75
|
+
rescue StandardError => e
|
|
76
|
+
local_socket.close
|
|
77
|
+
|
|
78
|
+
e
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def close_connections
|
|
82
|
+
connections.each_value(&:terminate)
|
|
83
|
+
connections.clear
|
|
68
84
|
end
|
|
69
85
|
|
|
70
86
|
def apply_state(state)
|
|
71
|
-
mutex.synchronize
|
|
87
|
+
mutex.synchronize do
|
|
88
|
+
@state = state
|
|
89
|
+
close_connections
|
|
90
|
+
end
|
|
72
91
|
end
|
|
73
92
|
|
|
74
93
|
def read_state
|
data/lib/nonnative/go_command.rb
CHANGED
|
@@ -2,30 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
module Nonnative
|
|
4
4
|
class GoCommand
|
|
5
|
-
def initialize(
|
|
6
|
-
@
|
|
5
|
+
def initialize(exec, output)
|
|
6
|
+
@exec = exec
|
|
7
7
|
@output = output
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def executable(cmd, *params)
|
|
11
11
|
params = params.join(' ')
|
|
12
|
-
"#{
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def execute(cmd, *params)
|
|
16
|
-
Open3.popen3(executable(cmd, params)) do |_stdin, stdout, stderr, wait_thr|
|
|
17
|
-
return stdout.read, stderr.read, wait_thr.value
|
|
18
|
-
end
|
|
12
|
+
"#{exec} #{flags(cmd, params).join(' ')} #{cmd} #{params}".strip
|
|
19
13
|
end
|
|
20
14
|
|
|
21
15
|
private
|
|
22
16
|
|
|
23
|
-
attr_reader :
|
|
17
|
+
attr_reader :exec, :output
|
|
24
18
|
|
|
25
19
|
def flags(cmd, params)
|
|
26
|
-
m = File.basename(
|
|
20
|
+
m = File.basename(exec, File.extname(exec))
|
|
27
21
|
p = params.gsub(/\W/, '')
|
|
28
|
-
|
|
22
|
+
name = [m, cmd, p].reject(&:empty?).join('-')
|
|
23
|
+
path = "#{output}/#{name}"
|
|
29
24
|
|
|
30
25
|
[
|
|
31
26
|
"-test.cpuprofile=#{path}-cpu.prof",
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Nonnative
|
|
4
4
|
class SocketPair
|
|
5
|
-
def initialize(proxy
|
|
5
|
+
def initialize(proxy)
|
|
6
6
|
@proxy = proxy
|
|
7
|
-
@logger = logger
|
|
8
7
|
end
|
|
9
8
|
|
|
10
9
|
def connect(local_socket)
|
|
@@ -16,8 +15,6 @@ module Nonnative
|
|
|
16
15
|
break if pipe(ready, local_socket, remote_socket)
|
|
17
16
|
break if pipe(ready, remote_socket, local_socket)
|
|
18
17
|
end
|
|
19
|
-
rescue StandardError => e
|
|
20
|
-
logger.error e
|
|
21
18
|
ensure
|
|
22
19
|
local_socket.close
|
|
23
20
|
remote_socket&.close
|
|
@@ -25,7 +22,7 @@ module Nonnative
|
|
|
25
22
|
|
|
26
23
|
protected
|
|
27
24
|
|
|
28
|
-
attr_reader :proxy
|
|
25
|
+
attr_reader :proxy
|
|
29
26
|
|
|
30
27
|
def create_remote_socket
|
|
31
28
|
::TCPSocket.new('0.0.0.0', proxy.port)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Nonnative
|
|
4
4
|
class SocketPairFactory
|
|
5
5
|
class << self
|
|
6
|
-
def create(type, proxy
|
|
6
|
+
def create(type, proxy)
|
|
7
7
|
pair = case type
|
|
8
8
|
when :close_all
|
|
9
9
|
CloseAllSocketPair
|
|
@@ -15,7 +15,7 @@ module Nonnative
|
|
|
15
15
|
SocketPair
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
pair.new(proxy
|
|
18
|
+
pair.new(proxy)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
data/lib/nonnative/version.rb
CHANGED
data/nonnative.gemspec
CHANGED
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
|
|
35
35
|
spec.add_development_dependency 'bundler', '~> 2.1', '>= 2.1.4'
|
|
36
36
|
spec.add_development_dependency 'grpc-tools', ['>= 1', '< 2']
|
|
37
|
-
spec.add_development_dependency '
|
|
38
|
-
spec.add_development_dependency '
|
|
39
|
-
spec.add_development_dependency '
|
|
37
|
+
spec.add_development_dependency 'rubocop', '~> 1.12'
|
|
38
|
+
spec.add_development_dependency 'simplecov', '~> 0.21.2'
|
|
39
|
+
spec.add_development_dependency 'solargraph', '~> 0.40.4'
|
|
40
40
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nonnative
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.39.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Falkowski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|
|
@@ -193,53 +193,47 @@ dependencies:
|
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
194
|
version: '2'
|
|
195
195
|
- !ruby/object:Gem::Dependency
|
|
196
|
-
name:
|
|
196
|
+
name: rubocop
|
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
|
198
198
|
requirements:
|
|
199
199
|
- - "~>"
|
|
200
200
|
- !ruby/object:Gem::Version
|
|
201
|
-
version: '
|
|
202
|
-
- - ">="
|
|
203
|
-
- !ruby/object:Gem::Version
|
|
204
|
-
version: 13.0.1
|
|
201
|
+
version: '1.12'
|
|
205
202
|
type: :development
|
|
206
203
|
prerelease: false
|
|
207
204
|
version_requirements: !ruby/object:Gem::Requirement
|
|
208
205
|
requirements:
|
|
209
206
|
- - "~>"
|
|
210
207
|
- !ruby/object:Gem::Version
|
|
211
|
-
version: '
|
|
212
|
-
- - ">="
|
|
213
|
-
- !ruby/object:Gem::Version
|
|
214
|
-
version: 13.0.1
|
|
208
|
+
version: '1.12'
|
|
215
209
|
- !ruby/object:Gem::Dependency
|
|
216
|
-
name:
|
|
210
|
+
name: simplecov
|
|
217
211
|
requirement: !ruby/object:Gem::Requirement
|
|
218
212
|
requirements:
|
|
219
213
|
- - "~>"
|
|
220
214
|
- !ruby/object:Gem::Version
|
|
221
|
-
version:
|
|
215
|
+
version: 0.21.2
|
|
222
216
|
type: :development
|
|
223
217
|
prerelease: false
|
|
224
218
|
version_requirements: !ruby/object:Gem::Requirement
|
|
225
219
|
requirements:
|
|
226
220
|
- - "~>"
|
|
227
221
|
- !ruby/object:Gem::Version
|
|
228
|
-
version:
|
|
222
|
+
version: 0.21.2
|
|
229
223
|
- !ruby/object:Gem::Dependency
|
|
230
|
-
name:
|
|
224
|
+
name: solargraph
|
|
231
225
|
requirement: !ruby/object:Gem::Requirement
|
|
232
226
|
requirements:
|
|
233
227
|
- - "~>"
|
|
234
228
|
- !ruby/object:Gem::Version
|
|
235
|
-
version: 0.
|
|
229
|
+
version: 0.40.4
|
|
236
230
|
type: :development
|
|
237
231
|
prerelease: false
|
|
238
232
|
version_requirements: !ruby/object:Gem::Requirement
|
|
239
233
|
requirements:
|
|
240
234
|
- - "~>"
|
|
241
235
|
- !ruby/object:Gem::Version
|
|
242
|
-
version: 0.
|
|
236
|
+
version: 0.40.4
|
|
243
237
|
description: Allows you to keep using the power of ruby to test other systems
|
|
244
238
|
email:
|
|
245
239
|
- alexrfalkowski@gmail.com
|
|
@@ -253,6 +247,7 @@ files:
|
|
|
253
247
|
- ".gitignore"
|
|
254
248
|
- ".rubocop.yml"
|
|
255
249
|
- ".ruby-version"
|
|
250
|
+
- CHANGELOG.md
|
|
256
251
|
- Gemfile
|
|
257
252
|
- Gemfile.lock
|
|
258
253
|
- LICENSE
|
|
@@ -294,7 +289,6 @@ files:
|
|
|
294
289
|
- lib/nonnative/timeout.rb
|
|
295
290
|
- lib/nonnative/version.rb
|
|
296
291
|
- nonnative.gemspec
|
|
297
|
-
- sonar-project.properties
|
|
298
292
|
homepage: https://github.com/alexfalkowski/nonnative
|
|
299
293
|
licenses:
|
|
300
294
|
- Unlicense
|
|
@@ -317,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
317
311
|
- !ruby/object:Gem::Version
|
|
318
312
|
version: '0'
|
|
319
313
|
requirements: []
|
|
320
|
-
rubygems_version: 3.1.
|
|
314
|
+
rubygems_version: 3.1.4
|
|
321
315
|
signing_key:
|
|
322
316
|
specification_version: 4
|
|
323
317
|
summary: Allows you to keep using the power of ruby to test other systems
|
data/sonar-project.properties
DELETED