Skip to content

(FM-8230) Convert testing to litmus #1031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
fixtures:
repositories:
facts: 'git://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'git://github.com/puppetlabs/puppetlabs-puppet_agent.git'
provision: 'git://github.com/puppetlabs/provision.git'
symlinks:
stdlib: "#{source_dir}"
test: "#{source_dir}/spec/fixtures/test"
test: "#{source_dir}/spec/fixtures/test"
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GetText:
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down
21 changes: 4 additions & 17 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,12 @@
inherit_from: .rubocop_todo.yml

.travis.yml:
docker_sets:
- set: docker/centos-7
- set: docker/ubuntu-14.04
docker_defaults:
bundler_args: ""
secure: ""
branches:
- release
unmanaged: true

appveyor.yml:
unmanaged: true

Gemfile:
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
platforms: ruby
- gem: 'puppet-module-win-system-r#{minor_version}'
platforms:
- mswin
- mingw
- x64_mingw
optional:
':development':
- gem: 'github_changelog_generator'
Expand Down
107 changes: 83 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
dist: trusty
language: ruby
cache: bundler
before_install:
Expand All @@ -12,52 +13,110 @@ script:
bundler_args: --without system_tests
rvm:
- 2.5.3
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
env:
global:
- PUPPET_GEM_VERSION="~> 6.0"
matrix:
fast_finish: true
include:
-
bundler_args:
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply
env: PLATFORMS=debian_puppet5
rvm: 2.5.3
script: bundle exec rake beaker
before_script:
- bundle exec rake 'litmus:provision_list[waffle_debian]'
- bundle exec rake 'litmus:install_agent[puppet5]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
stage: acceptance
sudo: required
-
bundler_args:
bundler_args:
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply
env: PLATFORMS=debian_puppet6
rvm: 2.5.3
script: bundle exec rake beaker
before_script:
- bundle exec rake 'litmus:provision_list[waffle_debian]'
- bundle exec rake 'litmus:install_agent[puppet6]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
stage: acceptance
sudo: required
-
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
bundler_args:
dist: trusty
env: PLATFORMS=el6_puppet5
rvm: 2.5.3
before_script:
- bundle exec rake 'litmus:provision_list[waffle_el6]'
- bundle exec rake 'litmus:install_agent[puppet5]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.5
stage: spec
bundler_args:
dist: trusty
env: PLATFORMS=el6_puppet6
rvm: 2.5.3
before_script:
- bundle exec rake 'litmus:provision_list[waffle_el6]'
- bundle exec rake 'litmus:install_agent[puppet6]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
bundler_args:
dist: trusty
env: PLATFORMS=el7_puppet5
rvm: 2.5.3
before_script:
- bundle exec rake 'litmus:provision_list[waffle_el7]'
- bundle exec rake 'litmus:install_agent[puppet5]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
bundler_args:
dist: trusty
env: PLATFORMS=el7_puppet6
rvm: 2.5.3
stage: spec
before_script:
- bundle exec rake 'litmus:provision_list[waffle_el7]'
- bundle exec rake 'litmus:install_agent[puppet6]'
- bundle exec rake litmus:install_module
script:
- bundle exec rake litmus:acceptance:parallel
services: docker
sudo: required
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
-
env: DEPLOY_TO_FORGE=yes
stage: deploy
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.5
branches:
only:
- master
- /^v\d/
- release
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
all_branches: true
condition: "$DEPLOY_TO_FORGE = yes"
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ group :development do
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
Expand Down
21 changes: 21 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ environment:
PUPPET_GEM_VERSION: ~> 6.0
RUBY_VERSION: 25-x64
CHECK: parallel_spec
-
RUBY_VERSION: 25-x64
ACCEPTANCE: yes
TARGET_HOST: localhost
-
RUBY_VERSION: 25-x64
ACCEPTANCE: yes
TARGET_HOST: localhost
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
for:
-
matrix:
only:
- ACCEPTANCE: yes
install:
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
- bundle install --jobs 4 --retry 2
- type Gemfile.lock
test_script:
- bundle exec rake spec_prep
- bundle exec rake litmus:acceptance:localhost
matrix:
fast_finish: true
install:
Expand Down
25 changes: 25 additions & 0 deletions distelli-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
team-modules/puppetlabs-stdlib:
PreBuild:
- source /opt/rh/rh-ruby25/enable
- echo "--- LETS update BUNDLER ---"
- bundle install --path vendor/bundle --jobs 3
Build:
- echo "--- PROVISIONING ---"
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:provision_list[release_checks]
- cat inventory.yaml
- echo "--- AGENT INSTALLATION ---"
- bundle exec rake litmus:install_agent
- echo "--- MODULE INSTALLATION ---"
- bundle exec rake litmus:install_module
- echo "--- TESTS RUNNING ---"
- bundle exec rake litmus:acceptance:parallel
AfterBuildSuccess:
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:tear_down
AfterBuildFailure:
- source /opt/rh/rh-ruby25/enable
- bundle exec rake litmus:tear_down
CommitData:
- RepoType: Git
- RepoPath: .
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@
"description": "Standard Library for Puppet Modules",
"pdk-version": "1.10.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-ref": "heads/master-0-g7827fc2"
"template-ref": "heads/master-0-g2b33205"
}
16 changes: 16 additions & 0 deletions provision.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
default:
provisioner: docker
images: ['waffleimage/centos7']
waffle_debian:
provisioner: docker
images: ['waffleimage/debian8', 'waffleimage/debian9', 'waffleimage/ubuntu14.04', 'waffleimage/ubuntu16.04', 'waffleimage/ubuntu18.04']
waffle_el6:
provisioner: docker
images: ['waffleimage/centos6', 'waffleimage/scientificlinux6']
waffle_el7:
provisioner: docker
images: ['waffleimage/centos7', 'waffleimage/oraclelinux7', 'waffleimage/scientificlinux7']
release_checks:
provisioner: vmpooler
images: ['redhat-5-x86_64', 'redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-5-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'oracle-5-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'win-2008-x86_64', 'win-2008r2-x86_64', 'win-2012-x86_64', 'win-2012r2-x86_64', 'win-2016-x86_64', 'win-2019-x86_64', 'win-7-x86_64', 'win-81-x86_64', 'win-10-pro-x86_64']
15 changes: 8 additions & 7 deletions spec/acceptance/anchor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spec_helper_acceptance'

describe 'anchor type' do
describe 'success' do
pp = <<-DOC
let(:pp) do
<<-MANIFEST
class anchored {
anchor { 'anchored::begin': }
~> anchor { 'anchored::end': }
Expand All @@ -15,11 +15,12 @@ class anchorrefresh {
}

include anchorrefresh
DOC
it 'effects proper chaining of resources' do
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stdout).to match(%r{Anchor\[final\]: Triggered 'refresh'})
end
MANIFEST
end

it 'applies manifest, anchors resources in correct order' do
apply_manifest(pp) do |r|
expect(r.stdout).to match(%r{Anchor\[final\]: Triggered 'refresh'})
end
end
end
Loading