cem_acpt 0.6.1 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +528 -0
- data/Gemfile.lock +1 -1
- data/lib/cem_acpt/config.rb +36 -1
- data/lib/cem_acpt/logging.rb +1 -1
- data/lib/cem_acpt/platform/base.rb +3 -1
- data/lib/cem_acpt/platform/gcp.rb +2 -2
- data/lib/cem_acpt/platform.rb +10 -10
- data/lib/cem_acpt/provision/terraform.rb +38 -12
- data/lib/cem_acpt/test_runner.rb +13 -6
- data/lib/cem_acpt/utils/ssh.rb +1 -1
- data/lib/cem_acpt/version.rb +1 -1
- data/lib/terraform/gcp/linux/main.tf +9 -3
- 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: da173e5bbc397b34ef8e828472c09dd998e64075d81ae053321872f3ad5c0b30
|
4
|
+
data.tar.gz: 9c067b0eef317c0a0968b88df56dcc8431cce7bd70ae89d5e623d8e6390b823d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc96047d1a94e5a121dd683511fc6d05af0b32b2d1cfe1e4c25d11db4574e396addc5c768defa0b4acaf5d6c7b608829ee5a3afc6921d958286125162f22b8f3
|
7
|
+
data.tar.gz: 7a1eb94420de096b0b585ac88ccd59d236db539793346ce90b983b56020dcfb54a018d75dcfef3c3c39e91528f8be074350fdc1b2fcfe11c7d643d78680ca728
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,528 @@
|
|
1
|
+
---
|
2
|
+
require:
|
3
|
+
- rubocop-performance
|
4
|
+
- rubocop-rspec
|
5
|
+
AllCops:
|
6
|
+
NewCops: enable
|
7
|
+
SuggestExtensions: false
|
8
|
+
DisplayCopNames: true
|
9
|
+
TargetRubyVersion: '3.2'
|
10
|
+
Include:
|
11
|
+
- "**/*.rb"
|
12
|
+
Exclude:
|
13
|
+
- bin/*
|
14
|
+
- ".vendor/**/*"
|
15
|
+
- "**/Gemfile"
|
16
|
+
- "**/Rakefile"
|
17
|
+
- pkg/**/*
|
18
|
+
- vendor/**/*
|
19
|
+
Layout/LineLength:
|
20
|
+
Description: People have wide screens, use them.
|
21
|
+
Max: 200
|
22
|
+
RSpec/HookArgument:
|
23
|
+
Description: Prefer explicit :each argument, matching existing module's style
|
24
|
+
EnforcedStyle: each
|
25
|
+
Style/BlockDelimiters:
|
26
|
+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
|
27
|
+
be consistent then.
|
28
|
+
EnforcedStyle: braces_for_chaining
|
29
|
+
Style/ClassAndModuleChildren:
|
30
|
+
Enabled: false
|
31
|
+
Style/EmptyElse:
|
32
|
+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
|
33
|
+
EnforcedStyle: empty
|
34
|
+
Style/FormatString:
|
35
|
+
Description: Following the main puppet project's style, prefer the % format format.
|
36
|
+
EnforcedStyle: percent
|
37
|
+
Style/FormatStringToken:
|
38
|
+
Description: Following the main puppet project's style, prefer the simpler template
|
39
|
+
tokens over annotated ones.
|
40
|
+
EnforcedStyle: template
|
41
|
+
Style/Lambda:
|
42
|
+
Description: Prefer the keyword for easier discoverability.
|
43
|
+
EnforcedStyle: literal
|
44
|
+
Style/RegexpLiteral:
|
45
|
+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
|
46
|
+
EnforcedStyle: percent_r
|
47
|
+
Style/TernaryParentheses:
|
48
|
+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
|
49
|
+
on complex expressions for better readability, but seriously consider breaking
|
50
|
+
it up.
|
51
|
+
EnforcedStyle: require_parentheses_when_complex
|
52
|
+
Style/TrailingCommaInArguments:
|
53
|
+
Description: Prefer always trailing comma on multiline argument lists. This makes
|
54
|
+
diffs, and re-ordering nicer.
|
55
|
+
EnforcedStyleForMultiline: comma
|
56
|
+
Style/TrailingCommaInArrayLiteral:
|
57
|
+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
|
58
|
+
and re-ordering nicer.
|
59
|
+
EnforcedStyleForMultiline: comma
|
60
|
+
Style/SymbolArray:
|
61
|
+
Enabled: false
|
62
|
+
Lint/ScriptPermission:
|
63
|
+
Enabled: false
|
64
|
+
Style/IfInsideElse:
|
65
|
+
Enabled: false
|
66
|
+
RSpec/MessageSpies:
|
67
|
+
EnforcedStyle: receive
|
68
|
+
Style/WordArray:
|
69
|
+
Enabled: false
|
70
|
+
Performance/AncestorsInclude:
|
71
|
+
Enabled: true
|
72
|
+
Performance/BigDecimalWithNumericArgument:
|
73
|
+
Enabled: true
|
74
|
+
Performance/BlockGivenWithExplicitBlock:
|
75
|
+
Enabled: true
|
76
|
+
Performance/CaseWhenSplat:
|
77
|
+
Enabled: true
|
78
|
+
Performance/ConstantRegexp:
|
79
|
+
Enabled: true
|
80
|
+
Performance/MethodObjectAsBlock:
|
81
|
+
Enabled: true
|
82
|
+
Performance/RedundantSortBlock:
|
83
|
+
Enabled: true
|
84
|
+
Performance/RedundantStringChars:
|
85
|
+
Enabled: true
|
86
|
+
Performance/ReverseFirst:
|
87
|
+
Enabled: true
|
88
|
+
Performance/SortReverse:
|
89
|
+
Enabled: true
|
90
|
+
Performance/Squeeze:
|
91
|
+
Enabled: true
|
92
|
+
Performance/StringInclude:
|
93
|
+
Enabled: true
|
94
|
+
Performance/Sum:
|
95
|
+
Enabled: true
|
96
|
+
Style/CollectionMethods:
|
97
|
+
Enabled: true
|
98
|
+
Style/MethodCalledOnDoEndBlock:
|
99
|
+
Enabled: true
|
100
|
+
Style/StringMethods:
|
101
|
+
Enabled: true
|
102
|
+
Bundler/InsecureProtocolSource:
|
103
|
+
Enabled: false
|
104
|
+
Gemspec/DuplicatedAssignment:
|
105
|
+
Enabled: false
|
106
|
+
Gemspec/OrderedDependencies:
|
107
|
+
Enabled: false
|
108
|
+
Gemspec/RequiredRubyVersion:
|
109
|
+
Enabled: false
|
110
|
+
Gemspec/RubyVersionGlobalsUsage:
|
111
|
+
Enabled: false
|
112
|
+
Layout/ArgumentAlignment:
|
113
|
+
Enabled: false
|
114
|
+
Layout/BeginEndAlignment:
|
115
|
+
Enabled: false
|
116
|
+
Layout/ClosingHeredocIndentation:
|
117
|
+
Enabled: false
|
118
|
+
Layout/EmptyComment:
|
119
|
+
Enabled: false
|
120
|
+
Layout/EmptyLineAfterGuardClause:
|
121
|
+
Enabled: false
|
122
|
+
Layout/EmptyLinesAroundArguments:
|
123
|
+
Enabled: false
|
124
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
125
|
+
Enabled: false
|
126
|
+
Layout/EndOfLine:
|
127
|
+
Enabled: false
|
128
|
+
Layout/FirstArgumentIndentation:
|
129
|
+
Enabled: false
|
130
|
+
Layout/HashAlignment:
|
131
|
+
Enabled: false
|
132
|
+
Layout/HeredocIndentation:
|
133
|
+
Enabled: false
|
134
|
+
Layout/LeadingEmptyLines:
|
135
|
+
Enabled: false
|
136
|
+
Layout/SpaceAroundMethodCallOperator:
|
137
|
+
Enabled: false
|
138
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
139
|
+
Enabled: false
|
140
|
+
Layout/SpaceInsideReferenceBrackets:
|
141
|
+
Enabled: false
|
142
|
+
Lint/BigDecimalNew:
|
143
|
+
Enabled: false
|
144
|
+
Lint/BooleanSymbol:
|
145
|
+
Enabled: false
|
146
|
+
Lint/ConstantDefinitionInBlock:
|
147
|
+
Enabled: false
|
148
|
+
Lint/DeprecatedOpenSSLConstant:
|
149
|
+
Enabled: false
|
150
|
+
Lint/DisjunctiveAssignmentInConstructor:
|
151
|
+
Enabled: false
|
152
|
+
Lint/DuplicateElsifCondition:
|
153
|
+
Enabled: false
|
154
|
+
Lint/DuplicateRequire:
|
155
|
+
Enabled: false
|
156
|
+
Lint/DuplicateRescueException:
|
157
|
+
Enabled: false
|
158
|
+
Lint/EmptyConditionalBody:
|
159
|
+
Enabled: false
|
160
|
+
Lint/EmptyFile:
|
161
|
+
Enabled: false
|
162
|
+
Lint/ErbNewArguments:
|
163
|
+
Enabled: false
|
164
|
+
Lint/FloatComparison:
|
165
|
+
Enabled: false
|
166
|
+
Lint/HashCompareByIdentity:
|
167
|
+
Enabled: false
|
168
|
+
Lint/IdentityComparison:
|
169
|
+
Enabled: false
|
170
|
+
Lint/InterpolationCheck:
|
171
|
+
Enabled: false
|
172
|
+
Lint/MissingCopEnableDirective:
|
173
|
+
Enabled: false
|
174
|
+
Lint/MixedRegexpCaptureTypes:
|
175
|
+
Enabled: false
|
176
|
+
Lint/NestedPercentLiteral:
|
177
|
+
Enabled: false
|
178
|
+
Lint/NonDeterministicRequireOrder:
|
179
|
+
Enabled: false
|
180
|
+
Lint/OrderedMagicComments:
|
181
|
+
Enabled: false
|
182
|
+
Lint/OutOfRangeRegexpRef:
|
183
|
+
Enabled: false
|
184
|
+
Lint/RaiseException:
|
185
|
+
Enabled: false
|
186
|
+
Lint/RedundantCopEnableDirective:
|
187
|
+
Enabled: false
|
188
|
+
Lint/RedundantRequireStatement:
|
189
|
+
Enabled: false
|
190
|
+
Lint/RedundantSafeNavigation:
|
191
|
+
Enabled: false
|
192
|
+
Lint/RedundantWithIndex:
|
193
|
+
Enabled: false
|
194
|
+
Lint/RedundantWithObject:
|
195
|
+
Enabled: false
|
196
|
+
Lint/RegexpAsCondition:
|
197
|
+
Enabled: false
|
198
|
+
Lint/ReturnInVoidContext:
|
199
|
+
Enabled: false
|
200
|
+
Lint/SafeNavigationConsistency:
|
201
|
+
Enabled: false
|
202
|
+
Lint/SafeNavigationWithEmpty:
|
203
|
+
Enabled: false
|
204
|
+
Lint/SelfAssignment:
|
205
|
+
Enabled: false
|
206
|
+
Lint/SendWithMixinArgument:
|
207
|
+
Enabled: false
|
208
|
+
Lint/ShadowedArgument:
|
209
|
+
Enabled: false
|
210
|
+
Lint/StructNewOverride:
|
211
|
+
Enabled: false
|
212
|
+
Lint/ToJSON:
|
213
|
+
Enabled: false
|
214
|
+
Lint/TopLevelReturnWithArgument:
|
215
|
+
Enabled: false
|
216
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
217
|
+
Enabled: false
|
218
|
+
Lint/UnreachableLoop:
|
219
|
+
Enabled: false
|
220
|
+
Lint/UriEscapeUnescape:
|
221
|
+
Enabled: false
|
222
|
+
Lint/UriRegexp:
|
223
|
+
Enabled: false
|
224
|
+
Lint/UselessMethodDefinition:
|
225
|
+
Enabled: false
|
226
|
+
Lint/UselessTimes:
|
227
|
+
Enabled: false
|
228
|
+
Metrics/AbcSize:
|
229
|
+
Enabled: false
|
230
|
+
Metrics/BlockLength:
|
231
|
+
Enabled: false
|
232
|
+
Metrics/BlockNesting:
|
233
|
+
Enabled: false
|
234
|
+
Metrics/ClassLength:
|
235
|
+
Max: 1000
|
236
|
+
Metrics/CyclomaticComplexity:
|
237
|
+
Enabled: false
|
238
|
+
Metrics/MethodLength:
|
239
|
+
Max: 1000
|
240
|
+
Metrics/ModuleLength:
|
241
|
+
Enabled: false
|
242
|
+
Metrics/ParameterLists:
|
243
|
+
Enabled: false
|
244
|
+
Metrics/PerceivedComplexity:
|
245
|
+
Enabled: false
|
246
|
+
Migration/DepartmentName:
|
247
|
+
Enabled: false
|
248
|
+
Naming/AccessorMethodName:
|
249
|
+
Enabled: false
|
250
|
+
Naming/BlockParameterName:
|
251
|
+
Enabled: false
|
252
|
+
Naming/FileName:
|
253
|
+
Exclude:
|
254
|
+
- spec/acceptance/**/*
|
255
|
+
Naming/HeredocDelimiterCase:
|
256
|
+
Enabled: false
|
257
|
+
Naming/HeredocDelimiterNaming:
|
258
|
+
Enabled: false
|
259
|
+
Naming/MemoizedInstanceVariableName:
|
260
|
+
Enabled: false
|
261
|
+
Naming/MethodParameterName:
|
262
|
+
Enabled: false
|
263
|
+
Naming/RescuedExceptionsVariableName:
|
264
|
+
Enabled: false
|
265
|
+
Naming/VariableNumber:
|
266
|
+
Enabled: false
|
267
|
+
Performance/BindCall:
|
268
|
+
Enabled: false
|
269
|
+
Performance/DeletePrefix:
|
270
|
+
Enabled: false
|
271
|
+
Performance/DeleteSuffix:
|
272
|
+
Enabled: false
|
273
|
+
Performance/InefficientHashSearch:
|
274
|
+
Enabled: false
|
275
|
+
Performance/UnfreezeString:
|
276
|
+
Enabled: false
|
277
|
+
Performance/UriDefaultParser:
|
278
|
+
Enabled: false
|
279
|
+
RSpec/Be:
|
280
|
+
Enabled: false
|
281
|
+
RSpec/BeEq:
|
282
|
+
Enabled: false
|
283
|
+
RSpec/Capybara/CurrentPathExpectation:
|
284
|
+
Enabled: false
|
285
|
+
RSpec/Capybara/FeatureMethods:
|
286
|
+
Enabled: false
|
287
|
+
RSpec/Capybara/VisibilityMatcher:
|
288
|
+
Enabled: false
|
289
|
+
RSpec/ClassCheck:
|
290
|
+
Enabled: false
|
291
|
+
RSpec/ContextMethod:
|
292
|
+
Enabled: false
|
293
|
+
RSpec/ContextWording:
|
294
|
+
Enabled: false
|
295
|
+
RSpec/DescribeClass:
|
296
|
+
Enabled: false
|
297
|
+
RSpec/EmptyHook:
|
298
|
+
Enabled: false
|
299
|
+
RSpec/EmptyLineAfterExample:
|
300
|
+
Enabled: false
|
301
|
+
RSpec/EmptyLineAfterExampleGroup:
|
302
|
+
Enabled: false
|
303
|
+
RSpec/EmptyLineAfterHook:
|
304
|
+
Enabled: false
|
305
|
+
RSpec/ExampleLength:
|
306
|
+
Enabled: false
|
307
|
+
RSpec/ExampleWithoutDescription:
|
308
|
+
Enabled: false
|
309
|
+
RSpec/ExpectChange:
|
310
|
+
Enabled: false
|
311
|
+
RSpec/ExpectInHook:
|
312
|
+
Enabled: false
|
313
|
+
RSpec/FactoryBot/AttributeDefinedStatically:
|
314
|
+
Enabled: false
|
315
|
+
RSpec/FactoryBot/CreateList:
|
316
|
+
Enabled: false
|
317
|
+
RSpec/FactoryBot/FactoryClassName:
|
318
|
+
Enabled: false
|
319
|
+
RSpec/HooksBeforeExamples:
|
320
|
+
Enabled: false
|
321
|
+
RSpec/ImplicitBlockExpectation:
|
322
|
+
Enabled: false
|
323
|
+
RSpec/ImplicitSubject:
|
324
|
+
Enabled: false
|
325
|
+
RSpec/LeakyConstantDeclaration:
|
326
|
+
Enabled: false
|
327
|
+
RSpec/LetBeforeExamples:
|
328
|
+
Enabled: false
|
329
|
+
RSpec/MissingExampleGroupArgument:
|
330
|
+
Enabled: false
|
331
|
+
RSpec/MultipleExpectations:
|
332
|
+
Enabled: false
|
333
|
+
RSpec/MultipleMemoizedHelpers:
|
334
|
+
Enabled: false
|
335
|
+
RSpec/MultipleSubjects:
|
336
|
+
Enabled: false
|
337
|
+
RSpec/NestedGroups:
|
338
|
+
Enabled: false
|
339
|
+
RSpec/PredicateMatcher:
|
340
|
+
Enabled: false
|
341
|
+
RSpec/ReceiveCounts:
|
342
|
+
Enabled: false
|
343
|
+
RSpec/ReceiveNever:
|
344
|
+
Enabled: false
|
345
|
+
RSpec/RepeatedExampleGroupBody:
|
346
|
+
Enabled: false
|
347
|
+
RSpec/RepeatedExampleGroupDescription:
|
348
|
+
Enabled: false
|
349
|
+
RSpec/RepeatedIncludeExample:
|
350
|
+
Enabled: false
|
351
|
+
RSpec/ReturnFromStub:
|
352
|
+
Enabled: false
|
353
|
+
RSpec/SharedExamples:
|
354
|
+
Enabled: false
|
355
|
+
RSpec/StubbedMock:
|
356
|
+
Enabled: false
|
357
|
+
RSpec/UnspecifiedException:
|
358
|
+
Enabled: false
|
359
|
+
RSpec/VariableDefinition:
|
360
|
+
Enabled: false
|
361
|
+
RSpec/VerifiedDoubleReference:
|
362
|
+
Enabled: false
|
363
|
+
RSpec/VoidExpect:
|
364
|
+
Enabled: false
|
365
|
+
RSpec/Yield:
|
366
|
+
Enabled: false
|
367
|
+
Security/Open:
|
368
|
+
Enabled: false
|
369
|
+
Style/AccessModifierDeclarations:
|
370
|
+
Enabled: false
|
371
|
+
Style/AccessorGrouping:
|
372
|
+
Enabled: false
|
373
|
+
Style/AsciiComments:
|
374
|
+
Enabled: false
|
375
|
+
Style/BisectedAttrAccessor:
|
376
|
+
Enabled: false
|
377
|
+
Style/CaseLikeIf:
|
378
|
+
Enabled: false
|
379
|
+
Style/ClassEqualityComparison:
|
380
|
+
Enabled: false
|
381
|
+
Style/ColonMethodDefinition:
|
382
|
+
Enabled: false
|
383
|
+
Style/CombinableLoops:
|
384
|
+
Enabled: false
|
385
|
+
Style/CommentedKeyword:
|
386
|
+
Enabled: false
|
387
|
+
Style/Dir:
|
388
|
+
Enabled: false
|
389
|
+
Style/DoubleCopDisableDirective:
|
390
|
+
Enabled: false
|
391
|
+
Style/EmptyBlockParameter:
|
392
|
+
Enabled: false
|
393
|
+
Style/EmptyLambdaParameter:
|
394
|
+
Enabled: false
|
395
|
+
Style/Encoding:
|
396
|
+
Enabled: false
|
397
|
+
Style/EvalWithLocation:
|
398
|
+
Enabled: false
|
399
|
+
Style/ExpandPathArguments:
|
400
|
+
Enabled: false
|
401
|
+
Style/ExplicitBlockArgument:
|
402
|
+
Enabled: false
|
403
|
+
Style/ExponentialNotation:
|
404
|
+
Enabled: false
|
405
|
+
Style/FetchEnvVar:
|
406
|
+
Enabled: false
|
407
|
+
Style/FloatDivision:
|
408
|
+
Enabled: false
|
409
|
+
Style/FrozenStringLiteralComment:
|
410
|
+
Enabled: false
|
411
|
+
Style/GlobalStdStream:
|
412
|
+
Enabled: false
|
413
|
+
Style/HashAsLastArrayItem:
|
414
|
+
Enabled: false
|
415
|
+
Style/HashLikeCase:
|
416
|
+
Enabled: false
|
417
|
+
Style/HashTransformKeys:
|
418
|
+
Enabled: false
|
419
|
+
Style/HashTransformValues:
|
420
|
+
Enabled: false
|
421
|
+
Style/IfUnlessModifier:
|
422
|
+
Enabled: false
|
423
|
+
Style/IfWithBooleanLiteralBranches:
|
424
|
+
Enabled: false
|
425
|
+
Style/KeywordParametersOrder:
|
426
|
+
Enabled: false
|
427
|
+
Style/MinMax:
|
428
|
+
Enabled: false
|
429
|
+
Style/MixinUsage:
|
430
|
+
Enabled: false
|
431
|
+
Style/MultilineWhenThen:
|
432
|
+
Enabled: false
|
433
|
+
Style/NegatedUnless:
|
434
|
+
Enabled: false
|
435
|
+
Style/NumericPredicate:
|
436
|
+
Enabled: false
|
437
|
+
Style/OptionalBooleanParameter:
|
438
|
+
Enabled: false
|
439
|
+
Style/OrAssignment:
|
440
|
+
Enabled: false
|
441
|
+
Style/QuotedSymbols:
|
442
|
+
Enabled: false
|
443
|
+
Style/RandomWithOffset:
|
444
|
+
Enabled: false
|
445
|
+
Style/RedundantAssignment:
|
446
|
+
Enabled: false
|
447
|
+
Style/RedundantCondition:
|
448
|
+
Enabled: false
|
449
|
+
Style/RedundantConditional:
|
450
|
+
Enabled: false
|
451
|
+
Style/RedundantFetchBlock:
|
452
|
+
Enabled: false
|
453
|
+
Style/RedundantFileExtensionInRequire:
|
454
|
+
Enabled: false
|
455
|
+
Style/RedundantRegexpCharacterClass:
|
456
|
+
Enabled: false
|
457
|
+
Style/RedundantRegexpEscape:
|
458
|
+
Enabled: false
|
459
|
+
Style/RedundantSelfAssignment:
|
460
|
+
Enabled: false
|
461
|
+
Style/RedundantSort:
|
462
|
+
Enabled: false
|
463
|
+
Style/RescueStandardError:
|
464
|
+
Enabled: false
|
465
|
+
Style/RedundantConstantBase:
|
466
|
+
Enabled: false
|
467
|
+
Style/RedundantStringEscape:
|
468
|
+
Enabled: false
|
469
|
+
Style/SelectByRegexp:
|
470
|
+
Enabled: false
|
471
|
+
Style/SingleArgumentDig:
|
472
|
+
Enabled: false
|
473
|
+
Style/SlicingWithRange:
|
474
|
+
Enabled: false
|
475
|
+
Style/SoleNestedConditional:
|
476
|
+
Enabled: false
|
477
|
+
Style/StderrPuts:
|
478
|
+
Enabled: false
|
479
|
+
Style/StringConcatenation:
|
480
|
+
Enabled: false
|
481
|
+
Style/Strip:
|
482
|
+
Enabled: false
|
483
|
+
Style/SymbolProc:
|
484
|
+
Enabled: false
|
485
|
+
Style/TrailingBodyOnClass:
|
486
|
+
Enabled: false
|
487
|
+
Style/TrailingBodyOnMethodDefinition:
|
488
|
+
Enabled: false
|
489
|
+
Style/TrailingBodyOnModule:
|
490
|
+
Enabled: false
|
491
|
+
Style/TrailingCommaInHashLiteral:
|
492
|
+
Enabled: false
|
493
|
+
Style/TrailingMethodEndStatement:
|
494
|
+
Enabled: false
|
495
|
+
Style/UnpackFirst:
|
496
|
+
Enabled: false
|
497
|
+
Lint/DuplicateBranch:
|
498
|
+
Enabled: false
|
499
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
500
|
+
Enabled: false
|
501
|
+
Lint/EmptyBlock:
|
502
|
+
Enabled: false
|
503
|
+
Lint/EmptyClass:
|
504
|
+
Enabled: false
|
505
|
+
Lint/NoReturnInBeginEndBlocks:
|
506
|
+
Enabled: false
|
507
|
+
Lint/ToEnumArguments:
|
508
|
+
Enabled: false
|
509
|
+
Lint/UnexpectedBlockArity:
|
510
|
+
Enabled: false
|
511
|
+
Lint/UnmodifiedReduceAccumulator:
|
512
|
+
Enabled: false
|
513
|
+
Performance/CollectionLiteralInLoop:
|
514
|
+
Enabled: false
|
515
|
+
Style/ArgumentsForwarding:
|
516
|
+
Enabled: false
|
517
|
+
Style/CollectionCompact:
|
518
|
+
Enabled: false
|
519
|
+
Style/DocumentDynamicEvalDefinition:
|
520
|
+
Enabled: false
|
521
|
+
Style/NegatedIfElseCondition:
|
522
|
+
Enabled: false
|
523
|
+
Style/NilLambda:
|
524
|
+
Enabled: false
|
525
|
+
Style/RedundantArgument:
|
526
|
+
Enabled: false
|
527
|
+
Style/SwapValues:
|
528
|
+
Enabled: false
|
data/Gemfile.lock
CHANGED
data/lib/cem_acpt/config.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'digest'
|
3
4
|
require 'json'
|
4
5
|
require 'yaml'
|
5
6
|
require_relative 'core_extensions'
|
@@ -19,6 +20,7 @@ module CemAcpt
|
|
19
20
|
log_format
|
20
21
|
module_dir
|
21
22
|
node_data
|
23
|
+
no_destroy_nodes
|
22
24
|
no_ephemeral_ssh_key
|
23
25
|
platform
|
24
26
|
provisioner
|
@@ -203,6 +205,14 @@ module CemAcpt
|
|
203
205
|
@terraform_dir ||= File.join(user_config_dir, 'terraform')
|
204
206
|
end
|
205
207
|
|
208
|
+
def module_terraform_checksum_file
|
209
|
+
@module_terraform_checksum_file ||= File.join(user_config_dir, 'terraform_checksum.txt')
|
210
|
+
end
|
211
|
+
|
212
|
+
def module_terraform_checksum
|
213
|
+
@module_terraform_checksum ||= new_module_terraform_checksum
|
214
|
+
end
|
215
|
+
|
206
216
|
def valid_env_var?(env_var)
|
207
217
|
env_var.start_with?('CEM_ACPT_') && ENV[env_var]
|
208
218
|
end
|
@@ -338,8 +348,33 @@ module CemAcpt
|
|
338
348
|
end
|
339
349
|
|
340
350
|
def create_config_dirs!
|
341
|
-
FileUtils.mkdir_p(user_config_dir)
|
351
|
+
FileUtils.mkdir_p(user_config_dir)
|
352
|
+
create_terraform_dir!
|
353
|
+
end
|
354
|
+
|
355
|
+
def create_terraform_dir!
|
356
|
+
raise 'Cannot create terraform dir without a user config dir' unless Dir.exist? user_config_dir
|
357
|
+
|
358
|
+
if File.exist?(module_terraform_checksum_file)
|
359
|
+
checksum = File.read(module_terraform_checksum_file).strip
|
360
|
+
return if checksum == module_terraform_checksum
|
361
|
+
end
|
342
362
|
FileUtils.cp_r(File.expand_path(File.join(__dir__, '..', 'terraform')), user_config_dir)
|
363
|
+
@module_terraform_checksum = new_module_terraform_checksum
|
364
|
+
File.write(module_terraform_checksum_file, module_terraform_checksum)
|
365
|
+
end
|
366
|
+
|
367
|
+
def new_module_terraform_checksum
|
368
|
+
sha256 = Digest::SHA256.new
|
369
|
+
files_and_dirs = Dir.glob(File.join(__dir__, '..', 'terraform', '**', '*'))
|
370
|
+
files_and_dirs.each do |file|
|
371
|
+
sha256 << if File.directory?(file)
|
372
|
+
File.basename(file)
|
373
|
+
else
|
374
|
+
File.read(file)
|
375
|
+
end
|
376
|
+
end
|
377
|
+
sha256.hexdigest
|
343
378
|
end
|
344
379
|
end
|
345
380
|
end
|
data/lib/cem_acpt/logging.rb
CHANGED
@@ -32,7 +32,7 @@ module CemAcpt
|
|
32
32
|
CemAcpt::Logging::Logger.new(config[:logdev],
|
33
33
|
config[:shift_age],
|
34
34
|
config[:shift_size],
|
35
|
-
**config.
|
35
|
+
**config.reject { |k, _| [:logdev, :shift_age, :shift_size].include?(k) })
|
36
36
|
end
|
37
37
|
new(*loggers)
|
38
38
|
end
|
@@ -15,12 +15,14 @@ module CemAcpt::Platform
|
|
15
15
|
|
16
16
|
# @param conf [CemAcpt::Config] the config object.
|
17
17
|
# @param single_test_data [Hash] the test data for the current test.
|
18
|
-
|
18
|
+
# @param run_data [Hash] the run data for the current run minus the test data key.
|
19
|
+
def initialize(config, single_test_data, **run_data)
|
19
20
|
raise ArgumentError, 'single_test_data must be a Hash' unless single_test_data.is_a?(Hash)
|
20
21
|
|
21
22
|
@config = config
|
22
23
|
@test_data = single_test_data
|
23
24
|
@node_name = @test_data[:node_name] || random_node_name
|
25
|
+
@run_data = run_data
|
24
26
|
end
|
25
27
|
|
26
28
|
def to_h
|
@@ -54,11 +54,11 @@ module Platform
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def gcp_private_key
|
57
|
-
@gcp_private_key ||= (@
|
57
|
+
@gcp_private_key ||= (@run_data[:private_key] || File.join(Dir.home, '.ssh', 'google_compute_engine'))
|
58
58
|
end
|
59
59
|
|
60
60
|
def gcp_public_key
|
61
|
-
@gcp_public_key ||= (@
|
61
|
+
@gcp_public_key ||= (@run_data[:public_key] || File.join(Dir.home, '.ssh', 'google_compute_engine.pub'))
|
62
62
|
end
|
63
63
|
|
64
64
|
def gcp_machine_type
|
data/lib/cem_acpt/platform.rb
CHANGED
@@ -17,16 +17,16 @@ module CemAcpt::Platform
|
|
17
17
|
# item in the test data.
|
18
18
|
# @param platform [String] the name of the platform
|
19
19
|
# @param config [CemAcpt::Config] the config object
|
20
|
-
# @param
|
21
|
-
def use(platform, config,
|
20
|
+
# @param run_data [Hash] the current run data. Must include a :test_data key
|
21
|
+
def use(platform, config, run_data)
|
22
22
|
raise Error, "Platform #{platform} is not supported" unless platforms.include?(platform)
|
23
|
-
raise Error, '
|
23
|
+
raise Error, 'run_data must be an Hash' unless run_data.is_a?(Hash)
|
24
|
+
raise Error, 'run_data must include a :test_data key' unless run_data.key?(:test_data)
|
25
|
+
raise Error, 'run_data[:test_data] must be an Array' unless run_data[:test_data].is_a?(Array)
|
24
26
|
|
25
|
-
logger.info "Using #{platform} for #{test_data.length} tests..."
|
26
|
-
test_data.each_with_object([]) do |single_test_data, ary|
|
27
|
-
|
28
|
-
#logger.debug("Allocated local port #{local_port} for test #{single_test_data[:test_name]}")
|
29
|
-
ary << new_platform_object(platform, config, single_test_data)
|
27
|
+
logger.info "Using #{platform} for #{run_data[:test_data].length} tests..."
|
28
|
+
run_data[:test_data].dup.each_with_object([]) do |single_test_data, ary|
|
29
|
+
ary << new_platform_object(platform, config, single_test_data, **run_data.reject { |k, _| k == :test_data })
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -62,10 +62,10 @@ module CemAcpt::Platform
|
|
62
62
|
# @param config [CemAcpt::Config] the config object.
|
63
63
|
# @param single_test_data [Hash] the test data for a single test.
|
64
64
|
# @return [CemAcpt::Platform::Base] an initialized platform class.
|
65
|
-
def new_platform_object(platform, config, single_test_data)
|
65
|
+
def new_platform_object(platform, config, single_test_data, **run_data)
|
66
66
|
raise Error, 'single_test_data must be a Hash' unless single_test_data.is_a?(Hash)
|
67
67
|
|
68
|
-
platform_class(platform).new(config, single_test_data)
|
68
|
+
platform_class(platform).new(config, single_test_data, **run_data)
|
69
69
|
end
|
70
70
|
|
71
71
|
# Creates a new platform-specific Class object for the given platform.
|
@@ -11,6 +11,7 @@ module CemAcpt
|
|
11
11
|
module Provision
|
12
12
|
class Terraform
|
13
13
|
DEFAULT_PLAN_NAME = 'testplan.tfplan'
|
14
|
+
DEFAULT_VARS_FILE = 'testvars.json'
|
14
15
|
include CemAcpt::Logging
|
15
16
|
|
16
17
|
attr_reader :environment, :working_dir
|
@@ -27,6 +28,7 @@ module CemAcpt
|
|
27
28
|
logger.info('Terraform') { 'Provisioning nodes...' }
|
28
29
|
@working_dir = new_working_dir
|
29
30
|
validate_working_dir!
|
31
|
+
save_vars_to_file!(formatted_vars) # Easier to reuse nodes this way
|
30
32
|
|
31
33
|
terraform_configure_logging
|
32
34
|
terraform_init
|
@@ -42,6 +44,10 @@ module CemAcpt
|
|
42
44
|
@working_dir = nil
|
43
45
|
end
|
44
46
|
|
47
|
+
def show
|
48
|
+
terraform_show
|
49
|
+
end
|
50
|
+
|
45
51
|
private
|
46
52
|
|
47
53
|
def terraform
|
@@ -104,6 +110,11 @@ module CemAcpt
|
|
104
110
|
)
|
105
111
|
end
|
106
112
|
|
113
|
+
def terraform_show
|
114
|
+
logger.debug('Terraform') { 'Showing Terraform state' }
|
115
|
+
terraform.show({ chdir: working_dir, no_color: true }, { environment: environment })
|
116
|
+
end
|
117
|
+
|
107
118
|
def new_backend(test_name)
|
108
119
|
if CemAcpt::Provision::Linux.use_for?(test_name)
|
109
120
|
logger.info('Terraform') { 'Using Linux backend' }
|
@@ -134,7 +145,7 @@ module CemAcpt
|
|
134
145
|
end
|
135
146
|
|
136
147
|
def new_working_dir
|
137
|
-
logger.debug('Terraform') {
|
148
|
+
logger.debug('Terraform') { 'Creating new working directory' }
|
138
149
|
base_dir = File.join(@config.get('terraform.dir'), @config.get('platform.name'))
|
139
150
|
logger.verbose('Terraform') { "Base directory defined as #{base_dir}" }
|
140
151
|
@backend.base_provision_directory = base_dir
|
@@ -157,21 +168,32 @@ module CemAcpt
|
|
157
168
|
logger.verbose('Terraform') { "Content of #{working_dir}:\n#{Dir.glob(File.join(working_dir, '*')).join("\n")}" }
|
158
169
|
raise "Terraform working directory #{working_dir} does not exist" unless File.directory?(working_dir)
|
159
170
|
raise "Terraform working directory #{working_dir} does not contain a Terraform file" unless Dir.glob(File.join(working_dir, '*.tf')).any?
|
171
|
+
|
160
172
|
logger.info('Terraform') { "Using working directory: #{working_dir}" }
|
161
173
|
rescue StandardError => e
|
162
174
|
logger.error('Terraform') { 'Error validating working directory' }
|
163
175
|
raise e
|
164
176
|
end
|
165
177
|
|
178
|
+
def save_vars_to_file!(vars)
|
179
|
+
logger.debug('Terraform') { "Saving vars to file #{File.join(working_dir, DEFAULT_VARS_FILE)}" }
|
180
|
+
File.write(File.join(working_dir, DEFAULT_VARS_FILE), vars.to_json)
|
181
|
+
rescue StandardError => e
|
182
|
+
logger.error('Terraform') { 'Error saving vars to file' }
|
183
|
+
raise e
|
184
|
+
end
|
185
|
+
|
166
186
|
def provision_node_data
|
167
187
|
node_data = @provision_data[:nodes].each_with_object({}) do |node, h|
|
168
|
-
h[node.node_name] = node.node_data.merge(
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
188
|
+
h[node.node_name] = node.node_data.merge(
|
189
|
+
{
|
190
|
+
goss_file: node.test_data[:goss_file],
|
191
|
+
puppet_manifest: node.test_data[:puppet_manifest],
|
192
|
+
provision_dir_source: @backend.provision_directory,
|
193
|
+
provision_dir_dest: @backend.destination_provision_directory,
|
194
|
+
provision_commands: @backend.provision_commands,
|
195
|
+
}
|
196
|
+
)
|
175
197
|
end
|
176
198
|
node_data.to_json
|
177
199
|
rescue StandardError => e
|
@@ -180,10 +202,14 @@ module CemAcpt
|
|
180
202
|
end
|
181
203
|
|
182
204
|
def formatted_vars
|
183
|
-
@provision_data[:nodes].first.platform_data.merge(
|
184
|
-
|
185
|
-
|
186
|
-
|
205
|
+
@provision_data[:nodes].first.platform_data.merge(
|
206
|
+
{
|
207
|
+
puppet_module_package: @provision_data[:module_package_path],
|
208
|
+
private_key: @provision_data[:private_key],
|
209
|
+
public_key: @provision_data[:public_key],
|
210
|
+
node_data: provision_node_data,
|
211
|
+
}
|
212
|
+
)
|
187
213
|
rescue StandardError => e
|
188
214
|
logger.error('Terraform') { 'Error creating formatted vars' }
|
189
215
|
raise e
|
data/lib/cem_acpt/test_runner.rb
CHANGED
@@ -44,7 +44,7 @@ module CemAcpt
|
|
44
44
|
logger.info('CemAcpt') { "Using module directory: #{config.get('module_dir')}..." }
|
45
45
|
Dir.chdir(config.get('module_dir')) do
|
46
46
|
keep_terminal_alive
|
47
|
-
@run_data[:
|
47
|
+
@run_data[:private_key], @run_data[:public_key], @run_data[:known_hosts] = new_ephemeral_ssh_keys
|
48
48
|
logger.info('CemAcpt') { 'Created ephemeral SSH key pair...' }
|
49
49
|
@run_data[:module_package_path] = build_module_package
|
50
50
|
logger.info('CemAcpt') { "Created module package: #{@run_data[:module_package_path]}..." }
|
@@ -67,9 +67,10 @@ module CemAcpt
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def clean_up(trap_context = false)
|
70
|
-
unless trap_context
|
71
|
-
|
72
|
-
|
70
|
+
kill_keep_terminal_alive unless trap_context
|
71
|
+
|
72
|
+
return no_destroy if config.get('no_destroy_nodes')
|
73
|
+
|
73
74
|
clean_ephemeral_ssh_keys
|
74
75
|
destroy_test_nodes
|
75
76
|
end
|
@@ -114,7 +115,7 @@ module CemAcpt
|
|
114
115
|
end
|
115
116
|
|
116
117
|
def new_node_data
|
117
|
-
CemAcpt::Platform.use(config.get('platform.name'), config, @run_data
|
118
|
+
CemAcpt::Platform.use(config.get('platform.name'), config, @run_data)
|
118
119
|
end
|
119
120
|
|
120
121
|
def provision_test_nodes
|
@@ -123,7 +124,13 @@ module CemAcpt
|
|
123
124
|
end
|
124
125
|
|
125
126
|
def destroy_test_nodes
|
126
|
-
@provisioner&.destroy
|
127
|
+
@provisioner&.destroy if config.get('no_destroy_nodes')
|
128
|
+
end
|
129
|
+
|
130
|
+
def no_destroy
|
131
|
+
logger.warn('CemAcpt') { 'Not destroying test nodes...' }
|
132
|
+
@provisioner&.show
|
133
|
+
logger.info('CemAcpt') { "Test SSH Keys:\n Private Key: #{@run_data[:private_key]}\n Public Key:#{@run_data[:public_key]}" }
|
127
134
|
end
|
128
135
|
|
129
136
|
def run_tests(hosts, only_actions, except_actions)
|
data/lib/cem_acpt/utils/ssh.rb
CHANGED
data/lib/cem_acpt/version.rb
CHANGED
@@ -99,6 +99,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
99
99
|
user = "${var.username}"
|
100
100
|
timeout = "5m"
|
101
101
|
host = self.network_interface.0.access_config.0.nat_ip
|
102
|
+
port = 22
|
102
103
|
private_key = "${file(var.private_key)}"
|
103
104
|
agent = false
|
104
105
|
}
|
@@ -116,6 +117,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
116
117
|
user = "${var.username}"
|
117
118
|
timeout = "2m"
|
118
119
|
host = self.network_interface.0.access_config.0.nat_ip
|
120
|
+
port = 22
|
119
121
|
private_key = "${file(var.private_key)}"
|
120
122
|
agent = false
|
121
123
|
}
|
@@ -129,6 +131,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
129
131
|
user = "${var.username}"
|
130
132
|
timeout = "2m"
|
131
133
|
host = self.network_interface.0.access_config.0.nat_ip
|
134
|
+
port = 22
|
132
135
|
private_key = "${file(var.private_key)}"
|
133
136
|
agent = false
|
134
137
|
}
|
@@ -142,6 +145,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
142
145
|
user = "${var.username}"
|
143
146
|
timeout = "2m"
|
144
147
|
host = self.network_interface.0.access_config.0.nat_ip
|
148
|
+
port = 22
|
145
149
|
private_key = "${file(var.private_key)}"
|
146
150
|
agent = false
|
147
151
|
}
|
@@ -155,6 +159,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
155
159
|
user = "${var.username}"
|
156
160
|
timeout = "2m"
|
157
161
|
host = self.network_interface.0.access_config.0.nat_ip
|
162
|
+
port = 22
|
158
163
|
private_key = "${file(var.private_key)}"
|
159
164
|
agent = false
|
160
165
|
}
|
@@ -166,6 +171,7 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
166
171
|
user = "${var.username}"
|
167
172
|
timeout = "5m"
|
168
173
|
host = self.network_interface.0.access_config.0.nat_ip
|
174
|
+
port = 22
|
169
175
|
private_key = "${file(var.private_key)}"
|
170
176
|
agent = false
|
171
177
|
}
|
@@ -173,9 +179,9 @@ resource "google_compute_instance" "acpt-test-node" {
|
|
173
179
|
}
|
174
180
|
|
175
181
|
metadata = {
|
176
|
-
oslogin = "
|
177
|
-
ssh-keys = "${var.username}:${file(var.public_key)}"
|
178
|
-
cem-acpt-test = each.value.test_name
|
182
|
+
"enable-oslogin" = "FALSE"
|
183
|
+
"ssh-keys" = "${var.username}:${file(var.public_key)}"
|
184
|
+
"cem-acpt-test" = each.value.test_name
|
179
185
|
}
|
180
186
|
|
181
187
|
tags = [ "cem-acpt-test-node" ]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cem_acpt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- puppetlabs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- ".github/workflows/spec.yml"
|
158
158
|
- ".gitignore"
|
159
159
|
- ".rspec"
|
160
|
+
- ".rubocop.yml"
|
160
161
|
- CODEOWNERS
|
161
162
|
- Gemfile
|
162
163
|
- Gemfile.lock
|