hybrid_platforms_conductor 33.9.1 → 33.9.2
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/CHANGELOG.md +12 -0
- data/lib/hybrid_platforms_conductor/deployer.rb +7 -1
- data/lib/hybrid_platforms_conductor/version.rb +1 -1
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +44 -0
- data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +2 -2
- data/spec/hybrid_platforms_conductor_test.rb +1 -0
- 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: 2a6b91bf179fa45f605d1b08d8c21cced9547c0588139b1998fca01a19f75abe
|
|
4
|
+
data.tar.gz: 5372e49247ba48adf64eed5a9fe3cc5aff5b2e82be8bc834a2283f815cc4c928
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a1d886444be942a74153cb834e450b8062356959aaca508e10186bcb444f63295f8fc198b3e49f94babbbb7b6315bed146c1a29c21ab23d9112de94971e18d11
|
|
7
|
+
data.tar.gz: 31640de82a155dc42128926683fe7ded34039bad1cb639ff6bb8d4571f7f01a191f2103ea6a01c3de60322dc67015e92c833a0e8597b10bb3d6030e10199a864
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [v33.9.2](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.9.1...v33.9.2) (2021-09-01 17:46:34)
|
|
2
|
+
|
|
3
|
+
## Global changes
|
|
4
|
+
### Patches
|
|
5
|
+
|
|
6
|
+
* [[Fix(nodes_to_deploy)] [#112] Support UTF-8 encoding from log files](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/26a7bd2fd53d387bd972b5e1b60cac9be6541ce5)
|
|
7
|
+
|
|
8
|
+
## Changes for nodes_to_deploy
|
|
9
|
+
### Patches
|
|
10
|
+
|
|
11
|
+
* [[Fix(nodes_to_deploy)] [#112] Support UTF-8 encoding from log files](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/26a7bd2fd53d387bd972b5e1b60cac9be6541ce5)
|
|
12
|
+
|
|
1
13
|
# [v33.9.1](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.9.0...v33.9.1) (2021-09-01 16:59:59)
|
|
2
14
|
|
|
3
15
|
## Global changes
|
|
@@ -475,9 +475,15 @@ module HybridPlatformsConductor
|
|
|
475
475
|
progress_name: 'Read deployment logs'
|
|
476
476
|
)
|
|
477
477
|
nodes.map do |node|
|
|
478
|
+
exit_code, stdout, stderr = read_actions_results[node] || [nil, nil, nil]
|
|
478
479
|
[
|
|
479
480
|
node,
|
|
480
|
-
@log_plugins[log_plugins_for(node).first].logs_for(
|
|
481
|
+
@log_plugins[log_plugins_for(node).first].logs_for(
|
|
482
|
+
node,
|
|
483
|
+
exit_code,
|
|
484
|
+
stdout&.force_encoding(Encoding::UTF_8),
|
|
485
|
+
stderr&.force_encoding(Encoding::UTF_8)
|
|
486
|
+
)
|
|
481
487
|
]
|
|
482
488
|
end.to_h
|
|
483
489
|
end
|
|
@@ -196,6 +196,50 @@ describe HybridPlatformsConductor::Deployer do
|
|
|
196
196
|
end
|
|
197
197
|
end
|
|
198
198
|
|
|
199
|
+
it 'gets deployment info from log plugins returning UTF-8 characters' do
|
|
200
|
+
with_test_platform_for_deploy_tests({ nodes: { 'node' => {} } }) do
|
|
201
|
+
HybridPlatformsConductorTest::TestLogPlugin.mocked_logs = {
|
|
202
|
+
'node' => {
|
|
203
|
+
deployment_info: { user: 'test_user' },
|
|
204
|
+
exit_status: 666,
|
|
205
|
+
services: %w[unknown],
|
|
206
|
+
stderr: 'stderrの展開テストログ',
|
|
207
|
+
stdout: 'stdoutの展開テストログ'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
expect_actions_executor_runs [
|
|
211
|
+
# Expect the actions to get log files
|
|
212
|
+
proc do |actions_per_nodes|
|
|
213
|
+
expect(actions_per_nodes).to eq('node' => [{ bash: 'echo Read logs for node' }])
|
|
214
|
+
# Simulate the fact that data returned by the ssh system calls can contain UTF-8 chars, but is perceived as binary
|
|
215
|
+
{ 'node' => [42, 'ログファイルはstdoutを読み取ります'.force_encoding('BINARY'), 'ログファイルはstderrを読み取ります'.force_encoding('BINARY')] }
|
|
216
|
+
end
|
|
217
|
+
]
|
|
218
|
+
expect(test_deployer.deployment_info_from('node')).to eq(
|
|
219
|
+
'node' => {
|
|
220
|
+
deployment_info: { user: 'test_user' },
|
|
221
|
+
exit_status: 666,
|
|
222
|
+
services: %w[unknown],
|
|
223
|
+
stderr: 'stderrの展開テストログ',
|
|
224
|
+
stdout: 'stdoutの展開テストログ'
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
expect(HybridPlatformsConductorTest::TestLogPlugin.calls).to eq [
|
|
228
|
+
{
|
|
229
|
+
method: :actions_to_read_logs,
|
|
230
|
+
node: 'node'
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
method: :logs_for,
|
|
234
|
+
node: 'node',
|
|
235
|
+
exit_status: 42,
|
|
236
|
+
stdout: 'ログファイルはstdoutを読み取ります',
|
|
237
|
+
stderr: 'ログファイルはstderrを読み取ります'
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
199
243
|
it 'gets deployment info from log plugins not having actions_to_read_logs' do
|
|
200
244
|
with_test_platform_for_deploy_tests({ nodes: { 'node' => {} } }, additional_config: 'send_logs_to :test_log_no_read') do
|
|
201
245
|
expect(test_deployer.deployment_info_from('node')).to eq(
|
|
@@ -5,7 +5,7 @@ module HybridPlatformsConductorTest
|
|
|
5
5
|
|
|
6
6
|
class << self
|
|
7
7
|
|
|
8
|
-
attr_accessor
|
|
8
|
+
attr_accessor(*%i[calls mocked_logs])
|
|
9
9
|
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -89,7 +89,7 @@ module HybridPlatformsConductorTest
|
|
|
89
89
|
stdout: stdout,
|
|
90
90
|
stderr: stderr
|
|
91
91
|
}
|
|
92
|
-
{
|
|
92
|
+
TestLogPlugin.mocked_logs[node] || {
|
|
93
93
|
services: %w[unknown],
|
|
94
94
|
deployment_info: {
|
|
95
95
|
user: 'test_user'
|
|
@@ -145,6 +145,7 @@ module HybridPlatformsConductorTest
|
|
|
145
145
|
HybridPlatformsConductorTest::TestPlugins::NodeCheck.only_on_nodes = nil
|
|
146
146
|
HybridPlatformsConductorTest::TestPlugins::SeveralChecks.runs = []
|
|
147
147
|
HybridPlatformsConductorTest::TestLogPlugin.calls = []
|
|
148
|
+
HybridPlatformsConductorTest::TestLogPlugin.mocked_logs = {}
|
|
148
149
|
HybridPlatformsConductorTest::TestLogNoReadPlugin.calls = []
|
|
149
150
|
HybridPlatformsConductorTest::TestSecretsReaderPlugin.calls = []
|
|
150
151
|
HybridPlatformsConductorTest::TestSecretsReaderPlugin.deployer = nil
|