puppetlabs_spec_helper 2.1.0 → 2.2.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 +53 -1
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +65 -23
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: feee2f3cf5d61beaccc0515e95befc300307a526
|
|
4
|
+
data.tar.gz: 4931b17333960330bf64c0e6d9d54242d873be49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ade464305fa7a9b1e237e0ecf379c23a2e27d38f963b7c7129432859c3b311f1a933a69a9624ba53e26cab68ec4d1461f888ddccd504a860889f450762fe94c
|
|
7
|
+
data.tar.gz: 63648ac51c6b670f3ad180b39ac6ce6fd7150b3457aa47faa555af86199ff806f5156354f7ec92c42a4f0997af2a8904b677ac939591b03791b472b34299fda6
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,51 @@
|
|
|
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.2.0]
|
|
6
|
+
### Summary
|
|
7
|
+
i18n rake task, and unbreak windows again.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- New rake task for i18n stuff.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fixture path calculation for windows
|
|
14
|
+
- Log to stderr instead of stdout as per rspec's spec
|
|
15
|
+
|
|
16
|
+
## [2.1.5]
|
|
17
|
+
### Summary:
|
|
18
|
+
Fix symlinks fixtures code.
|
|
19
|
+
|
|
20
|
+
## [2.1.4]
|
|
21
|
+
### Summary:
|
|
22
|
+
Better Windows support.
|
|
23
|
+
|
|
24
|
+
### Fixed:
|
|
25
|
+
- Create directory junctions instead of symlinks on windows (#192)
|
|
26
|
+
- Replace check:symlinks with platform independent alternative (#193)
|
|
27
|
+
|
|
28
|
+
## [2.1.3]
|
|
29
|
+
### Summary:
|
|
30
|
+
This release fixes puppet module install into paths with spaces, and fix conflicting build names for CI jobs.
|
|
31
|
+
|
|
32
|
+
### Fixed:
|
|
33
|
+
- Properly exscape paths for puppet module install
|
|
34
|
+
- Add "r" to the beginning of `rake compute_dev_version`
|
|
35
|
+
|
|
36
|
+
## [2.1.2]
|
|
37
|
+
### Summary:
|
|
38
|
+
The `release_tasks` now falls back to `spec` if the `parallel_spec` test fails due to the `parallel_tests` gem being absent.
|
|
39
|
+
|
|
40
|
+
### Fixed:
|
|
41
|
+
- Make `release_tasks` fall back to `spec` when missing the `parallel_tests` gem
|
|
42
|
+
|
|
43
|
+
## [2.1.1]
|
|
44
|
+
### Summary:
|
|
45
|
+
Bugfix for an unstated dependency on parallel\_spec that was added in 2.0.0
|
|
46
|
+
|
|
47
|
+
### Fixed:
|
|
48
|
+
- Add dependency for parallel\_spec, since psh requires it anyway.
|
|
49
|
+
|
|
5
50
|
## [2.1.0]
|
|
6
51
|
### Summary:
|
|
7
52
|
Minor version bump for new CI_SPEC_OPTIONS variable and bug fix.
|
|
@@ -316,7 +361,14 @@ compatible yet.
|
|
|
316
361
|
### Added
|
|
317
362
|
* Initial release
|
|
318
363
|
|
|
319
|
-
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0
|
|
364
|
+
[unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.2.0...master
|
|
365
|
+
[2.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.5...v2.2.0
|
|
366
|
+
[2.1.5]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.4...v2.1.5
|
|
367
|
+
[2.1.4]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.3...v2.1.4
|
|
368
|
+
[2.1.3]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.2...v2.1.3
|
|
369
|
+
[2.1.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.1...v2.1.2
|
|
370
|
+
[2.1.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.0...v2.1.1
|
|
371
|
+
[2.1.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0.1...v2.1.0
|
|
320
372
|
[2.0.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.0.0...v2.0.1
|
|
321
373
|
[2.0.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.2...v2.0.0
|
|
322
374
|
[1.2.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v1.2.1...v1.2.2
|
|
@@ -3,6 +3,7 @@ require 'rake'
|
|
|
3
3
|
require 'rspec/core/rake_task'
|
|
4
4
|
require 'tmpdir'
|
|
5
5
|
require 'yaml'
|
|
6
|
+
require 'pathname'
|
|
6
7
|
|
|
7
8
|
# optional gems
|
|
8
9
|
begin
|
|
@@ -94,7 +95,7 @@ def vagrant_ssh(set, node = nil)
|
|
|
94
95
|
end
|
|
95
96
|
|
|
96
97
|
def auto_symlink
|
|
97
|
-
{ Dir.pwd
|
|
98
|
+
{ File.basename(Dir.pwd).split('-').last => '#{source_dir}' }
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
def fixtures(category)
|
|
@@ -192,7 +193,7 @@ def logger
|
|
|
192
193
|
else
|
|
193
194
|
level = Logger::INFO
|
|
194
195
|
end
|
|
195
|
-
@logger = Logger.new(
|
|
196
|
+
@logger = Logger.new(STDERR)
|
|
196
197
|
@logger.level = level
|
|
197
198
|
end
|
|
198
199
|
@logger
|
|
@@ -240,11 +241,12 @@ task :spec_prep do
|
|
|
240
241
|
# Ruby only sets File::ALT_SEPARATOR on Windows and Rubys standard library
|
|
241
242
|
# uses this to check for Windows
|
|
242
243
|
is_windows = !!File::ALT_SEPARATOR
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
if is_windows
|
|
245
|
+
begin
|
|
246
|
+
require 'win32/dir'
|
|
247
|
+
rescue LoadError
|
|
248
|
+
$stderr.puts "win32-dir gem not installed, falling back to executing mklink directly"
|
|
249
|
+
end
|
|
248
250
|
end
|
|
249
251
|
|
|
250
252
|
# git has a race condition creating that directory, that would lead to aborted clone operations
|
|
@@ -281,12 +283,18 @@ task :spec_prep do
|
|
|
281
283
|
# wait for all the threads to finish
|
|
282
284
|
repositories.each {|remote, opts| opts[:thread].join }
|
|
283
285
|
|
|
284
|
-
fixtures("symlinks").each do |
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
fixtures("symlinks").each do |target, link|
|
|
287
|
+
unless File.symlink?(link)
|
|
288
|
+
logger.info("Creating symlink from #{link} to #{target}")
|
|
289
|
+
if is_windows
|
|
290
|
+
if Dir.respond_to?(:create_junction)
|
|
291
|
+
Dir.create_junction(link, target)
|
|
292
|
+
else
|
|
293
|
+
system("call mklink /J \"#{link.gsub('/', '\\')}\" \"#{target.gsub('/', '\\')}\"")
|
|
294
|
+
end
|
|
295
|
+
else
|
|
296
|
+
FileUtils::ln_sf(target, link)
|
|
297
|
+
end
|
|
290
298
|
end
|
|
291
299
|
end
|
|
292
300
|
|
|
@@ -308,11 +316,11 @@ task :spec_prep do
|
|
|
308
316
|
command = "puppet module install" + ref + flags + \
|
|
309
317
|
" --ignore-dependencies" \
|
|
310
318
|
" --force" \
|
|
311
|
-
" --module_working_dir #{working_dir}" \
|
|
312
|
-
" --target-dir #{target_dir} #{remote}"
|
|
319
|
+
" --module_working_dir \"#{working_dir}\"" \
|
|
320
|
+
" --target-dir \"#{target_dir}\" \"#{remote}\""
|
|
313
321
|
|
|
314
322
|
unless system(command)
|
|
315
|
-
fail "Failed to install module #{remote} to #{
|
|
323
|
+
fail "Failed to install module #{remote} to #{target_dir}"
|
|
316
324
|
end
|
|
317
325
|
end
|
|
318
326
|
|
|
@@ -371,7 +379,7 @@ task :parallel_spec do
|
|
|
371
379
|
ParallelTests::CLI.new.run(args)
|
|
372
380
|
Rake::Task[:spec_clean].invoke
|
|
373
381
|
rescue LoadError
|
|
374
|
-
|
|
382
|
+
raise 'Add the parallel_tests gem to Gemfile to enable this task'
|
|
375
383
|
end
|
|
376
384
|
end
|
|
377
385
|
|
|
@@ -500,10 +508,18 @@ task :compute_dev_version do
|
|
|
500
508
|
end
|
|
501
509
|
|
|
502
510
|
sha = `git rev-parse HEAD`[0..7]
|
|
511
|
+
branch = `git rev-parse --abbrev-ref HEAD`
|
|
503
512
|
|
|
504
513
|
# If we're in a CI environment include our build number
|
|
514
|
+
# If the branch is a release branch we append an 'r' into the new_version,
|
|
515
|
+
# this is due to the release branch buildID conflicting with master branch when trying to push to the staging forge.
|
|
516
|
+
# More info can be found at https://tickets.puppetlabs.com/browse/FM-6170
|
|
505
517
|
if build = ENV['BUILD_NUMBER'] || ENV['TRAVIS_BUILD_NUMBER']
|
|
506
|
-
|
|
518
|
+
if branch.eql? "release"
|
|
519
|
+
new_version = sprintf('%s-%s%04d-%s', version, "r", build, sha)
|
|
520
|
+
else
|
|
521
|
+
new_version = sprintf('%s-%04d-%s', version, build, sha)
|
|
522
|
+
end
|
|
507
523
|
else
|
|
508
524
|
new_version = "#{version}-#{sha}"
|
|
509
525
|
end
|
|
@@ -515,20 +531,39 @@ desc "Runs all necessary checks on a module in preparation for a release"
|
|
|
515
531
|
task :release_checks do
|
|
516
532
|
Rake::Task[:lint].invoke
|
|
517
533
|
Rake::Task[:validate].invoke
|
|
518
|
-
|
|
534
|
+
begin
|
|
535
|
+
Rake::Task[:parallel_spec].invoke
|
|
536
|
+
rescue RuntimeError
|
|
537
|
+
Rake::Task[:spec].invoke
|
|
538
|
+
end
|
|
519
539
|
Rake::Task["check:symlinks"].invoke
|
|
520
540
|
Rake::Task["check:test_file"].invoke
|
|
521
541
|
Rake::Task["check:dot_underscore"].invoke
|
|
522
542
|
Rake::Task["check:git_ignore"].invoke
|
|
523
543
|
end
|
|
524
544
|
|
|
545
|
+
def check_directory_for_symlinks(dir='.')
|
|
546
|
+
dir = Pathname.new(dir) unless dir.is_a?(Pathname)
|
|
547
|
+
results = []
|
|
548
|
+
|
|
549
|
+
dir.each_child(true) do |child|
|
|
550
|
+
if child.symlink?
|
|
551
|
+
results << child
|
|
552
|
+
elsif child.directory? && child.basename.to_s != '.git'
|
|
553
|
+
results.concat(check_directory_for_symlinks(child))
|
|
554
|
+
end
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
results
|
|
558
|
+
end
|
|
559
|
+
|
|
525
560
|
namespace :check do
|
|
526
561
|
desc "Fails if symlinks are present in directory"
|
|
527
562
|
task :symlinks do
|
|
528
|
-
|
|
529
|
-
unless
|
|
530
|
-
puts
|
|
531
|
-
fail "
|
|
563
|
+
symlinks = check_directory_for_symlinks
|
|
564
|
+
unless symlinks.empty?
|
|
565
|
+
symlinks.each { |r| puts "Symlink found: #{r.to_s} => #{r.readlink}" }
|
|
566
|
+
fail "Symlink(s) exist within this directory"
|
|
532
567
|
end
|
|
533
568
|
end
|
|
534
569
|
|
|
@@ -595,4 +630,11 @@ if File.exist? locales_dir
|
|
|
595
630
|
rescue Gem::LoadError
|
|
596
631
|
puts "No gettext-setup gem found, skipping gettext initialization" if Rake.verbose == true
|
|
597
632
|
end
|
|
633
|
+
namespace :module do
|
|
634
|
+
desc "Runs all tasks to build a modules POT file for internationalization"
|
|
635
|
+
task :pot_gen do
|
|
636
|
+
Rake::Task["gettext:pot"].invoke()
|
|
637
|
+
Rake::Task["gettext:metadata_pot"].invoke("#{module_dir}/metadata.json")
|
|
638
|
+
end
|
|
639
|
+
end
|
|
598
640
|
end
|
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: 2.
|
|
4
|
+
version: 2.2.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: 2017-
|
|
12
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mocha
|