Skip to content

Commit c8ee7fd

Browse files
committed
Build fixes for travis failures
1 parent 97d8648 commit c8ee7fd

File tree

10 files changed

+51
-24
lines changed

10 files changed

+51
-24
lines changed

.rubocop.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
2-
require: rubocop-rspec
2+
require:
3+
- rubocop-rspec
4+
- rubocop-i18n
35
AllCops:
46
DisplayCopNames: true
57
TargetRubyVersion: '2.1'
@@ -19,10 +21,12 @@ AllCops:
1921
Metrics/LineLength:
2022
Description: People have wide screens, use them.
2123
Max: 200
24+
GetText:
25+
Enabled: false
2226
GetText/DecorateString:
2327
Description: We don't want to decorate test output.
2428
Exclude:
25-
- spec/*
29+
- spec/**/*
2630
RSpec/BeforeAfterAll:
2731
Description: Beware of using after(:all) as it may cause state to leak between tests.
2832
A necessary evil in acceptance testing.

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.4
1+
2.5.1

.sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
.travis.yml:
1717
# we keep our own .travis.yml because of integration testing
1818
unmanaged: true
19+
.vscode/extensions.json:
20+
# we don't use VSCode
21+
unmanaged: true
1922
appveyor.yml:
2023
# we don't use Appveyor
2124
unmanaged: true

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,42 +65,42 @@ matrix:
6565
- DOCS_TEST="true"
6666
- PUPPET_GEM_VERSION="~> 6.0"
6767
- name: "RHEL/CentOS 6 - Puppet 5"
68-
rvm: 2.4
68+
rvm: 2.5
6969
gemfile: build/kitchen/Gemfile
7070
env:
7171
- TEST_NAME="centos6-puppet5"
7272
- name: "RHEL/CentOS 6 - Puppet 6"
73-
rvm: 2.4
73+
rvm: 2.5
7474
gemfile: build/kitchen/Gemfile
7575
env:
7676
- TEST_NAME="centos6-puppet6"
7777
- name: "RHEL/CentOS 7 - Puppet 5"
78-
rvm: 2.4
78+
rvm: 2.5
7979
gemfile: build/kitchen/Gemfile
8080
env:
8181
- TEST_NAME="centos7-puppet5"
8282
- name: "RHEL/CentOS 7 - Puppet 6"
83-
rvm: 2.4
83+
rvm: 2.5
8484
gemfile: build/kitchen/Gemfile
8585
env:
8686
- TEST_NAME="centos7-puppet6"
8787
- name: "Ubuntu 14 - Puppet 5"
88-
rvm: 2.4
88+
rvm: 2.5
8989
gemfile: build/kitchen/Gemfile
9090
env:
9191
- TEST_NAME="ubuntu14-puppet5"
9292
- name: "Ubuntu 14 - Puppet 6"
93-
rvm: 2.4
93+
rvm: 2.5
9494
gemfile: build/kitchen/Gemfile
9595
env:
9696
- TEST_NAME="ubuntu14-puppet6"
9797
- name: "Ubuntu 16 - Puppet 5"
98-
rvm: 2.4
98+
rvm: 2.5
9999
gemfile: build/kitchen/Gemfile
100100
env:
101101
- TEST_NAME="ubuntu16-puppet5"
102102
- name: "Ubuntu 16 - Puppet 6"
103-
rvm: 2.4
103+
rvm: 2.5
104104
gemfile: build/kitchen/Gemfile
105105
env:
106106
- TEST_NAME="ubuntu16-puppet6"

Gemfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ group :development do
2323
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
2424
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2525
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
26-
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
27-
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
28-
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
29-
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
26+
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
27+
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
28+
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
29+
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30+
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3031
gem "puppet-lint-absolute_classname-check", '>= 0.2.4', require: false
3132
gem "puppet-lint-absolute_template_path", '>= 1.0.1', require: false
3233
gem "puppet-lint-alias-check", '>= 0.1.1', require: false
@@ -39,7 +40,6 @@ group :development do
3940
gem "puppet-lint-trailing_comma-check", '>= 0.3.2', require: false
4041
gem "puppet-lint-unquoted_string-check", '>= 0.3.0', require: false
4142
gem "puppet-lint-version_comparison-check", '>= 0.2.1', require: false
42-
gem "r10k", '>= 2.0.0', require: false
4343
end
4444

4545
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
12
require 'puppetlabs_spec_helper/rake_tasks'
23
require 'puppet-syntax/tasks/puppet-syntax'
34
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
@@ -14,8 +15,17 @@ end
1415

1516
def changelog_project
1617
return unless Rake.application.top_level_tasks.include? "changelog"
17-
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
18-
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
18+
19+
returnVal = nil
20+
returnVal ||= begin
21+
metadata_source = JSON.load(File.read('metadata.json'))['source']
22+
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
23+
24+
metadata_source_match && metadata_source_match[1]
25+
end
26+
27+
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
28+
1929
puts "GitHubChangelogGenerator project:#{returnVal}"
2030
returnVal
2131
end

Vagrantfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ provider = provider.to_sym
4040
# The following boxes will work for both :virtualbox and :libvirt providers
4141
# - centos/6
4242
# - centos/7
43-
# - generic/1404
44-
# - generic/1604
43+
# - generic/ubuntu1404
44+
# - generic/ubuntu1604
45+
# - generic/ubuntu1804
4546
box = ENV['BOX'] ? ENV['BOX'] : 'centos/7'
47+
#box = ENV['BOX'] ? ENV['BOX'] : 'generic/ubuntu1604'
4648

4749
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
4850
VAGRANTFILE_API_VERSION = "2"

build/kitchen/Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
source 'https://rubygems.org'
22

33
# Gems for kitchen ci
4-
gem 'inspec'
4+
# hard code to 4.16.0 because of missing resource declaration bugs in 4.17.x
5+
gem 'inspec', '~> 4.16.0'
56
gem 'kitchen-docker'
67
gem 'kitchen-inspec'
78
# install kitchen-puppet from git so we get use the resolve_with_r10k feature

metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"version_requirement": ">= 4.7.0 < 7.0.0"
9696
}
9797
],
98-
"pdk-version": "1.10.0",
99-
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git#1.10.0",
100-
"template-ref": "1.10.0-0-gbba9ac3"
98+
"pdk-version": "1.13.0",
99+
"template-url": "pdk-default#1.13.0",
100+
"template-ref": "1.13.0-0-g66e1443"
101101
}

spec/spec_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
end
3030
end
3131

32+
# read default_facts and merge them over what is provided by facterdb
33+
default_facts.each do |fact, value|
34+
add_custom_fact fact, value
35+
end
36+
3237
RSpec.configure do |c|
3338
c.default_facts = default_facts
3439
c.before :each do
@@ -41,6 +46,8 @@
4146
end
4247
end
4348

49+
# Ensures that a module is defined
50+
# @param module_name Name of the module
4451
def ensure_module_defined(module_name)
4552
module_name.split('::').reduce(Object) do |last_module, next_module|
4653
last_module.const_set(next_module, Module.new) unless last_module.const_defined?(next_module, false)

0 commit comments

Comments
 (0)