Skip to content

Commit 3669ba8

Browse files
committed
PDK Update - minimum spec test
1 parent 8369f67 commit 3669ba8

15 files changed

+408
-8
lines changed

Diff for: .fixtures.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixtures:
3+
repositories:
4+
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib"
5+
postgresql: "git://github.com/puppetlabs/puppetlabs-postgresql"

Diff for: .gitignore

+23-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
pkg/*
1+
.*.sw[op]
2+
.metadata
3+
.yardoc
4+
.yardwarns
5+
*.iml
6+
/.bundle/
7+
/.idea/
8+
/.vagrant/
9+
/coverage/
10+
/bin/
11+
/doc/
12+
/Gemfile.local
13+
/Gemfile.lock
14+
/junit/
15+
/log/
16+
/pkg/
17+
/spec/fixtures/manifests/
18+
/spec/fixtures/modules/
19+
/tmp/
20+
/vendor/
21+
/convert_report.txt
22+
/update_report.txt
23+
.DS_Store

Diff for: .pdkignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.*.sw[op]
2+
.metadata
3+
.yardoc
4+
.yardwarns
5+
*.iml
6+
/.bundle/
7+
/.idea/
8+
/.vagrant/
9+
/coverage/
10+
/bin/
11+
/doc/
12+
/Gemfile.local
13+
/Gemfile.lock
14+
/junit/
15+
/log/
16+
/pkg/
17+
/spec/fixtures/manifests/
18+
/spec/fixtures/modules/
19+
/tmp/
20+
/vendor/
21+
/convert_report.txt
22+
/update_report.txt
23+
.DS_Store

Diff for: .rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

Diff for: .rubocop.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
require: rubocop-rspec
3+
AllCops:
4+
DisplayCopNames: true
5+
TargetRubyVersion: '2.1'
6+
Include:
7+
- "./**/*.rb"
8+
Exclude:
9+
- bin/*
10+
- ".vendor/**/*"
11+
- "**/Gemfile"
12+
- "**/Rakefile"
13+
- pkg/**/*
14+
- spec/fixtures/**/*
15+
- vendor/**/*
16+
- "**/Puppetfile"
17+
- "**/Vagrantfile"
18+
- "**/Guardfile"
19+
Metrics/LineLength:
20+
Description: People have wide screens, use them.
21+
Max: 200
22+
RSpec/BeforeAfterAll:
23+
Description: Beware of using after(:all) as it may cause state to leak between tests.
24+
A necessary evil in acceptance testing.
25+
Exclude:
26+
- spec/acceptance/**/*.rb
27+
RSpec/HookArgument:
28+
Description: Prefer explicit :each argument, matching existing module's style
29+
EnforcedStyle: each
30+
Style/BlockDelimiters:
31+
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
32+
be consistent then.
33+
EnforcedStyle: braces_for_chaining
34+
Style/ClassAndModuleChildren:
35+
Description: Compact style reduces the required amount of indentation.
36+
EnforcedStyle: compact
37+
Style/EmptyElse:
38+
Description: Enforce against empty else clauses, but allow `nil` for clarity.
39+
EnforcedStyle: empty
40+
Style/FormatString:
41+
Description: Following the main puppet project's style, prefer the % format format.
42+
EnforcedStyle: percent
43+
Style/FormatStringToken:
44+
Description: Following the main puppet project's style, prefer the simpler template
45+
tokens over annotated ones.
46+
EnforcedStyle: template
47+
Style/Lambda:
48+
Description: Prefer the keyword for easier discoverability.
49+
EnforcedStyle: literal
50+
Style/RegexpLiteral:
51+
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
52+
EnforcedStyle: percent_r
53+
Style/TernaryParentheses:
54+
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
55+
on complex expressions for better readability, but seriously consider breaking
56+
it up.
57+
EnforcedStyle: require_parentheses_when_complex
58+
Style/TrailingCommaInArguments:
59+
Description: Prefer always trailing comma on multiline argument lists. This makes
60+
diffs, and re-ordering nicer.
61+
EnforcedStyleForMultiline: comma
62+
Style/TrailingCommaInLiteral:
63+
Description: Prefer always trailing comma on multiline literals. This makes diffs,
64+
and re-ordering nicer.
65+
EnforcedStyleForMultiline: comma
66+
Style/SymbolArray:
67+
Description: Using percent style obscures symbolic intent of array's contents.
68+
EnforcedStyle: brackets
69+
RSpec/MessageSpies:
70+
EnforcedStyle: receive
71+
Style/Documentation:
72+
Exclude:
73+
- lib/puppet/parser/functions/**/*
74+
Style/WordArray:
75+
EnforcedStyle: brackets
76+
Style/CollectionMethods:
77+
Enabled: true
78+
Style/MethodCalledOnDoEndBlock:
79+
Enabled: true
80+
Style/StringMethods:
81+
Enabled: true
82+
Layout/EndOfLine:
83+
Enabled: false
84+
Metrics/AbcSize:
85+
Enabled: false
86+
Metrics/BlockLength:
87+
Enabled: false
88+
Metrics/ClassLength:
89+
Enabled: false
90+
Metrics/CyclomaticComplexity:
91+
Enabled: false
92+
Metrics/MethodLength:
93+
Enabled: false
94+
Metrics/ModuleLength:
95+
Enabled: false
96+
Metrics/ParameterLists:
97+
Enabled: false
98+
Metrics/PerceivedComplexity:
99+
Enabled: false
100+
RSpec/DescribeClass:
101+
Enabled: false
102+
RSpec/ExampleLength:
103+
Enabled: false
104+
RSpec/MessageExpectation:
105+
Enabled: false
106+
RSpec/MultipleExpectations:
107+
Enabled: false
108+
RSpec/NestedGroups:
109+
Enabled: false
110+
Style/AsciiComments:
111+
Enabled: false
112+
Style/IfUnlessModifier:
113+
Enabled: false
114+
Style/SymbolProc:
115+
Enabled: false

Diff for: .sync.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
mock_with: ':rspec'
3+
4+
appveyor.yml:
5+
delete: true
6+
.project:
7+
delete: true
8+
.gitlab-ci.yml:
9+
delete: true
10+
11+
spec/default_facts.yml:
12+
extra_facts:
13+
pe_server_version: 2018.1.0
14+
memory:
15+
"system":
16+
"total": "16.00 GiB"
17+
"total_bytes": 17179869184
18+
processors:
19+
"count": 8

Diff for: .travis.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sudo: false
3+
dist: trusty
4+
language: ruby
5+
cache: bundler
6+
before_install:
7+
- bundle -v
8+
- rm -f Gemfile.lock
9+
- gem update --system
10+
- gem --version
11+
- bundle -v
12+
script:
13+
- 'bundle exec rake $CHECK'
14+
bundler_args: --without system_tests
15+
rvm:
16+
- 2.4.1
17+
env:
18+
global:
19+
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
20+
matrix:
21+
fast_finish: true
22+
include:
23+
-
24+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
25+
-
26+
env: CHECK=parallel_spec
27+
-
28+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
29+
rvm: 2.1.9
30+
branches:
31+
only:
32+
- master
33+
- /^v\d/
34+
notifications:
35+
email: false
36+
deploy:
37+
provider: puppetforge
38+
user: puppet
39+
password:
40+
secure: ""
41+
on:
42+
tags: true
43+
all_branches: true
44+
condition: "$DEPLOY_TO_FORGE = yes"

Diff for: .yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

Diff for: Gemfile

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2+
3+
def location_for(place_or_version, fake_version = nil)
4+
if place_or_version =~ %r{\A(git[:@][^#]*)#(.*)}
5+
[fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
6+
elsif place_or_version =~ %r{\Afile:\/\/(.*)}
7+
['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
8+
else
9+
[place_or_version, { require: false }]
10+
end
11+
end
12+
13+
def gem_type(place_or_version)
14+
if place_or_version =~ %r{\Agit[:@]}
15+
:git
16+
elsif !place_or_version.nil? && place_or_version.start_with?('file:')
17+
:file
18+
else
19+
:gem
20+
end
21+
end
22+
23+
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
24+
minor_version = ruby_version_segments[0..1].join('.')
25+
26+
group :development do
27+
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
28+
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
29+
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
30+
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
31+
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
32+
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
33+
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
34+
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
35+
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
36+
gem "puppet-blacksmith", '~> 3.4', require: false, platforms: [:ruby]
37+
end
38+
39+
puppet_version = ENV['PUPPET_GEM_VERSION']
40+
puppet_type = gem_type(puppet_version)
41+
facter_version = ENV['FACTER_GEM_VERSION']
42+
hiera_version = ENV['HIERA_GEM_VERSION']
43+
44+
gems = {}
45+
46+
gems['puppet'] = location_for(puppet_version)
47+
48+
# If facter or hiera versions have been specified via the environment
49+
# variables
50+
51+
gems['facter'] = location_for(facter_version) if facter_version
52+
gems['hiera'] = location_for(hiera_version) if hiera_version
53+
54+
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
55+
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
56+
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
57+
gems['win32-dir'] = ['<= 0.4.9', require: false]
58+
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
59+
gems['win32-process'] = ['<= 0.7.5', require: false]
60+
gems['win32-security'] = ['<= 0.2.5', require: false]
61+
gems['win32-service'] = ['0.8.8', require: false]
62+
end
63+
64+
gems.each do |gem_name, gem_params|
65+
gem gem_name, *gem_params
66+
end
67+
68+
# Evaluate Gemfile.local and ~/.gemfile if they exist
69+
extra_gemfiles = [
70+
"#{__FILE__}.local",
71+
File.join(Dir.home, '.gemfile'),
72+
]
73+
74+
extra_gemfiles.each do |gemfile|
75+
if File.file?(gemfile) && File.readable?(gemfile)
76+
eval(File.read(gemfile), binding)
77+
end
78+
end
79+
# vim: syntax=ruby

Diff for: Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require 'puppetlabs_spec_helper/rake_tasks'
2+
require 'puppet-syntax/tasks/puppet-syntax'
3+
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
4+
5+
PuppetLint.configuration.send('disable_relative')
6+

Diff for: manifests/postgresql_settings.pp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class pe_databases::postgresql_settings (
22
Float[0,1] $autovacuum_vacuum_scale_factor = 0.08,
33
Float[0,1] $autovacuum_analyze_scale_factor = 0.04,
4-
Integer $autovacuum_max_workers = pe_max( 3, pe_min( 8, $::processors['count'] / 3)),
4+
Integer $autovacuum_max_workers = max( 3, min( 8, $facts['processors']['count'] / 3)),
55
Integer $log_autovacuum_min_duration = -1,
66
Integer $log_temp_files = -1,
77
String $work_mem = '8MB',
@@ -16,12 +16,12 @@
1616
Optional[Float[0,1]] $reports_autovacuum_vacuum_scale_factor = 0.01,
1717
Boolean $manage_reports_autovacuum_cost_delay = true,
1818
String $maintenance_work_mem = $all_in_one_pe_install ? {
19-
false => "${::memory['system']['total_bytes'] / 1024 / 1024 / 3}MB",
20-
true => "${::memory['system']['total_bytes'] / 1024 / 1024 / 8}MB",
19+
false => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 3}MB",
20+
true => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 8}MB",
2121
},
2222
String $autovacuum_work_mem = $all_in_one_pe_install ? {
23-
false => "${::memory['system']['total_bytes'] / 1024 / 1024 / 3/ $autovacuum_max_workers}MB",
24-
true => "${::memory['system']['total_bytes'] / 1024 / 1024 / 8/ $autovacuum_max_workers}MB",
23+
false => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 3/ $autovacuum_max_workers}MB",
24+
true => "${facts['memory']['system']['total_bytes'] / 1024 / 1024 / 8/ $autovacuum_max_workers}MB",
2525
},
2626
String $psql_version = $pe_databases::psql_version,
2727
) {

Diff for: metadata.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
"project_page": "https://github.com/npwalker/pe_databases",
99
"issues_url": "https://github.com/npwalker/pe_databases/issues",
1010
"dependencies": [
11-
{"name":"puppetlabs-postgresql","version_requirement":">= 4.7.0"}
11+
{
12+
"name": "puppetlabs-postgresql",
13+
"version_requirement": ">= 4.7.0"
14+
},
15+
{
16+
"name": "puppetlabs-stdlib",
17+
"version_requirement": ">= 4.0.0"
18+
}
1219
],
1320
"operatingsystem_support": [
1421
{
@@ -63,6 +70,13 @@
6370
{
6471
"name": "pe",
6572
"version_requirement": ">= 2015.2.0"
73+
},
74+
{
75+
"name": "puppet",
76+
"version_requirement": ">= 4.0"
6677
}
67-
]
78+
],
79+
"pdk-version": "1.6.0.pre (heads/master-0-g1c719d9)",
80+
"template-url": "https://github.com/puppetlabs/pdk-templates",
81+
"template-ref": "heads/master-0-g34e3266"
6882
}

0 commit comments

Comments
 (0)