Remove beaker

Removes all beaker related code that is not
needed anymore.

Depends-On: https://review.opendev.org/#/c/752833/
Depends-On: https://review.opendev.org/#/c/749114/
Depends-On: https://review.opendev.org/#/c/749121/
Depends-On: https://review.opendev.org/#/c/752302/
Change-Id: Ic4205bc2d9cb117b27a4149ef4b25234babc13c9
This commit is contained in:
Tobias Urdin 2020-09-20 19:03:35 +02:00
parent c328347a4e
commit a8091b6ee0
6 changed files with 2 additions and 144 deletions

View File

@ -28,9 +28,6 @@ In your Rakefile, require the rake\_tasks library:
require 'puppet-openstack_spec_helper/rake_tasks'
```
Instructions for using `puppet-openstack_spec_helper/beaker_spec_helper` in
`spec/spec_helper_acceptance.rb` to come soon.
Release notes for the project can be found at:
https://docs.openstack.org/releasenotes/puppet-openstack_spec_helper

View File

@ -1,65 +0,0 @@
# Function for spec_helper_acceptance.rb goes here
require 'beaker-rspec'
require 'beaker/puppet_install_helper'
require 'puppet-openstack_spec_helper/shared_examples_acceptance'
run_puppet_install_helper
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(Dir.getwd))
module_name = JSON.parse(open('metadata.json').read)['name'].split('-')[1]
c.include PuppetOpenstackSpecHelpers::SmokeTest
# Make sure proj_root is the real project root
unless File.exists?("#{proj_root}/metadata.json")
raise "bundle exec rspec spec/acceptance needs be run from module root."
end
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
hosts.each do |host|
# install git
install_package host, 'git'
zuul_branch = ENV['ZUUL_BRANCH_REAL'] || ENV['ZUUL_BRANCH']
puppet_maj_version = ENV['PUPPET_MAJ_VERSION']
repo = 'openstack/puppet-openstack-integration'
# Start out with clean moduledir, don't trust r10k to purge it
on host, "rm -rf /etc/puppet/modules/*"
# Install dependent modules via git or zuul
r = on host, "test -d /home/zuul/src/opendev.org/#{repo}", { :acceptable_exit_codes => [0,1] }
if r.exit_code == 0
on host, "mkdir openstack || true"
on host, "cp -R /home/zuul/src/opendev.org/#{repo} #{repo}"
else
on host, "git clone https://opendev.org/#{repo} #{repo}"
end
on host, "ZUUL_BRANCH=#{zuul_branch} PUPPET_MAJ_VERSION=#{puppet_maj_version} bash #{repo}/install_modules.sh"
on host, "WRITE_FACTS=true bash #{repo}/configure_facts.sh"
# Make sure EPEL is not installed.
# It can happens in OpenStack Infra when using centos7 images.
if os[:family].casecmp('RedHat') == 0
on host, "rpm -e epel-release || true"
end
# Install the module being tested
on host, "rm -fr /etc/puppet/modules/#{module_name}"
puppet_module_install(:source => proj_root, :module_name => module_name)
on host, "rm -fr #{repo}"
end
end
end

View File

@ -26,5 +26,5 @@ module OSDefaults
end
end
# Make sure we include any helpers for spec (non beaker) tests.
# Make sure we include any helpers for spec tests.
Dir[File.dirname(__FILE__) + '/support/**/*.rb'].each { |f| require f }

View File

@ -1,45 +0,0 @@
# Test a normal puppet run with idempotency.
shared_examples_for 'puppet_apply_success' do |manifest|
it 'should apply the manifest without error' do
apply_manifest(manifest, :catch_failures => true)
end
it 'should be idempotent' do
apply_manifest(manifest, :catch_changes => true)
end
end
# Test a normal puppet run with idempotency using files in the
# examples/tests directory (smoke testing)
shared_examples_for 'puppet_apply_success_from_example' do |test_file|
it 'should apply the manifest without error' do
apply_manifest(smoke_test_named(test_file), :catch_failures => true)
end
it 'should be idempotent' do
apply_manifest(smoke_test_named(test_file), :catch_changes => true)
end
end
# Check that a file exists and its content match the one given as
# argument. The argument can be a multiline string or an array of
# regexp.
#
# To use it encapsulate it in a context whose name is the file to
# test.
shared_examples 'a_valid_configuration' do |config_content|
let(:configuration_file) do |example|
# see the idiom it leads to later in this file
example.metadata[:example_group][:parent_example_group][:description]
end
subject { file(configuration_file) }
it { is_expected.to be_file }
it { is_expected.to exist }
content = nil
if config_content.is_a?(Array)
content = config_content
else
content = config_content.split("\n").map { |l| Regexp.quote(l) }
end
it 'content should be valid' do
expect(subject.content).to include_regexp(content)
end
end

View File

@ -44,13 +44,9 @@ Gem::Specification.new do |spec|
spec.add_dependency 'webmock'
spec.add_dependency 'etcdv3'
spec.add_dependency 'beaker-rspec'
spec.add_dependency 'beaker-puppet'
spec.add_dependency 'beaker-puppet_install_helper'
spec.add_dependency 'vagrant-wrapper'
spec.add_dependency 'r10k', ['>= 3.0.0']
spec.add_dependency 'bolt'
spec.add_dependency 'puppet_litmus'
spec.add_dependency 'serverspec'
end

View File

@ -1,25 +0,0 @@
#!/bin/bash -ex
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
source $SCRIPT_DIR/functions
install_gems
# run beaker tests
export BEAKER_set=${BEAKER_set:-nodepool-centos7}
export BEAKER_debug=yes
export BEAKER_color=no
$GEM_HOME/bin/bundle exec rspec spec/acceptance