freshli-commons 0.6.3 → 0.6.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21e474e889630431e22ad889a33194b4f2a0ae21f720563080416f2ef71c0037
|
4
|
+
data.tar.gz: 4f6de194f062b50efbfbb2629d23ca19ab7c1b2d3f5d0d467a4ed1ef6c4975fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 413ae77a6c3b4b50a8217074a4ba61cf58df1f6d0c571c0012120569a813d74f7428a93787f93bf1cb74311bfc48c86c0eb7421da1865d788a3557c84ef740fc
|
7
|
+
data.tar.gz: 18e590e2ffa3d9fbb5ab47ce5e0ef8355d8f66e993fea3b1f9cc6dc40a8dca2434c85262476f327b6e9122b66b1080a447ecd49aafc00ac7d7733c12deb4a724
|
data/.semver
CHANGED
@@ -1,12 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'open3'
|
4
|
+
require 'mkmf'
|
4
5
|
|
5
6
|
module Corgibytes
|
6
7
|
module Freshli
|
7
8
|
module Commons
|
8
9
|
# Contains utility methods for executing commands and working with their output.
|
9
10
|
module Execute
|
11
|
+
|
12
|
+
def msbuild_dll_path
|
13
|
+
dotnet_exe_path = File.realpath(find_executable('dotnet'))
|
14
|
+
dotnet_dir = File.dirname(dotnet_exe_path)
|
15
|
+
sdk_dir = File.join(dotnet_dir, 'sdk', Dir.children(File.join(dotnet_dir, 'sdk')).max)
|
16
|
+
result = File.join(sdk_dir, 'MSBuild.dll')
|
17
|
+
result = result.gsub('/', '\\') if Gem.win_platform?
|
18
|
+
result
|
19
|
+
end
|
20
|
+
|
21
|
+
def null_output_target
|
22
|
+
Gem.win_platform? ? '\\\\.\\nul' : '/dev/null'
|
23
|
+
end
|
24
|
+
|
10
25
|
def enable_dotnet_command_colors
|
11
26
|
ENV['DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION'] = 'true'
|
12
27
|
end
|
@@ -31,7 +46,7 @@ module Corgibytes
|
|
31
46
|
end
|
32
47
|
end
|
33
48
|
|
34
|
-
BUFFER_LEN =
|
49
|
+
BUFFER_LEN = 8
|
35
50
|
|
36
51
|
def fill_buffer_from_stream(stream, buffer)
|
37
52
|
# loop through reading data until there is an EOF (value is nil)
|
@@ -89,10 +104,6 @@ module Corgibytes
|
|
89
104
|
end
|
90
105
|
exit_status
|
91
106
|
end
|
92
|
-
|
93
|
-
def null_output_target
|
94
|
-
Gem.win_platform? ? 'NUL:' : '/dev/null'
|
95
|
-
end
|
96
107
|
end
|
97
108
|
end
|
98
109
|
end
|
@@ -104,11 +104,15 @@ module Corgibytes
|
|
104
104
|
# rubocop:disable Metrics/MethodLength
|
105
105
|
def wait_until_running!
|
106
106
|
Timeout.timeout(5) do
|
107
|
+
attempts = 0
|
107
108
|
loop do
|
109
|
+
attempts += 1
|
110
|
+
yield(attempts) if block_given?
|
111
|
+
|
108
112
|
status = nil
|
109
113
|
begin
|
110
114
|
status = health_check
|
111
|
-
rescue GRPC::Unavailable
|
115
|
+
rescue GRPC::Unavailable, GRPC::NotFound
|
112
116
|
status = nil
|
113
117
|
end
|
114
118
|
|
@@ -15,7 +15,9 @@ Then('the freshli_agent.proto gRPC service is running on port {int}') do |port|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
When('I wait for the freshli_agent.proto gRPC service to be running on port {int}') do |port|
|
18
|
-
GrpcClient.new(port).wait_until_running!
|
18
|
+
GrpcClient.new(port).wait_until_running! do |attempts|
|
19
|
+
log("Checking gRPC service health. Attempt ##{attempts}.")
|
20
|
+
end
|
19
21
|
end
|
20
22
|
|
21
23
|
When('the gRPC service on port {int} is sent the shutdown command') do |port|
|
@@ -23,7 +25,10 @@ When('the gRPC service on port {int} is sent the shutdown command') do |port|
|
|
23
25
|
end
|
24
26
|
|
25
27
|
Then('there are no services running on port {int}') do |port|
|
26
|
-
|
28
|
+
is_port_available = Ports.available?(port) do |attempts|
|
29
|
+
log("Checking port availability. Attempt ##{attempts}.")
|
30
|
+
end
|
31
|
+
expect(is_port_available).to be_truthy
|
27
32
|
end
|
28
33
|
|
29
34
|
test_services = TestServices.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freshli-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. Scott Ford
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|