puppetlabs_spec_helper 2.8.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md ADDED
@@ -0,0 +1,498 @@
1
+ # Previous Changes
2
+
3
+ ## [2.8.0]
4
+ ### Summary
5
+ This feature release adds a new rake task `parallel_spec_standalone` which is a parallel version of `spec_standalone`
6
+
7
+ ### Added
8
+ - `parallel_spec_standalone` rake task
9
+ - `spec_clean_symlinks` rake task to just clean symlink fixtures, not all fixtures
10
+ - Leave downloaded fixtures on test failure to speed up test runs.
11
+ - Update already-existing fixtures instead of doing nothing to them.
12
+
13
+ ## [2.7.0]
14
+ ### Summary
15
+ Feature release to begin moving away from mocha as a testing (specifically, mocking) framework for modules.
16
+
17
+ ### Added
18
+ - spec/plans/**/*_spec.rb to spec discovery pattern
19
+ - [mocha as default](README.md#mock_with) test framework unless explicitly set by a module
20
+
21
+ ### Fixed
22
+ - parsing for test tiers in beaker rake task
23
+ - module_spec_helper compatibility with mocha 1.5.0
24
+
25
+ ## [2.6.2]
26
+ ### Summary
27
+ A bugfix release to remove dependency on GettextSetup.initialize() in the Rake tasks.
28
+
29
+ ## [2.6.1]
30
+ ### Summary
31
+ Includes changes for 2.6.0 plus tests and bugfix of said feature.
32
+
33
+ ## 2.6.0 - Yanked
34
+ ### Summary
35
+ Adds a `defaults` section to `.fixtures.yml` to specify properties such as `flags` that apply to all fixtures in a category. One example use case is to specify an alternate forge URI for the `forge_modules` fixtures.
36
+
37
+ ### Added
38
+ - Add `defaults` section to fixtures.
39
+
40
+ ## [2.5.1]
41
+ ### Summary
42
+ Adds a fix to the parallel_spec rake task.
43
+
44
+ ### Fixed
45
+ - In parallel_spec, warn when there are no files to test against rather than fail.
46
+
47
+ ## [2.5.0]
48
+ ### Summary
49
+ Adds a feature to pass test file targets from 'rake spec' to 'rspec', also fixes a parsing issue with test\_tiers.
50
+
51
+ ### Added
52
+ - Allows passing test file targets through to 'rspec' from 'rake spec'.
53
+
54
+ ### Fixed
55
+ - Trim whitespace from test\_tiers before parsing.
56
+
57
+ ## [2.4.0]
58
+ ### Summary
59
+ Fix mercurial stuff, allow fixtures other than spec/fixtures/modules/, and allow running specific tags for beaker tests.
60
+
61
+ ### Added
62
+ - Ability to check out branches in mercurial
63
+ - Ability to target alternative locations to clone fixtures
64
+ - `TEST_TIERS` environment variable for beaker rake task
65
+
66
+ ### Fixed
67
+ - mercurial cleanup command
68
+ - handle parallel spec load failure better
69
+
70
+ ## [2.3.2]
71
+ ### Summary
72
+ Cleanups and fixes around fixture handling.
73
+
74
+ ### Fixed
75
+ - Do not error when no fixtures file is found or specified.
76
+ - Clean up fixtures, even if tests fail. Especially on Windows this is important to not keep lingering symlinks around.
77
+ - Fix creating of directory junctions (symlinks) on Windows for fixtures.
78
+
79
+
80
+ ## [2.3.1]
81
+ ### Summary
82
+ Adds a `spec_list_json` rake task
83
+
84
+ ### Added
85
+ - `spec_list_json` rake task to output a module's spec tests as a JSON document
86
+
87
+ ## [2.3.0]
88
+ ### Added
89
+ - `CI_SPEC_OPTIONS` environment variable for `parallel_spec` rake task
90
+
91
+ ### Fixed
92
+ - Remove puppet ~> 3.0 pin from gemspec
93
+
94
+ ## [2.2.0]
95
+ ### Summary
96
+ i18n rake task, and unbreak windows again.
97
+
98
+ ### Added
99
+ - New rake task for i18n stuff.
100
+
101
+ ### Fixed
102
+ - Fixture path calculation for windows
103
+ - Log to stderr instead of stdout as per rspec's spec
104
+
105
+ ## [2.1.5]
106
+ ### Summary:
107
+ Fix symlinks fixtures code.
108
+
109
+ ## [2.1.4]
110
+ ### Summary:
111
+ Better Windows support.
112
+
113
+ ### Fixed:
114
+ - Create directory junctions instead of symlinks on windows (#192)
115
+ - Replace check:symlinks with platform independent alternative (#193)
116
+
117
+ ## [2.1.3]
118
+ ### Summary:
119
+ This release fixes puppet module install into paths with spaces, and fix conflicting build names for CI jobs.
120
+
121
+ ### Fixed:
122
+ - Properly exscape paths for puppet module install
123
+ - Add "r" to the beginning of `rake compute_dev_version`
124
+
125
+ ## [2.1.2]
126
+ ### Summary:
127
+ The `release_tasks` now falls back to `spec` if the `parallel_spec` test fails due to the `parallel_tests` gem being absent.
128
+
129
+ ### Fixed:
130
+ - Make `release_tasks` fall back to `spec` when missing the `parallel_tests` gem
131
+
132
+ ## [2.1.1]
133
+ ### Summary:
134
+ Bugfix for an unstated dependency on parallel\_spec that was added in 2.0.0
135
+
136
+ ### Fixed:
137
+ - Add dependency for parallel\_spec, since psh requires it anyway.
138
+
139
+ ## [2.1.0]
140
+ ### Summary:
141
+ Minor version bump for new CI_SPEC_OPTIONS variable and bug fix.
142
+
143
+ ### Added:
144
+ - use CI_SPEC_OPTIONS to pass options to rspec
145
+
146
+ ### Fixed:
147
+ - an issue where gettext:setup tasks were being loaded in the wrong order within a module and causing the POT file to be created in the Puppet gem, not the module.
148
+
149
+ ## [2.0.2]
150
+ ### Summary:
151
+ Fixes an issue where the gettext rake tasks look in the spec\_helper and not the current module for the `locales/` directory.
152
+
153
+ ## [2.0.1]
154
+ ### Summary:
155
+ Fixes an issue where older puppets don't bring in the gettext gem requirement causing the psh rake tasks to fail.
156
+
157
+ ### Fixed:
158
+ - Don't define gettext rake tasks if gettext library is not present
159
+
160
+ ## [2.0.0]
161
+ ### Summary:
162
+ This release makes the module working dir configurable, adds features for future puppet features, and updates the spec rake task for TravisCI
163
+
164
+ ### Changed:
165
+ - The `release_tasks` rake task now calls `parallel_spec` instead of `spec`
166
+
167
+ ### Added:
168
+ - Make `module_working_dir` configurable
169
+ - Check `type_aliases` directory for spec tests
170
+ - Locales support for i18n
171
+
172
+ ### Fixed:
173
+ - Ensure /-only used on windows
174
+
175
+ ## [1.2.2]
176
+ ### Summary:
177
+
178
+ Dominic Cleal reported and fixed an issue with the STRICT_VARIABLES setting on puppet versions before 3.5.
179
+
180
+ ## [1.2.1]
181
+ ### Summary:
182
+
183
+ The previous release was taken down, as some optional gem dependencies slipped through into the gemspec, breaking builds using ruby 2.2 and earlier. This release updates the gem build process, so this should not happen again.
184
+
185
+ ## [1.2.0] - 2016-08-23
186
+ ### Summary:
187
+
188
+ Add a bunch of new features, and fix a bunch of annoying bugs: parallel test execution, default to strict variable checking on Puppet 4, code coverage, and rubocop tasks.
189
+
190
+ Thanks to all community contributors: Alexander Fisher, Alex Harvey, Chris Tessmer, David Moreno García, Dmitry Ilyin, Dominic Cleal, Federico Voges, Garrett Honeycutt, Leo Arnold, Matthew Haughton, Mickaël Canévet, and Rob Nelson.
191
+
192
+ ### Added:
193
+
194
+ New tasks:
195
+ * Add code coverage for Ruby >= 1.9 using SimpleCov.
196
+ * Add a rubocop rake task.
197
+ * Use beaker:ssh to log into your running beaker machines.
198
+
199
+ Spec parallelization
200
+ * Add `parallel_spec` task to run specs in parallel.
201
+ * Use CI_NODE_TOTAL and CI_NODE_INDEX to split tests across nodes.
202
+
203
+ Fixtures improvements:
204
+ * Automatically symlink the module directory, if no symlink fixtures are specified.
205
+ * Add the `subdir` key to repository fixtures to only use a part of that repository.
206
+ * Set `FIXTURES_YML` environment variable to load fixtures from somewhere else than `.fixtures.yml`.
207
+
208
+ ## Changed:
209
+ * Updated default excludes and rspec patterns.
210
+ * Updated default disabled lint checks to work with puppet-lint 2.0.0.
211
+ * Testing on Puppet 4 will now default to strict variable checking. Set STRICT_VARIABLES=no to disable.
212
+ * `PuppetInternals.scope` is now deprecated. Use the new `scope` property from rspec-puppet.
213
+ * beaker_nodes is now called beaker:sets.
214
+
215
+ ### Fixed:
216
+ * Ignore symlinks inside .git when running check:symlinks rake task.
217
+ * Allow multiple invocations of spec_prep to run in parallel.
218
+ * Address a race condition when cloning multiple git fixtures.
219
+ * Restrict gem dependencies to work with ruby 1.9.
220
+ * Update verify_contents() to work with duplicates in the arguments.
221
+
222
+ ## [1.1.1] - 2016-03-02
223
+ ### Fixed:
224
+ Readded and properly deprecated the `metadata` rake task. Use the `metadata_lint` task from metadata-json-lint directly instead.
225
+
226
+ ## [1.1.0] - 2016-02-25
227
+ ### Summary:
228
+ This release adds the ability to clone fixtures from git in parallel, speeding
229
+ up the spec\_prep rake task.
230
+
231
+ ### Added:
232
+ - Parallel fixtures cloning
233
+ - Various rake check tasks for module release preparation
234
+
235
+ ### Fixed:
236
+ - Added travis ci
237
+ - Added contributing doc
238
+ - Don't validate metadata if metadata-json-lint gem is not present
239
+
240
+ ## [1.0.1] - 2015-11-06
241
+ ### Summary:
242
+ This bugfix release fixes the Error vs. Errno bug in 1.0.0
243
+
244
+ ### Fixed:
245
+ - Raise `Errno::ENOENT` instead of `Error::ENOENT`
246
+
247
+ ## [1.0.0] - 2015-11-04
248
+ ### Summary:
249
+ The first 1.0 release, though the gem has been considered stable for a while.
250
+
251
+ ### Added:
252
+ - `flags` value for fixtures to allow passing CLI flags when installing modules
253
+ - `spec_standalone` rake task also runs `spec/types` specs
254
+ - Can now use `.fixtures.yaml` instead of `.fixtures.yml`
255
+
256
+ ### Fixed:
257
+ - Remove double-initialization that was conflicting with rspec-puppet
258
+ - Better error handling on malformed fixtures yaml
259
+ - Bug in rake task's ignore\_paths
260
+
261
+ ## [0.10.3] - 2015-05-11
262
+ ### Summary:
263
+ A bugfix for puppet 3 and puppet 4 tests being able to run with the same environment variables.
264
+
265
+ ### Fixed:
266
+ - Allow `STRINGIFY_FACTS` and `TRUSTED_NODE_DATA` to be set on Puppet 4 as noop instead of fail
267
+ - Fix linting to be more like approved module criteria
268
+
269
+ ## [0.10.2] - 2015-04-14
270
+ ### Summary:
271
+ A bugfix for puppet 4 coming out, which manages modulepath and environments differently.
272
+
273
+ ### Fixed:
274
+ - Use puppet 4 environmentpath and environment creation on puppet 4
275
+
276
+ ## [0.10.1] - 2015-03-17
277
+ ### Summary:
278
+ A bugfix for the previous release when using references.
279
+
280
+ ### Fixed:
281
+ - Only shallow clone if not using a reference
282
+
283
+ ## [0.10.0] - 2015-03-16
284
+ ### Summary:
285
+ This release adds shallow fixtures clones to speed up the spec_prep step for
286
+ rspec-puppet
287
+
288
+ ### Added:
289
+ - Shallow clone fixtures
290
+
291
+ ### Fixed:
292
+ - Don't lint in vendor/ (spec/fixtures/ and pkg/ are alread ignored)
293
+ - Don't syntax check in spec/fixtures/, pkg/, or vendor/
294
+
295
+ ## [0.9.1] - 2015-02-24
296
+ ### Summary:
297
+ This release removes the hard dependency on metadata-json-lint, as it requires
298
+ a dev toolchain to install the 'json' gem.
299
+
300
+ ### Fixed:
301
+ - Only warn when metadata-json-lint isn't installed instead of requiring it
302
+
303
+ ## [0.9.0] - 2015-02-24
304
+ ### Summary:
305
+ This release adds fixes for rspec-puppet 2.0 and json linting for metadata.json
306
+
307
+ ### Added:
308
+ - Add json linting for metadata.json (adds dep on metadata-json-lint gem)
309
+ - Document using references in fixtures
310
+
311
+ ### Fixed:
312
+ - `FUTURE_PARSER=yes` working with rspec-puppet 2.0
313
+ - Symlinks breaking on windows
314
+ - rspec as a runtime dependency conflicting with rspec-puppet
315
+ - root stub for testing execs
316
+
317
+ ## [0.8.2] - 2014-10-01
318
+ ### Summary:
319
+ This release fixes the lint task on the latest puppet-lint
320
+
321
+ ### Fixed:
322
+ - Fix the lint task require code
323
+
324
+ ## [0.8.1] - 2014-08-25
325
+ ### Summary:
326
+ This release corrects compatibility with the recently-released puppet-lint
327
+ 1.0.0
328
+
329
+ ### Fixed:
330
+ - Turn on relative autoloader lint checking for backwards-compatibility
331
+ - Turn off param class inheritance check (deprecated style)
332
+ - Fix ignore paths to ignore `pkg/*`
333
+
334
+ ## [0.8.0] - 2014-07-29
335
+ ### Summary:
336
+ This release uses the new puppet-syntax gem to perform manifest validation
337
+ better than before! Shiny.
338
+
339
+ ### Added:
340
+ - Use puppet-syntax gem for manifest validation rake task
341
+
342
+ ### Fixed:
343
+ - Fix compatibility with rspec 3
344
+
345
+ ## [0.7.0] - 2014-07-17
346
+ ### Summary:
347
+ This feature release adds the ability to test structured facts, manifest
348
+ ordering, and trusted node facts, and check out branches with fixtures.
349
+
350
+ ### Added:
351
+ - Add `STRINGIFY_FACTS=no` for structured facts
352
+ - Add `TRUSTED_NODE_DATA=yes` for trusted node data
353
+ - Add `ORDERING=<order>` for manifest ordering
354
+ - Add `:branch` support for fixtures on a branch.
355
+
356
+ ### Fixed:
357
+ - Fix puppet-lint to ignore spec/fixtures/
358
+
359
+ ## [0.6.0] - 2014-07-02
360
+ ### Summary:
361
+ This feature release adds the `validate` rake task and the ability to test
362
+ strict variables and the future parser with rspec-puppet.
363
+
364
+ ### Added:
365
+ - Add `validate` rake task.
366
+ - Add `STRICT_VARIABLES=yes` to module_spec_helper
367
+ - Add `FUTURE_PARSER=yes` to module_spec_helper
368
+
369
+ ### Fixed:
370
+ - Avoid conflict with Object.clone
371
+ - Install forge fixtures without conflicting with already-installed modules
372
+
373
+ ## [0.5.2] - 2014-06-19
374
+ ### Summary:
375
+ This release removes the previously non-existant puppet runtime dependency to
376
+ better match rspec-puppet and puppet-lint and allow system puppet packages to
377
+ be used instead of gems.
378
+
379
+ ### Fixed:
380
+ - Remove puppet dependency from gemspec
381
+
382
+ ## [0.5.1] - 2014-06-09
383
+ ### Summary:
384
+ This release re-adds mocha mocking, which was mistakenly removed in 0.5.0
385
+
386
+ ### Fixed:
387
+ - Re-enable mocha mocking as default.
388
+
389
+ ## [0.5.0] - 2014-06-06
390
+ ### Summary:
391
+ This is the first feature release in over a year. The biggest feature is fixtures supporting the forge, and not just github, plus rake tasks for syntax checking and beaker.
392
+
393
+ ### Added:
394
+ - Install modules from the forge, not just git
395
+ - Beaker rake tasks added
396
+ - Syntax task added
397
+ - Rake spec runs tests in `integration/` directory
398
+
399
+ ### Fixed:
400
+ - Fix the gemspec so that this may be used with bundler
401
+ - Fix removal of symlinks
402
+ - Fix removal of site.pp only when empty
403
+ - Ignore fixtures for linting
404
+ - Remove extra mocha dependency
405
+ - Remove rspec pinning (oops)
406
+
407
+ ## 0.4.2 - 2014-06-06 [YANKED]
408
+ ### Summary:
409
+ This release corrects the pinning of rspec for modules which are not rspec 3
410
+ compatible yet.
411
+
412
+ ### Fixed:
413
+ * Pin to 2.x range for rspec 2
414
+ * Fix aborting rake task when packaging gem
415
+ * Fix puppet issue tracker url
416
+ * Fix issue with running `git reset` in the incorrect dir
417
+
418
+ ## [0.4.1] - 2013-02-08
419
+ ### Fixed
420
+ * (#18165) Mark tests pending on broken puppet versions
421
+ * (#18165) Initialize TestHelper as soon as possible
422
+ * Maint: Change formatting and handle windows path separator
423
+
424
+ ## [0.4.0] - 2012-12-14
425
+ ### Added
426
+ * Add readme for fixtures
427
+ * add opts logic to rake spec_clean
428
+ * add backwards-compatible support for arbitrary git refs in .fixtures.yml
429
+
430
+ ### Fixed
431
+ * Rake should fail if git can't clone repository
432
+ * Fix Mocha deprecations
433
+ * Only remove the site.pp if it is empty
434
+ * (#15464) Make contributing easy via bundle Gemfile
435
+ * (#15464) Add gemspec from 0.3.0 published gem
436
+
437
+ ## [0.3.0] - 2012-08-14
438
+ ### Added
439
+ * Add PuppetInternals compatibility module for
440
+ scope, node, compiler, and functions
441
+ * Add rspec-puppet convention directories to rake tasks
442
+
443
+ ## [0.2.0] - 2012-07-05
444
+ ### Fixed
445
+ * Fix integration with mocha-0.12.0
446
+ * Fix coverage rake task
447
+ * Fix an issue creating the fixtures directory
448
+
449
+ ## 0.1.0 - 2012-06-08
450
+ ### Added
451
+ * Initial release
452
+
453
+ [unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.8.0...master
454
+ [2.8.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.7.0...v2.8.0
455
+ [2.7.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.2...v2.7.0
456
+ [2.6.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.6.1...v2.6.2
457
+ [2.6.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.5.1...v2.6.1
458
+ [2.5.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.5.0...v2.5.1
459
+ [2.5.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.4.0...v2.5.0
460
+ [2.4.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.2...v2.4.0
461
+ [2.3.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.1...v2.3.2
462
+ [2.3.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.3.0...v2.3.1
463
+ [2.3.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.2.0...v2.3.0
464
+ [2.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.5...v2.2.0
465
+ [2.1.5]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.4...v2.1.5
466
+ [2.1.4]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.3...v2.1.4
467
+ [2.1.3]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.2...v2.1.3
468
+ [2.1.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.1...v2.1.2
469
+ [2.1.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.0...v2.1.1
470
+ [2.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0.1...v2.1.0
471
+ [2.0.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0.0...v2.0.1
472
+ [2.0.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.2...v2.0.0
473
+ [1.2.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.1...v1.2.2
474
+ [1.2.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.2.0...v1.2.1
475
+ [1.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.1.1...1.2.0
476
+ [1.1.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.1.0...1.1.1
477
+ [1.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.0.1...1.1.0
478
+ [1.0.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.0.0...1.0.1
479
+ [1.0.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.10.3...1.0.0
480
+ [0.10.3]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.10.2...0.10.3
481
+ [0.10.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.10.1...0.10.2
482
+ [0.10.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.10.0...0.10.1
483
+ [0.10.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.9.1...0.10.0
484
+ [0.9.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.9.0...0.9.1
485
+ [0.9.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.8.2...0.9.0
486
+ [0.8.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.8.1...0.8.2
487
+ [0.8.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.8.0...0.8.1
488
+ [0.8.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.7.0...0.8.0
489
+ [0.7.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.6.0...0.7.0
490
+ [0.6.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.5.2...0.6.0
491
+ [0.5.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.5.1...0.5.2
492
+ [0.5.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.5.0...0.5.1
493
+ [0.5.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.4.1...0.5.0
494
+ [0.4.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.4.0...0.4.1
495
+ [0.4.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.3.0...0.4.0
496
+ [0.3.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.2.0...0.3.0
497
+ [0.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.1.0...0.2.0
498
+ [0.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/0.0.0...0.1.0
data/README.md CHANGED
@@ -79,8 +79,7 @@ And then to run spec tests in parallel:
79
79
  Issues
80
80
  ======
81
81
 
82
- Please file issues against this project at the [Puppet Labs Issue
83
- Tracker](https://tickets.puppetlabs.com/browse/MODULES)
82
+ Please file issues against this project at the [Puppet Labs Issue Tracker](https://tickets.puppetlabs.com/browse/MODULES)
84
83
 
85
84
  The Long Version
86
85
  ----------------
@@ -364,53 +363,20 @@ See the documentation of [RSpec-Puppet](https://github.com/rodjek/rspec-puppet)
364
363
  for Puppet manifest coverage reports.
365
364
 
366
365
  Starting with Ruby 1.9, the *de facto* standard for Ruby code coverage is
367
- [SimpleCov](https://github.com/colszowka/simplecov).
368
- You can add it to your module like this:
366
+ [SimpleCov](https://github.com/colszowka/simplecov). It is implemented as a Rake task in this gem.
369
367
 
370
- ```Ruby
371
- # First line of spec/spec_helper.rb
372
- require 'simplecov'
373
-
374
- SimpleCov.start do
375
- add_filter '/spec/'
376
- # Exclude bundled Gems in `/.vendor/`
377
- add_filter '/.vendor/'
378
- end
379
-
380
- require 'puppetlabs_spec_helper/module_spec_helper'
381
- # Further content
382
- ```
383
-
384
- The reports will then be generated every time you invoke RSpec, e.g. via `rake spec`,
385
- and are written to `/coverage/`, which you should add to `.gitignore`.
386
-
387
- Remember to add `gem 'simplecov', require: false` to your `Gemfile`.
368
+ To run code coverage:
388
369
 
389
- Using Code Climate
390
- ------------------
370
+ $ rake spec:simplecov
391
371
 
392
- You can also use [Code Climate](https://codeclimate.com/) together with SimpleCov:
372
+ Reports are written to `/coverage/`, which you should add to `.gitignore`.
393
373
 
394
- ```Ruby
395
- # First line of spec/spec_helper.rb
396
- require 'codeclimate-test-reporter'
397
-
398
- SimpleCov.formatters = [
399
- SimpleCov::Formatter::HTMLFormatter,
400
- CodeClimate::TestReporter::Formatter
401
- ]
374
+ The reports can be generated every time you invoke RSpec, e.g. via `rake spec`,
375
+ You can enable it, set the following environment variable:s
402
376
 
403
- SimpleCov.start do
404
- add_filter '/spec/'
405
- # Exclude bundled Gems in `/.vendor/`
406
- add_filter '/.vendor/'
407
- end
408
-
409
- require 'puppetlabs_spec_helper/module_spec_helper'
410
- # Further content
411
- ```
377
+ ``SIMPLECOV=yes``
412
378
 
413
- Remember to add `gem 'codeclimate-test-reporter', require: false` to your `Gemfile`.
379
+ Remember to add the simplecov-console and codecov gems to your `Gemfile`.
414
380
 
415
381
  Using Coveralls
416
382
  ---------------
data/Rakefile CHANGED
@@ -1,15 +1,45 @@
1
1
  # encoding: utf-8
2
- require "bundler/gem_tasks"
3
- require "rspec/core/rake_task"
4
2
 
5
- task :default => :spec
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ def gem_present(name)
7
+ !Bundler.rubygems.find_name(name).empty?
8
+ end
6
9
 
7
10
  RSpec::Core::RakeTask.new(:spec) do |spec|
8
11
  spec.pattern = FileList['spec/**/*_spec.rb'].exclude('spec/fixtures/**/*_spec.rb')
9
12
  end
10
13
 
11
- require 'rubocop/rake_task'
12
- RuboCop::RakeTask.new
13
-
14
14
  require 'yard'
15
15
  YARD::Rake::YardocTask.new
16
+
17
+ default_tasks = [:spec]
18
+
19
+ if gem_present 'rubocop'
20
+ require 'rubocop/rake_task'
21
+ RuboCop::RakeTask.new
22
+ default_tasks.unshift(:rubocop)
23
+ end
24
+
25
+ task default: default_tasks
26
+
27
+ #### CHANGELOG ####
28
+ begin
29
+ require 'github_changelog_generator/task'
30
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
31
+ require 'puppetlabs_spec_helper/version'
32
+ config.since_tag = 'v2.8.0'
33
+ config.future_release = "v#{PuppetlabsSpecHelper::VERSION}"
34
+ config.header = "# Changelog\n\n" \
35
+ "All significant changes to this repo will be summarized in this file.\n"
36
+ # config.include_labels = %w[enhancement bug]
37
+ config.user = 'puppetlabs'
38
+ config.project = 'puppetlabs_spec_helper'
39
+ end
40
+ rescue LoadError
41
+ desc 'Install github_changelog_generator to get access to automatic changelog generation'
42
+ task :changelog do
43
+ raise 'Install github_changelog_generator to get access to automatic changelog generation'
44
+ end
45
+ end
@@ -18,6 +18,37 @@ env_module_path = ENV['MODULEPATH']
18
18
  module_path = File.join(fixture_path, 'modules')
19
19
 
20
20
  module_path = [module_path, env_module_path].join(File::PATH_SEPARATOR) if env_module_path
21
+ if ENV['SIMPLECOV'] == 'yes'
22
+ begin
23
+ require 'simplecov'
24
+ require 'simplecov-console'
25
+ require 'codecov'
26
+
27
+ SimpleCov.formatters = [
28
+ SimpleCov::Formatter::HTMLFormatter,
29
+ SimpleCov::Formatter::Console,
30
+ SimpleCov::Formatter::Codecov,
31
+ ]
32
+ SimpleCov.start do
33
+ track_files 'lib/**/*.rb'
34
+ add_filter '/spec'
35
+
36
+ # do not track vendored files
37
+ add_filter '/vendor'
38
+ add_filter '/.vendor'
39
+
40
+ # do not track gitignored files
41
+ # this adds about 4 seconds to the coverage check
42
+ # this could definitely be optimized
43
+ add_filter do |f|
44
+ # system returns true if exit status is 0, which with git-check-ignore means file is ignored
45
+ system("git check-ignore --quiet #{f.filename}")
46
+ end
47
+ end
48
+ rescue LoadError
49
+ raise 'Add the simplecov, simplecov-console, codecov gems to Gemfile to enable this task'
50
+ end
51
+ end
21
52
 
22
53
  RSpec.configure do |c|
23
54
  c.environmentpath = spec_path if Puppet.version.to_f >= 4.0