pdqtest 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0d353b261cba8bb08ccbb67f871cc2a813c9b37
4
- data.tar.gz: 6d4ed2b02bea498009f70d4b5dc4bb4f75257af5
3
+ metadata.gz: 0a9a4b43ee5eaabaed3d6d613494db8bdd70af0d
4
+ data.tar.gz: fc93f6516cbdffab0fcb48aaf9fc52301d124a91
5
5
  SHA512:
6
- metadata.gz: fd93da962bce72087e77321fa7871be381cc984bd3d1de09512c36b23a5ba42a348f29df5f8e1daeed9b18a130b0e905c756fe321e8ebb1223a488a64f83e7f2
7
- data.tar.gz: ead0de74af3969b5e968137bc678cbedd309b92cab154bbe838776e2e81608c2a9dcee2a4189c2e8939438ea18c21fca077d478e8f1aeed8c8ecbb9e4192ef49
6
+ metadata.gz: f29cc8546375a72f0ca277541543e58ab840ec0d9f42581b645e55672c5bb24bfc072891318fc5a98bbd48ab0009c805d5740070777838b56ae47a91161b8eae
7
+ data.tar.gz: 96e10024b23b44f3f4ffe651b152a0eb71f3bd5f3d77d5074affa124ed2fa6e9ee26f952a2a1f8c331f086d5d22180f793dd0af69b7ec5855661006c3f614d15
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/declarativesystems/pdqtest.svg?branch=master)](https://travis-ci.org/GeoffWilliams/pdqtest)
1
+ [![Build Status](https://travis-ci.org/declarativesystems/pdqtest.svg?branch=master)](https://travis-ci.org/declarativesystems/pdqtest)
2
2
 
3
3
  # PDQTest
4
4
 
@@ -45,9 +45,13 @@ bundle exec pdqtest setup
45
45
  This image is updated periodically, the above command will download the appropriate image for the version of `pdqtest` being used.
46
46
 
47
47
  ### Module dependencies/.fixtures.yml
48
- Ordinarily, there is no need to maintain a `.fixtures.yml` file. Dependencies on public forge modules should be specified in your module's `metadata.json` file.
48
+ There is no need to maintain a `.fixtures.yml` file and the presence of this file when using `pdqtest` is an error.
49
49
 
50
- If you need to download modules from git (eg those not available on forge.puppetlabs.com), then you must populate the `fixtures` section of `.fixtures.yml`, eg:
50
+ #### Public modules (PuppetForge)
51
+ Dependencies on public forge modules must be specified in your module's `metadata.json` file.
52
+
53
+ #### Private modules (from git)
54
+ If you need to download modules from git, then you must populate the `fixtures` section of `fixtures.yml`, eg:
51
55
 
52
56
  ```
53
57
  repositories:
@@ -56,7 +60,10 @@ repositories:
56
60
  ref: 'mybranch'
57
61
  ```
58
62
 
59
- Note that only the repositories section of the file will be processed as we do not use `puppetlabs_spec_helper` to do this for us.
63
+ ##### Notes:
64
+ * The filename is `fixtures.yml` NOT `.fixtures.yml`. The leading dot had to be removed to avoid `puppetlabs_spec_helper` also detecting the file and trying to use it.
65
+ * The file format of `.fixtures.yml` and `fixtures.yml` for specifing git repositories is identical
66
+ * Only the repositories section of the file will be processed as we do not use `puppetlabs_spec_helper` to do this for us.
60
67
 
61
68
  ### All tests
62
69
  If you just want to run all tests:
@@ -101,6 +108,8 @@ You should use pdqtest if you find it increases your productivity and enriches y
101
108
  ## Troubleshooting
102
109
  * If you can't find the `pdqtest` command and your using `rbenv` be sure to run `rbenv rehash` after installing the gem to create the necessary symlinks
103
110
  * Don't forget to run `pdqtest setup` before your first `pdqtest` run to download/update the Docker image
111
+ * If you need to access private git repositories, make sure to use `fixtures.yml` not `.fixtures.yml`
112
+ * If you need a private key to access private repositories, set this up for your regular git command/ssh and `pdqtest` will reuse the settings
104
113
 
105
114
  ## Support
106
115
  This software is not supported by Puppet, Inc. Use at your own risk.
@@ -19,7 +19,7 @@ module PDQTest
19
19
  CLASS_RE = /^class /
20
20
  @@bats_executed = []
21
21
  @@setup_executed = []
22
- FIXTURES = '.fixtures.yml'
22
+ FIXTURES = 'fixtures.yml'
23
23
 
24
24
  def self.reset_bats_executed
25
25
  @@bats_executed = []
@@ -93,7 +93,7 @@ module PDQTest
93
93
  examples
94
94
  end
95
95
 
96
- # process fixtures->repositories->* from .fixtures.yml if present to
96
+ # process fixtures->repositories->* from fixtures.yml if present to
97
97
  # generate an array of commands to run ON THE DOCKER VM to checkout the
98
98
  # required modules from git
99
99
  def self.git_fixtures()
@@ -102,14 +102,17 @@ module PDQTest
102
102
  fixtures = YAML.load_file(FIXTURES)
103
103
  if fixtures.has_key?('repositories')
104
104
  fixtures['repositories'].each { |fixture, opts|
105
+ target = "spec/fixtures/modules/#{fixture}"
105
106
  if opts.instance_of?(String)
106
107
  source = opts
107
- target = "spec/fixtures/modules/#{fixture}"
108
108
  ref = 'master'
109
109
  elsif opts.instance_of?(Hash)
110
- target = "spec/fixtures/modules/#{fixture}"
111
110
  source = opts['repo']
112
- ref = opts['ref']
111
+ if opts.has_key? 'ref'
112
+ ref = opts['ref']
113
+ else
114
+ ref = 'master'
115
+ end
113
116
  end
114
117
 
115
118
  refresh_cmd << "git_refresh refresh --target-dir #{target} --source-url #{source} --ref #{ref}"
data/lib/pdqtest/rspec.rb CHANGED
@@ -9,18 +9,24 @@ module PDQTest
9
9
  SPEC_CLASSES_DIR = "#{SPEC_DIR}/classes"
10
10
 
11
11
  def self.run
12
- status = system("bundle exec librarian-puppet install --path ./spec/fixtures/modules --destructive")
13
- PDQTest::Puppet.git_fixtures.each { |extra_mod_install_cmd|
12
+ cmd = "bundle exec librarian-puppet install --path ./spec/fixtures/modules --destructive"
13
+ status = system(cmd)
14
+ if status
15
+ PDQTest::Puppet.git_fixtures.each { |extra_mod_install_cmd|
16
+ if status
17
+ cmd = "bundle exec #{extra_mod_install_cmd}"
18
+ status &= system(cmd)
19
+ end
20
+ if ! status
21
+ Escort::Logger.error.error "Install git fixtures failed: #{cmd}"
22
+ end
23
+ }
14
24
  if status
15
- # fast-fail
16
- status &= system("bundle exec #{extra_mod_install_cmd}")
25
+ status &= system("bundle exec rake spec")
17
26
  end
18
- }
19
- if status
20
- # fail fast on test execution
21
- status &= system("bundle exec rake spec")
27
+ else
28
+ Escort::Logger.error.error "Librarian command failed: #{cmd}"
22
29
  end
23
-
24
30
  PDQTest::Emoji.partial_status(status, 'RSpec-Puppet')
25
31
  status
26
32
  end
@@ -1,3 +1,3 @@
1
1
  module PDQTest
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdqtest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams