Commit Graph

25 Commits

Author SHA1 Message Date
Tobias Urdin 33c6d9ad17 Use openstack_spec_helper from zuul checkout
Change-Id: I6d287cbc9fe093e9eb212080b983b4537f5419e4
2020-08-30 22:53:21 +02:00
ZhongShengping cc4d71253b Move to opendev
Change-Id: I801bceb3e2300032f09d5b72a05606fb322468a5
2019-04-21 14:44:48 +08:00
ZhongShengping 4ba2952d35 Load puppet-openstack_spec_helper locally during tests
Change-Id: I492904268c22353abcbd1f3376e2e1ad28074f24
Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
2018-02-12 10:53:34 +08:00
Alex Schultz 389a67eebc 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: If1b80bbc6fe5bf1c8f49659891add50a5ebcf997
2017-05-17 08:21:34 -06:00
Emilien Macchi fe020912a2 Gemfile: rely on puppet-openstack_spec_helper for dependencies
Rely on puppet-openstack_spec_helper gemspec file for managing Gems
dependencies.

Depends-On: Iaf01f0aed5a34fb83a27678e7e8bb4d2a84d6428
Change-Id: I2f1b7bdd638e2f4742c9e486fec135947c929e6f
2016-03-30 11:44:00 -04:00
Emilien Macchi aeb040c935 drop mock dependency
mock is not used anywhere in the module, let's drop it.
This patch will help to hit this bug:
https://launchpad.net/bugs/1492636

Change-Id: I000953c7b215454baf9838813c04e94b7ebeca00
2016-01-22 09:31:14 -05:00
Alex Schultz 4e5dc348b4 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: Ie420cd2599fa3e88e6471bf3e9fce20d48f19805
2016-01-14 20:32:37 +03:00
Emilien Macchi dfa1e8c0af 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.

Change-Id: I8b884ef477bbc031da6bd3955ed308679e0380f6
2015-10-08 14:46:03 -07:00
Sebastien Badia 93575b1639 Initial msync run for all Puppet OpenStack modules
This patch is the initial modulesync run, it impact:

* 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: I34e999a752667d5f85266bc64059d9740ccbc367
2015-08-06 18:43:19 +00:00
Emilien Macchi bf194d2f75 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: Ifeada55370bbd5b30418447c8fc1da101de2b774
Co-Authored-By: Colleen Murphy <colleen@gazlene.net>
2015-06-30 16:48:22 -04:00
Colleen Murphy ff9913826b 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: Ia96c315a44d7ae90511d515b03166cbe5a060f31
2015-06-08 12:55:06 -07:00
Emilien Macchi c2e9179394 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_keystone_spec: add case for repo configuration and support
  RH systems.
* rabbitmq: install module from source and on RH, install erlang before rabbitmq-server.

Change-Id: Ie6c823c7906afb37dd9e49fa434fefc3e26b5569
Closes-bug: #1444736
2015-05-13 08:10:39 -04:00
Jenkins c314b89ed1 Merge "Beaker tests" 2015-05-05 08:45:03 +00:00
Emilien Macchi 716ef623ba Beaker tests
Implement basic structure for beaker tests.

Change-Id: I6ca638994e9d2ecc8977a186525c9c41d2be563b
Closes-bug: #1444736
2015-05-01 17:27:00 -04:00
Emilien Macchi b22ed8d032 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: I765b70a4eef15eb9df14ea14dd6a65715d0ae637
2015-04-22 23:42:54 -04:00
Sebastien Badia 565c78cc7f 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.

This commit also remove custom metadata rake task (this task is now
provided by puppetlabs_spec_helper).

Conflicts:
	Gemfile

Change-Id: I22369948db6a2f8ddab9b8c93c3a047ff2e229ca
2015-03-11 09:03:59 +01:00
Sebastien Badia 55b7aad8cf 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 new
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)

Change-Id: Ieaff6bc8bdd8548648ff5e76b212d4df382fa8a3
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-11 08:56:44 +01:00
Sebastien Badia bc443c3248 Fix lint issues (doc, metadata, manifests)
Add puppet parameters lint (with puppet-lint-param-docs gem) and fix
missing documentations, this commit also fix manifest lint issues (due
to puppet-lint upgrade) and metadata.json file (SPDX license, and open
dependencies).

Change-Id: If0cfefec6b2c6865a3078d91a40326082825f8ec
2015-02-23 11:09:20 +01:00
Sebastien Badia 71f27f1a49 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: Ia41394433be65435fc7de6327a5659b26e1a85a5
Partial-bug: #1417604
2015-02-03 15:32:20 +01:00
Sebastien Badia 94825922a0 Added metadata lint and puppet-syntax gems
metadata-json-lint is a little tool to check the validity of
Puppet metatdata.json files.

puppet-syntax tool check the validity of templates,manifests and hiera
files (the goal here is to replace manual checks in the gate by a
standard? check `rake syntax`).

Change-Id: I60b9cdfe27eeb8a8f5ad3a238dd847ed3096cb6b
2014-11-02 17:08:36 +00:00
Clayton O'Neill bea7794633 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: Ia1286824cebca09e20bf6d11a3435982b93442b9
Partial-Bug: #1326034
2014-06-20 09:13:19 -04:00
Chris Hoge a43938f790 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: I857f6638a54160a315d5d98c77357a7f6449f3bd
2014-03-24 15:35:44 -07:00
Mathieu Gagné 5de0d86c1c 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.

Change-Id: Ifaba2b94d7b47cd32b9bb6eec04cf7f4b89d0411
2013-06-30 22:08:36 -04:00
Mathieu Gagné ff0a9749b8 Add puppet-lint to Gemfile
Change-Id: I34b20c29c27877c982c659253004df0a69cd0d27
2013-05-21 19:50:07 -04:00
Mathieu Gagné 49a63ed390 Add rspec tests for ceilometer and ceilometer::api 2013-04-04 17:40:02 -04:00