Commit Graph

18 Commits

Author SHA1 Message Date
Monty Taylor eff363f158 Retire repo
Depends-On: https://review.opendev.org/720892
Change-Id: Ib75cd0861d5f20f9ccacf96d38be81122dac75de
2020-04-22 10:18:58 -05:00
Clark Boylan 0abb2f5716 Revert "Create index on fresh install"
This reverts commit 5c44d09dc7.

This change forced us to do an offline reindex whenever the war was
updated. Unfortunately, that means even on minor upgrades we do a long
reindex, which times out in puppet, then puppet fails as does an
upgrade.

You can address this by setting offline_reindex = true when doing a new
install, then flip that to false (the default) once the new install is
bootstrapped.

Change-Id: I1f730a1cd2bcf96e6b94f2d0a82078f46d49e0ce
2019-01-14 10:06:04 -08:00
Colleen Murphy 86c008cca4 Fix beaker tests
On puppet 4, the tests were failing because the new ordering algorithm
caused the gerrit initializer exec resource to happen before the
database was set up. This patch adds an explicit ordering to the
gerrit::mysql class in the test fixtures to ensure the database is set
up first. This shouldn't be an issue in real life because we don't use
puppet to set up the database.

Also override the vhost_name and canonical server name parameters with
'localhost' since the $fqdn fact on test nodes can be wonky without some
extra setup.

Also add a conditional to the ssl-cert group exec so that it doesn't run
every time. Unfortunately this is not enough to make the tests
idempotent since the tidy resource behaves strangely when the directory
contains a symlink.

Change-Id: I56174d98496cd640b5b6490650a643c1aed740f7
2018-07-13 15:52:23 +02:00
Paul Belanger 7861ef1b8c
Switch to using openstack-infra/puppet-openstack_infra_spec_helper
Looking at puppet-openstackci, it seems this is the logic needed to
start using our centralized spec helper scripts.

Change-Id: I5b21f6fe14bf288f27f45e0b6c0e58db35b64d71
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-03-19 15:52:04 -04:00
Colleen Murphy 61f6803f1e Make beaker tests work on xenial
Remove all spec assertions for the existence of files. We can assume
that if the puppet finished successfully then the config files were also
laid down correctly. We remove these checks instead of updating the test
for /home/gerrit/id_rsa.pub which was moved to
/home/gerrit/.ssh/id_rsa.pub.

Remove all spec assertions for the existence of packages. Again, we can
assume that if puppet finished successfully then the package was found
and installed. We remove these checks instead of updating the test for
the JRE package to point to the new Xenial package.

Don't set java_home in the gerrit class since the module should be
setting the right default for us based on the release.

Make mysql config changes prompt a service restart (only in the
fixture). gerrit::mysql sets sql-mode to remove NO_ZERO_DATE, but the
mysql module doesn't restart the service by default when the config
changes and bindep preinstalls mysql so the service is already started
when my.cnf is set.

Update the beaker nodeset and spec helper to run on xenial and install
puppet from the Ubuntu repos instead of from puppetlabs since puppetlabs
doesn't support puppet 3 on xenial.

Change-Id: I0b6db86a76fc532443f80d6cbed2b1ef6ca9605e
2017-06-11 13:07:52 +02:00
Colleen Murphy 0fdd0671c0 Make gerrit work on xenial
First, add a params class so that we can distinguish between java packages
on different Ubuntu releases.

Set sql-mode for mysql to remove NO_ZERO_DATE mode so gerrit can
initialize. If not removed, gerrit tries to create the
account_group_by_id_aud table with column added_on with a default value
of 0 and fails. This is only important for CI and downstream since
Infra's gerrit instance uses trove instead of a local database.

Depends-On: If25da754ec107b8dba2d9343f16b54b99cc88e01
Change-Id: Ifd2244ae9dd212b2475f9cd6adb994bc058a4769
2017-06-11 11:54:28 +02:00
Khai Do 188e34af98 fix its_rules parameterization in template
The 'event-type' reference should be 'event_type' instead.
Also fixed a bug in the documentation and subsequent beaker test.

Change-Id: I4802f49e1fb1d3210aa49b4fe12a6e33a9f3bd42
2016-08-05 16:30:02 +00:00
Khai Do 7128938119 Add configurations for gerrit its plugins
This change will allow puppet to configure the its-storyboard plugin.
Settings in gerrit.config and secure.config is to associate gerrit
with an its plugin and settings in actions.config is to tell the
plugin to do something when a gerrit change gets updated. These
conditions are provided by the its-base plugin[1].

[1] https://gerrit.googlesource.com/plugins/its-base/+/stable-2.11/src/main/resources/Documentation/config-common.md
Change-Id: I9f47a2ed88ffbe827e494a478c0dc89a08bbe370
2016-07-20 11:22:44 -07:00
Khai Do c2824df95c Allow puppet to configure gerrit commitmessage parameters
Allow puppet to configure the Gerrit's commitmessage[1] options

[1] https://review.openstack.org/plugins/commit-message-length-validator/Documentation/config.html

Change-Id: Id7aff7d6d7250da804c690fbe6ff5b81f408d113
2016-07-18 10:08:09 -07:00
Khai Do 0b209db93b Refactor to accept java_home from parent modules
The java_home is needed in review.pp and review-dev.pp (in
system-config) so instead of defining it in here allow a parent
module to pass in the value.

Change-Id: I5e817fab8a8973b688fd44dd819e3616df171321
2016-07-15 11:26:20 -07:00
Clark Boylan 586ad6859e Use working war in testing
The tests break because our puppet module is not able to deploy older
gerrit wars any longer. Update the tests to deploy a new 2.11 war which
should work as it downloads packages from valid locations.

Change-Id: Id479a7a647b02cb97294dabf943665dbd6d0e4a6
2016-05-02 19:16:12 -07:00
Bruno Tavares 144c0101af Move test assertions closer to apply.
As discussed on another project patches when introducing tests[1], we
would like to keep the tests closer to the where we apply the spec.

This change makes the testing structure consistent to the feedback given
on puppet-bandersnatch discussion.

[1] https://review.openstack.org/#/c/221941/

Change-Id: Ie4e2224d0cf29268cd985b5695580e09443f6164
2015-10-01 13:52:16 -03:00
Glauco Oliveira f36dd91325 Setup preconditions for acceptance tests.
We split the definition of the module under test from its preconditions.

This behaviour was identified while testing puppet-zuul. To keep it
consistent across projects, we decided to also apply the same logic on
this module.

Change-Id: I0b9014ce6470d5c142ab6a3b281ea7401f88e738
Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com>
Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>
2015-09-30 18:38:46 -03:00
Glauco Oliveira 414b66a740 Trigger reindex only when secondary index is set.
Gerrit only allows the reindex command to work when there is a
secondary index type configured. By default, on this module, the value
for the secondary index is `false`.

If we execute Gerrit's reindex command while the secondary index is
false it will cause an error on `puppet apply`.

This change extracts the reindex command into it's own step on the
process. The command will only execute if we configured it with a
secondary index.

Change-Id: Ifac5daec7db6c2452a731f03c69e52afd196b8da
Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com>
2015-09-21 15:51:08 -03:00
Yolanda Robla 61b36f09ea fix puppet lint errors on gerrit
Currently local apply shows WARNING: defined type not documented
error, add comments to these methods to avoid it.

Change-Id: I5e88f31724bffb3d7474227741f0f180db186886
2015-09-04 11:19:32 +02:00
Glauco Oliveira ff88a8f6fb Add acceptance tests for puppet-gerrit
Add acceptance tests for puppet-gerrit module so that once the module is
applied we check if files were created, packages were installed and
services are available to users.
We left one pending test because this module is still not idempotent.

Co-Authored-By: Caio Carrara <ccarrara@thoughtworks.com>
Co-Authored-By: Dhiana Deva <ddeva@thoughtworks.com>
Change-Id: I88b5730d369578ae6763226c0424467286e753a2
2015-08-26 14:26:35 -03:00
Spencer Krum 199925b4c2 Fix target path for regular git clone during tests
Use same target directory for zuul-cloner and
the regular git command.

Change-Id: Ib5123e83572aac4bb9f2a08514233841a0b3def5
Co-Authored-By: Fabien Boucher <fabien.boucher@enovance.com>
2015-08-19 16:35:34 -07:00
Spencer Krum 2896e4ff93 Boilerplate beaker-rspec files
Change-Id: If03ca84c9afe43ac569bba2a71d854cf5c1acc46
2015-07-28 02:04:19 -07:00