pdqtest 0.1.15 → 0.1.16
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/README.md +13 -4
- data/lib/pdqtest/puppet.rb +8 -5
- data/lib/pdqtest/rspec.rb +15 -9
- data/lib/pdqtest/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a9a4b43ee5eaabaed3d6d613494db8bdd70af0d
|
4
|
+
data.tar.gz: fc93f6516cbdffab0fcb48aaf9fc52301d124a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f29cc8546375a72f0ca277541543e58ab840ec0d9f42581b645e55672c5bb24bfc072891318fc5a98bbd48ab0009c805d5740070777838b56ae47a91161b8eae
|
7
|
+
data.tar.gz: 96e10024b23b44f3f4ffe651b152a0eb71f3bd5f3d77d5074affa124ed2fa6e9ee26f952a2a1f8c331f086d5d22180f793dd0af69b7ec5855661006c3f614d15
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[](https://travis-ci.org/
|
1
|
+
[](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
|
-
|
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
|
-
|
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
|
-
|
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.
|
data/lib/pdqtest/puppet.rb
CHANGED
@@ -19,7 +19,7 @@ module PDQTest
|
|
19
19
|
CLASS_RE = /^class /
|
20
20
|
@@bats_executed = []
|
21
21
|
@@setup_executed = []
|
22
|
-
FIXTURES = '
|
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
|
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
|
-
|
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
|
-
|
13
|
-
|
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
|
-
|
16
|
-
status &= system("bundle exec #{extra_mod_install_cmd}")
|
25
|
+
status &= system("bundle exec rake spec")
|
17
26
|
end
|
18
|
-
|
19
|
-
|
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
|
data/lib/pdqtest/version.rb
CHANGED