Commit graph

15 commits

Author SHA1 Message Date
David Schmitt
6527a3aa22 (MAINT) switch to rspec-puppet-facts
Switching out the puppet version, as puppet_facts does, does not work,
as this will confuse code that wants to use version-dependent features.

Instead this uses rspec-puppet-facts, which doesn't touch the puppet
version.
2015-10-13 11:29:42 +01:00
Colleen Murphy
a59c68b165 Update tests for rspec-puppet 2 and future parser
This patch changes the raise_error matchers to use `catalogue` instead
of `subject` since `subject` is not evaluated the way it used to be;
changes a parameter value from empty string to nil to be compatible
with the future parser, and unpins rspec-puppet.
2015-03-23 22:09:15 -07:00
Morgan Haskel
11fb01c736 Fix test issues
Remove the dependency on stdlib 4.x puppetlabs/puppetlabs-mysql#574
introduced, add some input validation, and improve test checks.
2014-11-14 13:16:01 -08:00
Yanis Guenane
5e6a1c418a (MODULES-1338) Allow mysql::db to import several files
A user might need to import several files on database creation.
Currently the module only allows the import of a single file.
This commit allows one to, from now on, import severals.

Before :

  mysql::db { 'test' :
    sql => '/tmp/my_import1.sql',
  }

Now :

  mysql::db { 'test' :
    sql => [
      '/tmp/my_import1.sql',
      '/tmp/my_import2.sql',
    ]
  }
2014-11-13 14:17:50 -05:00
Ashley Penney
00a191f9ed Convert specs to RSpec 2.99.1 syntax with Transpec
This conversion is done by Transpec 2.3.6 with the following command:
    transpec -f -c "bundle exec rake spec"

* 69 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 48 conversions
    from: obj.should
      to: expect(obj).to

* 34 conversions
    from: == expected
      to: eq(expected)

* 4 conversions
    from: it { should_not ... }
      to: it { is_expected.not_to ... }

* 3 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 2 conversions
    from: lambda { }.should
      to: expect { }.to

* 2 conversions
    from: pending
      to: skip

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2014-08-08 16:47:44 -04:00
Pan
2834498e4d Allow use different name for db resource other than db name
When defining the mysql::db as exported resources, there are chances that the
same resource names are defined across the site, which will cause puppet agent
fail. By adding an optional dbname parameter, default to the $name, it allows the
resouce name to be defined differently, e.g. ${dbname}_${domain}.
Also updated test and docs for dbname parameter and add acceptance test for
dbname parameter feature
2014-03-15 13:38:13 -07:00
Ashley Penney
803034e880 Rewrite spec tests to account for changes. 2013-09-13 13:14:48 -04:00
Ashley Penney
369c83126b Use new provider names in manifests.
Modify manifests and tests to handle the renamed providers.
2013-08-28 18:11:21 -04:00
Martin Magr
e3d74a65b0 Use $root_home for .my.cnf 2013-07-08 11:49:30 +02:00
Hunter Haugen
0e4de09934 Merge pull request #93 from Savar/master
new config define and a small bugfix
2012-08-29 11:54:58 -07:00
Simon Effenberg
e47b4d19e7 fixed documentation and added rspec
* fixed a typo in the documentation
* added documentation for parameter +notify_service+
* added rspec test
2012-08-24 08:01:33 +02:00
Martin Dluhos
04537908a9 Added an option to specify db status. 2012-08-21 15:40:42 -07:00
Nan Liu
b1f90fd1d2 Major refactor of mysql module.
This is a major change to the module and would be released as a new
version.

* Add self.instances to database and database_user for puppet resource.
* Update database provider to use flush method.
* Update module to conform to puppet-lint recommendations.
* Cleanup some unecessary logic in mysql::db define type.
* Move mysql_restart to config class.
* Use class to class dependency instead of resource dependency.
* Change appropriate rspec-puppet tests.
* Add fixtures directory to simplify testing.
* Update raketask and spec_helper to reflect fixture changes.
* Update mysql_password function to support validation.
* Move client installation to a separate class.
* Update documentation and readme.
2012-03-13 15:19:53 -07:00
Carl Caum
0783c748b7 Only notify Exec to import sql if sql is given
Commit e3b9fd broke the mysql::db defined type by always notifying the
Exec[${name}-import-import] resource even though the resource may not be
declared if the $sql parameter was not given. This commit adds an
in-selector to only notify the Exec resource if the $sql parameter has a
value.  More extensive rspec-puppet tests have been provided to protect
against this in the future.
2011-12-19 20:48:47 -08:00
Carl Caum
e3b9fd90a6 (#11508) Only load sql_scripts on DB creation
Previous to this commit, if the sql parameter was provided to a
declaration of the mysql::db defined type, the defined type would always
load the sql script on every catalog run. This changes the exec that
loads that sql script to be refreshonly unless the enforce_sql parameter
is set to true.
2011-12-19 07:25:35 -08:00