nonnative 1.27.0 → 1.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -11
- data/README.md +14 -5
- data/lib/nonnative.rb +1 -0
- data/lib/nonnative/configuration.rb +9 -4
- data/lib/nonnative/strategy.rb +28 -0
- data/lib/nonnative/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb604e3c902b73acba698a4c291a0ed9a269fddabbd6e354add54fd751422b9
|
4
|
+
data.tar.gz: 7629e83827772b5e9770fe06b45e8d1014f957b8308d044029121fb75ef07f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ab05385158fe857b2aadfe587ac1b76e429957a50d91a67e9e62c54c0f9deb3f2fda00a3269883b000adee18ab6d9bf565f3e8a09d8f0e957c67accf55be500
|
7
|
+
data.tar.gz: fd18a1d40215a7f520b6f30e72be9dde4ddb5473efa3357b79f9d304e0f81141168492caeb3fd112536b3ad586526db4a3dea4acc93baf272608f62242cc18c7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nonnative (1.
|
4
|
+
nonnative (1.28.0)
|
5
5
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
6
6
|
cucumber (>= 4, < 5)
|
7
7
|
grpc (>= 1, < 2)
|
@@ -47,12 +47,12 @@ GEM
|
|
47
47
|
cucumber-create-meta (1.0.0)
|
48
48
|
cucumber-messages (~> 12.2, >= 12.2.0)
|
49
49
|
sys-uname (~> 1.2, >= 1.2.1)
|
50
|
-
cucumber-cucumber-expressions (10.2.
|
51
|
-
cucumber-gherkin (14.0
|
52
|
-
cucumber-messages (~> 12.
|
53
|
-
cucumber-html-formatter (7.
|
54
|
-
cucumber-messages (~> 12.
|
55
|
-
cucumber-messages (12.
|
50
|
+
cucumber-cucumber-expressions (10.2.2)
|
51
|
+
cucumber-gherkin (14.2.0)
|
52
|
+
cucumber-messages (~> 12.4, >= 12.4.0)
|
53
|
+
cucumber-html-formatter (7.2.0)
|
54
|
+
cucumber-messages (~> 12.4, >= 12.4.0)
|
55
|
+
cucumber-messages (12.4.0)
|
56
56
|
protobuf-cucumber (~> 3.10, >= 3.10.8)
|
57
57
|
cucumber-tag-expressions (2.0.4)
|
58
58
|
cucumber-wire (3.1.0)
|
@@ -65,17 +65,17 @@ GEM
|
|
65
65
|
unf (>= 0.0.5, < 1.0.0)
|
66
66
|
e2mmap (0.1.0)
|
67
67
|
ffi (1.13.1)
|
68
|
-
google-protobuf (3.12.
|
68
|
+
google-protobuf (3.12.4)
|
69
69
|
googleapis-common-protos-types (1.0.5)
|
70
70
|
google-protobuf (~> 3.11)
|
71
|
-
grpc (1.30.
|
71
|
+
grpc (1.30.2)
|
72
72
|
google-protobuf (~> 3.12)
|
73
73
|
googleapis-common-protos-types (~> 1.0)
|
74
|
-
grpc-tools (1.30.
|
74
|
+
grpc-tools (1.30.2)
|
75
75
|
http-accept (1.7.0)
|
76
76
|
http-cookie (1.0.3)
|
77
77
|
domain_name (~> 0.5)
|
78
|
-
i18n (1.8.
|
78
|
+
i18n (1.8.5)
|
79
79
|
concurrent-ruby (~> 1.0)
|
80
80
|
jaro_winkler (1.5.4)
|
81
81
|
json (2.3.0)
|
data/README.md
CHANGED
@@ -37,10 +37,19 @@ Configure nonnative with the following:
|
|
37
37
|
- A timeout value.
|
38
38
|
- Port to verify.
|
39
39
|
- The class for servers.
|
40
|
-
- The
|
40
|
+
- The log for servers/processes
|
41
41
|
- The strategy for processes/servers.
|
42
|
-
|
43
|
-
|
42
|
+
|
43
|
+
### Strategy
|
44
|
+
|
45
|
+
The strategy can be one of the following values:
|
46
|
+
- startup - will start the process once.
|
47
|
+
- before - will hook into cucumbers Before and After.
|
48
|
+
- manual - do this manually
|
49
|
+
|
50
|
+
This can be overridden by the following environment variables:
|
51
|
+
- NONNATIVE_STRATEGY - Set this to override what is set in the config.
|
52
|
+
- NONNATIVE_TIMEOUT - Set this (in seconds, e.g 5) to override what is set in the config.
|
44
53
|
|
45
54
|
### Processes
|
46
55
|
|
@@ -50,12 +59,12 @@ Setup it up programmatically:
|
|
50
59
|
require 'nonnative'
|
51
60
|
|
52
61
|
Nonnative.configure do |config|
|
53
|
-
config.strategy = :startup
|
62
|
+
config.strategy = :startup
|
54
63
|
|
55
64
|
config.process do |d|
|
56
65
|
d.name = 'start_1'
|
57
66
|
d.command = 'features/support/bin/start 12_321'
|
58
|
-
d.timeout =
|
67
|
+
d.timeout = config.strategy.timeout
|
59
68
|
d.port = 12_321
|
60
69
|
d.log = 'features/logs/12_321.log'
|
61
70
|
d.signal = 'INT' # Possible values are described in Signal.list.keys
|
data/lib/nonnative.rb
CHANGED
@@ -56,12 +56,17 @@ module Nonnative
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def initialize
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
@strategy = Strategy.new
|
60
|
+
@processes = []
|
61
|
+
@servers = []
|
62
62
|
end
|
63
63
|
|
64
|
-
attr_accessor :
|
64
|
+
attr_accessor :processes, :servers
|
65
|
+
attr_reader :strategy
|
66
|
+
|
67
|
+
def strategy=(value)
|
68
|
+
@strategy = Strategy.new(value)
|
69
|
+
end
|
65
70
|
|
66
71
|
def process
|
67
72
|
process = Nonnative::ConfigurationProcess.new
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nonnative
|
4
|
+
class Strategy
|
5
|
+
def initialize(strategy = 'before', timeout = 5)
|
6
|
+
@strategy = strategy
|
7
|
+
@timeout = timeout
|
8
|
+
end
|
9
|
+
|
10
|
+
def timeout
|
11
|
+
(env_timeout || @timeout).to_i
|
12
|
+
end
|
13
|
+
|
14
|
+
def to_s
|
15
|
+
(env_strategy || @strategy).to_s
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def env_strategy
|
21
|
+
@env_strategy ||= ENV['NONNATIVE_STRATEGY']
|
22
|
+
end
|
23
|
+
|
24
|
+
def env_timeout
|
25
|
+
@env_timeout ||= ENV['NONNATIVE_TIMEOUT']
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/nonnative/version.rb
CHANGED
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.28.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: 2020-
|
11
|
+
date: 2020-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -310,6 +310,7 @@ files:
|
|
310
310
|
- lib/nonnative/start_error.rb
|
311
311
|
- lib/nonnative/startup.rb
|
312
312
|
- lib/nonnative/stop_error.rb
|
313
|
+
- lib/nonnative/strategy.rb
|
313
314
|
- lib/nonnative/timeout.rb
|
314
315
|
- lib/nonnative/version.rb
|
315
316
|
- nonnative.gemspec
|