Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-3391) Limit rake spec on older puppet #36

Conversation

MosesMendoza
Copy link

The default rake spec task provided by puppetlabs_spec_helper requires symlink support in puppet to put fixtures in place for testing. Older versions of Puppet do not support symlinks on Windows. This PR adds a check in the Rakefile for whether or not Puppet supports symlinks, and if it does not, redefines the rake spec task that has been defined by puppetlabs_spec_helper, to accomplish two objectives:

  • Remove the call to rake spec_prep which prepares all fixtures and requires
    symlinks
  • Restrict the pattern for matching tests to those under the 'unit' directory
    (other tests require the fixture we won't have)

This feels a bit like overreaching into puppetlabs_spec_helper, but the alternative seems to be to duplicate the rake spec task in its entirety here or make even greater assumptions in puppetlabs_spec_helper about the constitution of modules other than puppetlabs-chocolatey.

Signed-off-by: Moses Mendoza [email protected]


# If puppet does not support symlinks (e.g., puppet <= 3.5) we cannot use
# puppetlabs_spec_helper's `rake spec` task because it requires symlink
# support. Redine `rake spec` without the symlink call and restrict the pattern

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo Redine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Had a commit staged and forgot to push. Will fixup once we've resolved all comments.

@MosesMendoza MosesMendoza force-pushed the MODULES-3391/master/restrict_tests_on_older_puppet branch 2 times, most recently from 7860a8d to 4dab278 Compare July 29, 2016 17:34
The default `rake spec` task provided by puppetlabs_spec_helper requires
symlink support in puppet to put fixtures in place for testing. Older versions
of Puppet do not support symlinks on Windows. This commit adds a check in the
Rakefile for whether or not Puppet supports symlinks, and if it does not,
redefines the `rake spec` task that has been defined by puppetlabs_spec_helper,
to accomplish two objectives:
- Remove the call to `rake spec_prep` which prepares all fixtures and requires
  symlinks
- Restrict the pattern for matching tests to those under the 'unit' and
  'integration' directories (other tests require the fixture we won't have)

This feels a bit like overreaching into puppetlabs_spec_helper, but the
alternative seems to be to duplicate the `rake spec` task in its entirety here
or make even greater assumptions in puppetlabs_spec_helper about the
constitution of modules other than puppetlabs-chocolatey.

Signed-off-by: Moses Mendoza <[email protected]>
@ferventcoder ferventcoder merged commit 59c5a43 into puppetlabs:master Jul 29, 2016
ThoughtCrhyme pushed a commit to ThoughtCrhyme/puppetlabs-chocolatey that referenced this pull request Mar 20, 2017
* updated install script to create custom fact

* updated site to use new qa modules

* adding new qa modules

* update to source xcode file correctly

* updated $path for running xcode script

* added gemset and bundler

* adding floaty gem

* adding software module

* update to use seamymckenna fork of bitbar

* update to use root to config def rvm gemset

* update to not use root to config def rvm gemset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants