puppetlabs_spec_helper 1.2.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -3
- data/README.md +3 -0
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +25 -5
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- data/puppetlabs_spec_helper.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d40eb48aae63d24394a645d4bf5d437db8097e79
|
4
|
+
data.tar.gz: e09d2f87d8f18eb5e0cd5e86b8160c0624176ce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a39cc71ee400db75509c38dc41bbeda0df3ab17cd4192ac82473a35aff91119fa74e893551c99ae6e19b7391da77f8e75b3aa0755ad2b2c0189d032ce670e1ed
|
7
|
+
data.tar.gz: 245f2b941cf6b373c8df8371e3f8213f8ce595b7b79ffdbb9e2398fe071c32efa76156d2fd7f0eb44b244bcc8170ecd2e9ece37b6d3320e3cc249607fa40989a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [2.0.0]
|
6
|
+
### Summary:
|
7
|
+
This release makes the module working dir configurable, adds features for future puppet features, and updates the spec rake task for TravisCI
|
8
|
+
|
9
|
+
### Changed:
|
10
|
+
- The `release_tasks` rake task now calls `parallel_spec` instead of `spec`
|
11
|
+
|
12
|
+
### Added:
|
13
|
+
- Make `module_working_dir` configurable
|
14
|
+
- Check `type_aliases` directory for spec tests
|
15
|
+
- Locales support for i18n
|
16
|
+
|
17
|
+
### Fixed:
|
18
|
+
- Ensure /-only used on windows
|
19
|
+
|
5
20
|
## [1.2.2]
|
6
21
|
### Summary:
|
7
22
|
|
@@ -280,9 +295,10 @@ compatible yet.
|
|
280
295
|
### Added
|
281
296
|
* Initial release
|
282
297
|
|
283
|
-
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/
|
284
|
-
[
|
285
|
-
[1.2.
|
298
|
+
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0.0...master
|
299
|
+
[2.0.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.2...v2.0.0
|
300
|
+
[1.2.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.1...v1.2.2
|
301
|
+
[1.2.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.2.0...v1.2.1
|
286
302
|
[1.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.1.1...1.2.0
|
287
303
|
[1.1.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.1.0...1.1.1
|
288
304
|
[1.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/1.0.1...1.1.0
|
data/README.md
CHANGED
@@ -199,6 +199,9 @@ Using Fixtures
|
|
199
199
|
`rake spec_prep` is run. To do so, all required modules should be listed in a
|
200
200
|
file named `.fixtures.yml` in the root of the project. You can specify a alternate location for that file in the `FIXTURES_YML` environment variable.
|
201
201
|
|
202
|
+
You can use the `MODULE_WORKING_DIR` environment variable to specify a diffent location when installing module fixtures via the forge. By default the
|
203
|
+
working directory is `<module directory>/spec/fixtures/work-dir`.
|
204
|
+
|
202
205
|
When specifying the repo source of the fixture you have a few options as to which revision of the codebase you wish to use.
|
203
206
|
|
204
207
|
* repo - the url to the repo
|
@@ -13,7 +13,17 @@ end
|
|
13
13
|
|
14
14
|
task :default => [:help]
|
15
15
|
|
16
|
-
pattern = 'spec/{aliases,classes,defines,unit,functions,hosts,integration,types}/**/*_spec.rb'
|
16
|
+
pattern = 'spec/{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types}/**/*_spec.rb'
|
17
|
+
|
18
|
+
spec = Gem::Specification.find_by_name 'gettext-setup'
|
19
|
+
load "#{spec.gem_dir}/lib/tasks/gettext.rake"
|
20
|
+
locales_dir = File.absolute_path('locales', File.dirname(__FILE__))
|
21
|
+
# Initialization requires a valid locales directory
|
22
|
+
if File.exist? locales_dir
|
23
|
+
GettextSetup.initialize(locales_dir)
|
24
|
+
else
|
25
|
+
puts "No 'locales' directory found in #{File.dirname(__FILE__)}, skipping gettext initialization"
|
26
|
+
end
|
17
27
|
|
18
28
|
desc "Run spec tests on an existing fixtures directory"
|
19
29
|
RSpec::Core::RakeTask.new(:spec_standalone) do |t|
|
@@ -195,6 +205,13 @@ def logger
|
|
195
205
|
@logger
|
196
206
|
end
|
197
207
|
|
208
|
+
def module_working_directory
|
209
|
+
# The problem with the relative path is that PMT doesn't expand the path properly and so passing in a relative path here
|
210
|
+
# becomes something like C:\somewhere\backslashes/spec/fixtures/work-dir on Windows, and then PMT barfs itself.
|
211
|
+
# This has been reported as https://tickets.puppetlabs.com/browse/PUP-4884
|
212
|
+
File.expand_path(ENV['MODULE_WORKING_DIR'] ? ENV['MODULE_WORKING_DIR'] : 'spec/fixtures/work-dir')
|
213
|
+
end
|
214
|
+
|
198
215
|
# returns the current thread count that is currently active
|
199
216
|
# a status of false or nil means the thread completed
|
200
217
|
# so when anything else we count that as a active thread
|
@@ -292,11 +309,14 @@ task :spec_prep do
|
|
292
309
|
end
|
293
310
|
next if File::exists?(target)
|
294
311
|
|
312
|
+
working_dir = module_working_directory
|
313
|
+
target_dir = File.expand_path('spec/fixtures/modules')
|
314
|
+
|
295
315
|
command = "puppet module install" + ref + flags + \
|
296
316
|
" --ignore-dependencies" \
|
297
317
|
" --force" \
|
298
|
-
" --module_working_dir
|
299
|
-
" --target-dir
|
318
|
+
" --module_working_dir #{working_dir}" \
|
319
|
+
" --target-dir #{target_dir} #{remote}"
|
300
320
|
|
301
321
|
unless system(command)
|
302
322
|
fail "Failed to install module #{remote} to #{target}"
|
@@ -327,7 +347,7 @@ task :spec_clean do
|
|
327
347
|
FileUtils::rm_rf(target)
|
328
348
|
end
|
329
349
|
|
330
|
-
FileUtils::rm_rf(
|
350
|
+
FileUtils::rm_rf(module_working_directory)
|
331
351
|
|
332
352
|
fixtures("symlinks").each do |source, target|
|
333
353
|
FileUtils::rm_f(target)
|
@@ -502,7 +522,7 @@ desc "Runs all necessary checks on a module in preparation for a release"
|
|
502
522
|
task :release_checks do
|
503
523
|
Rake::Task[:lint].invoke
|
504
524
|
Rake::Task[:validate].invoke
|
505
|
-
Rake::Task[:
|
525
|
+
Rake::Task[:parallel_spec].invoke
|
506
526
|
Rake::Task["check:symlinks"].invoke
|
507
527
|
Rake::Task["check:test_file"].invoke
|
508
528
|
Rake::Task["check:dot_underscore"].invoke
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetlabs_spec_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mocha
|
@@ -151,6 +151,20 @@ dependencies:
|
|
151
151
|
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: gettext-setup
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - "~>"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0.13'
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - "~>"
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0.13'
|
154
168
|
description: Contains rake tasks and a standard spec_helper for running spec tests
|
155
169
|
on puppet modules.
|
156
170
|
email:
|