Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
spec fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Nov 26, 2016
1 parent f191d16 commit 7a8f0f0
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 44 deletions.
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
---
language: ruby
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
rvm:
- 1.9.3
- 2.0.0
env:
- PUPPET_VERSION=3.8
bundler_args: --without development
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.6.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.6
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
sudo: false
43 changes: 29 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : "~> 3.0"
gem 'rake', '~> 10'
gem 'rspec-puppet', '~> 2.0'
gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 2.7'

gem 'rake'
gem 'rspec', '~> 3.0'
gem 'rspec-puppet', '~> 2.3'
gem 'rspec-puppet-facts', '>= 1.7'
gem 'puppetlabs_spec_helper', '>= 0.8.0'
gem 'puppet-lint', '>= 1'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-appends-check'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-numericvariable'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-resource_reference_syntax'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-usascii_format-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-version_comparison-check'
gem 'simplecov'
gem 'rspec-puppet-facts'
gem 'puppet-blacksmith', '>= 3.1.0', {"groups"=>["development"]}
gem 'json', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_19"], "groups"=>["test"]}
gem 'metadata-json-lint'
gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]}
gem 'json', '< 2.0', {"platforms"=>["ruby_18"]}
gem 'json_pure', '< 2.0', {"platforms"=>["ruby_18"]}
gem 'webmock', '< 2.0'
gem 'addressable', '< 2.4', {"platforms"=>["ruby_18"]}
gem 'oauth'
gem 'parallel_tests'
6 changes: 3 additions & 3 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
content => template("${module_name}/etc/etcd/etcd.conf.erb"),
}

if $::etcd::manage_package and $::etcd::journald_forward_enable and $::operatingsystemmajrelease == 7 {
if $::etcd::manage_package and $::etcd::journald_forward_enable and $::operatingsystemmajrelease == '7' {
file { '/etc/systemd/system/etcd.service.d':
ensure => 'directory',
owner => 'root',
Expand All @@ -22,11 +22,11 @@
} ~>
exec { 'systemctl-daemon-reload etcd_service':
refreshonly => true,
command => '/usr/bin/systemctl/systemctl daemon-reload',
command => '/usr/bin/systemctl daemon-reload',
}
}

if $::operatingsystemmajrelease == 6 {
if $::operatingsystemmajrelease == '6' {
file { '/etc/init.d/etcd':
ensure => file,
owner => 'root',
Expand Down
22 changes: 11 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,17 @@
$journald_forward_enable = $etcd::params::journald_forward_enable
) inherits etcd::params {
validate_integer([
$snapshot_count,
$heartbeat_interval,
$election_timeout,
$max_snapshots,
$max_wals,
$proxy_failure_wait,
$proxy_refresh_interval,
$proxy_dial_timeout,
$proxy_write_timeout,
$proxy_read_timeout,
])
$snapshot_count,
$heartbeat_interval,
$election_timeout,
$max_snapshots,
$max_wals,
$proxy_failure_wait,
$proxy_refresh_interval,
$proxy_dial_timeout,
$proxy_write_timeout,
$proxy_read_timeout,
])
validate_bool($strict_reconfig_check, $client_cert_auth, $peer_client_cert_auth, $debug, $journald_forward_enable)
validate_re($initial_cluster_state, '^(new|existing)$')
validate_re($discovery_fallback, '^(proxy|exit)$')
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-etcd",
"version": "1.9.0",
"version": "1.10.0",
"author": "Cristian Falcas",
"summary": "Installs and configures etcd",
"license": "Apache-2.0",
Expand Down
16 changes: 6 additions & 10 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
require 'spec_helper'

describe 'etcd', :type => :class do
describe 'etcd' do
on_supported_os.each do |os, facts|
context "on #{os}" do
context "with defaults on #{os}" do
let(:facts) do
facts.merge({:puppetversion => Puppet.version})
end
let :params do
{ :etcd_name => 'name',
}
end
it 'test default install' do
is_expected.to compile.with_all_deps
facts.merge({:puppetmaster => 'localhost.localdomain'})
end
let(:params) { { :etcd_name => 'name' } }
it { should compile.with_all_deps }
it { should contain_class('etcd') }
end
end
end
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
require 'rubygems'

require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts

RSpec.configure do |config|
config.mock_with :rspec do |c|
c.syntax = :expect
end
end

0 comments on commit 7a8f0f0

Please sign in to comment.