Commit Graph

24 Commits

Author SHA1 Message Date
Tobias Urdin 2c3a746d06 Use openstack_spec_helper from zuul checkout
Change-Id: If369dd0c67bf927467a395b4e920f456fe94316e
2020-08-30 23:05:46 +02:00
ZhongShengping ce1abdd7ec Move to opendev
Change-Id: I9711abddc938b14c9b51762a3ba7e76f8a05ba40
2019-04-21 14:44:49 +08:00
ZhongShengping fe5bb6ec4d Load puppet-openstack_spec_helper locally during tests
Change-Id: I5a4f9a61180462233d9473465a9e252e8a5819ec
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:39 +08:00
Alex Schultz e6aec1f199 Update tox configuration
Update the tox configuration to pull in the openstack
upper-constraints.txt when running releasenotes. This will
fix the releasenotes job that is currently failing due to
a new version of sphinx. Additionally this change includes
updates from puppet-modulesync-configs.

Change-Id: I290282a1cffa598c3e64be41c902102980f424e6
2017-05-17 09:46:53 -06:00
Emilien Macchi b70f5287db Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Change-Id: Ic92757dc024de0e31e7f788381851f956f2977d8
2016-03-29 21:37:27 -04:00
Alex Schultz 3e9922baab Add rspec-puppet-facts to the spec_helper
This change adds the rspec-puppet-facts gem to the spec helper so that
we can centralize the management of the base operating systems that we
support. rspec-puppet-facts allows us to simplify our unit tests and
provides a more complete list of Operating Systems and their associated
facts for the unit tests.  With this change we can now loop over and
test CentOS, Debian, Fedora, RedHat, and Ubuntu by simply providing a
list of supported os to rspec-puppet-facts.

Additionally this change includes a central object for managing our
supported os list for rspec-puppet-facts and providing our default facts
like os_service_default. This central object should replace the usage of
@default_facts within the unit tests for each module.

Change-Id: I07cff6c0fe42281a8d88dc6a5105f0ad9a6e6dd1
2016-01-17 13:26:15 +03:00
Emilien Macchi 68eb6373f0 Try to use zuul-cloner to prepare fixtures
In OpenStack Infra, we would like to run Puppet unit tests that
sometimes depends on other Puppet OpenStack modules.
Example: a patch in puppet-openstacklib that needs to be tested in puppet-nova.

This patch modifies the Rakefile to:
* clean spec_prep and spec_clean Rake tasks
* use openstack/puppet-openstack-integration/install_modules_unit.sh script
  to clone modules.
* do not use .fixtures.yaml file to clone modules and rely on
  zuul-cloner or git.
* Add openstack/ in gitignore so we never commit the
  puppet-openstack-integration repository (can happen when spec_clean
  did not run but you want to submit the patch anyway)
* Allow to run a custom Puppetfile if PUPPETFILE env is exported. It
  will allow people to test the module with the dependencies they like,
  feature we had with .fixtures.yaml.

Also add 'r10k' to Gemfile.

That way, we will be able to use zuul dependencies and run tests accross
modules like we do with functional testing.

It also fix proxy/ceilometer rspec syntax for Puppet 3.x. This change
could not be in a separated patchset since it's related to this patch.

Change-Id: I8d20b5297dde8a2ecfcaf3d21d221735bc9df8d6
2015-10-09 09:16:58 -07:00
Cody Herriges bbcccfa801 Initial msync run for all Puppet OpenStack modules
This patch is the initial modulesync run, it impacts:

* gitignore: just a sync between projects
* gemfile:
  - update and allow to setup facter version and gem source
  - split beaker gems with a dedicated group
  - switch to rspec-puppet 2.2.0
* rakefile:
  - use the new syntax for lint configuration
  - add a acceptance target
* acceptance:
  - sync nodesets
* spec: added rspec coverage report

Change-Id: Ibc1c4cd5f4d9b553b565c2625b7fc380a509edc8
2015-09-06 02:05:29 +02:00
Emilien Macchi 13c40e8d0d Use beaker-puppet_install_helper to install puppet
When running with BEAKER_provision=no, the following happens:

In Trusty: beaker is running dpkg with '--force' option so even
if Puppet is already installed, the return code will be 0.
In CentOS: beaker is running 'rpm -ivh' the second time and since
the package is already here, the return code will be 1.

Using the new puppet install helper will abort installing puppet
if BEAKER_provision is no, so tests will continue as normal.

Change-Id: I30ade99fd33b76ebb3959851902746f58a249ff1
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:58:59 -04:00
Colleen Murphy 0d8892425c Unpin beaker-rspec
The latest version of beaker tries to manage sshd_config[1] in order to
pass through environment variables. JJB also tries to manage
sshd_config by adding Match blocks to securely allow root SSH[2]. When
beaker tries to append the PermitUserEnvironment line after the Match
blocks, SSH fails to open port 22 and beaker can't SSH in to the
node[3]. This patch unpins beaker-rspec and adds set_env: false to the
nodepool nodesets so that the set_env method is never called and does
not try to mess with the sshd_config.

[1] https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L528
[2] http://git.openstack.org/cgit/openstack-infra/project-config/tree/jenkins/jobs/puppet-module-jobs.yaml#n42
[3] http://logs.openstack.org/61/185161/1/check/gate-puppet-nova-puppet-beaker-rspec-dsvm-centos7/cd81608/console.html.gz#_2015-05-22_22_05_46_933
[4] https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host_prebuilt_steps.rb#L502

Change-Id: I0784643812f9947afba4e2e556aadae3296f7e36
2015-06-08 13:47:32 -07:00
Martin Mágr d05d97d39e Bring Redhat support to acceptance tests
OpenStack Infra has jobs to run this on both Ubuntu Trusty and CentOS7.

* Add minitest to Gemfile (dependency to run beaker on centos - see
  http://projects.theforeman.org/issues/2650 for details)
* separate nodepool files to have trusty & centos7 support in OS infra
* basic_swift_spec: add case for repo configuration and support
  RH systems.

Change-Id: I745fa76b2b36b0dbada83260fedffc4ee60f9c03
Closes-bug: #1444736
2015-05-22 11:39:10 -07:00
Emilien Macchi 59b47a29d1 Beaker tests
Implement basic structure for beaker tests.

Change-Id: I3ff1f74115be8029bffc0eb9f11e09cbd4cd74a9
Closes-bug: #1444736
2015-05-04 14:22:38 -04:00
Emilien Macchi 24a08bcf9c Bump rspec-puppet to 2.1.0
rspec-puppet 2.1.0 includes Puppet 4.0 support [1].

[1] https://github.com/rodjek/rspec-puppet/commits/v2.1.0

Change-Id: I87a629c6272eda7b79f60fda6830915c2f6ea5b5
2015-04-22 23:57:02 -04:00
Sebastien Badia dc8657e203 Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins. Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I9b41f170a782fecf88f241dc12288670b552b433
2015-03-25 13:46:00 +01:00
Sebastien Badia f4cfe8e8e4 spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
in order to be prepared for rspec 3.x move.

In details:
  * Use shared_examples "a Puppet::Error" for puppet::error tests
  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Fix spec tests for rspec-puppet 2.0.0
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
  * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)
  * Remove un-used puppet-lint (name_containing_dash config)

Change-Id: I5488507176d4665895eef65ddb4b6f0fb4eda3e7
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-24 15:22:16 +01:00
Sebastien Badia 77be0932fc Upgrade puppet-lint and fix metadata, parameter and style lint issues
This patch bump puppet-lint gem and add metadata and parameters checks.
Metadata lint issues (SPDX ID), missing parameters documentation and
syntaxe lint issues was also fixed in this patch

Doc for metadata syntax.
https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html

Change-Id: Ia6bb3483b3ffdbeed60b58702a36e0c7b31ffb86
2015-03-24 15:18:28 +01:00
Sebastien Badia 2c61fd3187 spec: pin rspec-puppet to 1.0.1
rspec-puppet (2.0.0) was released yesterday[1], this new version broke
puppet-openstack unit tests (undefined method `resource')[2] as talked on
and in a second time to update your specs to 2.0.0 and rspec 3.x`)

[1] 8459e14807
[2] http://logs.openstack.org/45/105245/6/check/gate-puppet-nova-puppet-unit-3.3/3682541/console.html

Change-Id: Ia98ccb05dddf592b5680cf27dfbc37c96e691f04
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Clayton O'Neill 78da999c5a Normalize Gemfile & pin tests to rspec < 2.99
Pin to rspec < 2.99 until rspec-puppet officially supports rspec 3.x.
This is to avoid warnings due to deprecated matchers in the
rspec-puppet gem.

This change is also intended to normalize the Gemfile for all stackforge
puppet modules.  This should facilitate pinning gem versions when
releasing new stable branches, since the same diff can be used for all
repos.

Change-Id: Ibc857d800943bc256f54bbe9faef0bce080a4fc0
Partial-Bug: #1326034
2014-06-20 09:16:20 -04:00
Chris Hoge 27579e7233 Fixed gate by Updating Gemfile to pin Rake to 10.1.1
The latest Rake update requires Ruby >= 1.9. Bundler in the
current gate uses 1.8.x. This update fixes the gate by pinning
Rake to the last known working version.

Change-Id: I8f798a71246c39deb91610bad1d0261aaa485a75
2014-03-24 15:39:12 -07:00
Mathieu Gagné f520d4e548 Add puppet-lint to Gemfile
Change-Id: I43a156e119742fe598796053da149e2f3c6dd465
2013-05-21 19:43:34 -04:00
Mathieu Gagné 93f5765bb2 Replace deprecated :rubygems source
Fix deprecation warnings thrown by bundler:

  The source :rubygems is deprecated because HTTP requests are insecure.
  Please change your source to 'https://rubygems.org' if possible,
  or 'http://rubygems.org' if not.

Fixes: bug #1175767
Change-Id: I9d8b0a39a81feda0d406e397cda01e8c6aad1f27
2013-05-02 16:30:38 -04:00
Dan Bode 73f8730385 Add Gemfile
so that we can gate on unit tests.

Change-Id: Ia691db4c81c204f737dddc6dcfc64c4179456248
2013-04-09 15:43:20 -07:00
Branan Purvine-Riley df7c59ccee Update module to use puppetlabs_spec_helper gem
* Automatically populate fixtures directory on spec runs
* Avoid duplicating spec_helper and Rakefile between modules
2012-05-31 17:11:07 -07:00
Dan Bode 2dbcf740df Add everything needed by travis-ci
This commit adds all of the config files
needed for travisci
2012-02-27 16:52:49 -08:00