pdqtest 1.2.1 → 1.3.0

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
  SHA256:
3
- metadata.gz: 7c5355775775a0badae1b521e35cae0a72ee7fd1b88f4f30d8c3490255f5ed1b
4
- data.tar.gz: 05c379330825b777cbce9428acdc178380786dc4e919166d55be46ea05fcb7a9
3
+ metadata.gz: 41b30099aa248eb077c002ae3ec69672302aff7c5f3839fdc5b768f7da6fd508
4
+ data.tar.gz: 9f6cba5c988c6404942826277ad2a985cadc3d5dc77c8309aab0a80f1cca5f88
5
5
  SHA512:
6
- metadata.gz: 468175c2a3cfc156b3772f9e6601c981f155a2780c74dadee047878b0b0182f961e3e028fa8a5aae83a7d39ab31ff523a43c814dd2948d3cb48250b410187e1f
7
- data.tar.gz: be15594560c112c1cc816d2c25bd2ddcca0b8441d7e6ea3c4981bf34e69db9fcaf1789218f1eeb224d7a4ed453855907f2fb94c9d28bf57dd33fb14463bc2229
6
+ metadata.gz: 075d97a8ebd8a60fed4567e75781e460cedf8b1d2d5d90f4cf9249a2c9298bc5d6f83d8591e36efdcdd4a8681f4ef147d1687958033b250055eec83ed8da1fbc
7
+ data.tar.gz: eec8e5d7690e5d9c649f924f4184feb0ab4aa98e713a19691f5ac2a82b1d006df84d4f4497cb37b29c355d4640d0145d639520a044c986aa4eee2786a1e6de77
data/doc/caching.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Caching
2
2
  PDQTest will attempt to cache:
3
- * Puppet modules (via librarian-puppet) in `~/.pdqtest/cache/modules`
3
+ * Puppet modules (via r10k) in `~/.r10k/cache`
4
4
  * The yum cache in `~/.pdqtest/cache/yum`
5
5
 
6
6
  Note that since the yum cache is writen to via a docker volume from the container your running tests in, the files in this directory will be root owned. If you need to clear your cache for whatever reason, delete the `~/.pdqtest/cache` directory (you will likely need `sudo`) and PDQtest will recreate it next time it runs.
@@ -24,4 +24,6 @@ There is no need to maintain a `.fixtures.yml` file and the presence of this fil
24
24
  * The filename is for private modules 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.
25
25
  * The file format of `.fixtures.yml` and `fixtures.yml` for specifing git repositories is identical
26
26
  * Only the repositories section of the file will be processed as we do not use `puppetlabs_spec_helper` to do this for us.
27
- * We convert the dependencies from `metadata.json` to a temporary puppetfile store at `.Puppetfile.pdqtes` which is then installed using r10k
27
+ * We convert the dependencies from `metadata.json` to a temporary puppetfile store at `.Puppetfile.pdqtest` which is then installed using r10k
28
+ * Previous versions of pdqtest configured the r10k cache via `.r10k.yaml` which caused #44. To fix this, we now use the default r10k cache dir at ~/.r10k/cache and don't write
29
+ `.r10k.yaml` any more. You should remove any `.r10k.yaml` files from your project unless you need it for something specific.
@@ -15,7 +15,7 @@ module PDQTest
15
15
  HIERA_YAML_HOST = '/spec/fixtures/hiera.yaml'
16
16
  HIERA_DIR = '/spec/fixtures/hieradata'
17
17
  YUM_CACHE_CONTAINER = "/var/cache/yum"
18
- YUM_CACHE_HOST = "#{Util::app_dir}/cache/yum"
18
+ YUM_CACHE_HOST = "#{Util::app_dir_expanded}/cache/yum"
19
19
 
20
20
  def self.wrap_cmd(cmd)
21
21
  ['bash', '-c', "#{ENV} #{cmd}"]
@@ -149,7 +149,7 @@ module PDQTest
149
149
  exec_out(res).each { |l|
150
150
  # Output comes back as an array and needs to be iterated or we lose our
151
151
  # ansi formatting
152
- Escort::Logger.output.puts l
152
+ Escort::Logger.output << l
153
153
  }
154
154
  end
155
155
 
@@ -162,7 +162,7 @@ module PDQTest
162
162
  exec_err(res).each { |l|
163
163
  # Output comes back as an array and needs to be iterated or we lose our
164
164
  # ansi formatting
165
- Escort::Logger.error.error l
165
+ Escort::Logger.error << l
166
166
  }
167
167
  end
168
168
 
@@ -342,9 +342,13 @@ module PDQTest
342
342
 
343
343
  PDQTest::Emoji.emoji_message("🐌", "I'm downloading The Internet, please hold...")
344
344
 
345
- cmd = "bundle exec r10k puppetfile install --verbose --moduledir ./spec/fixtures/modules --config .r10k.yaml --puppetfile #{TMP_PUPPETFILE}"
345
+ cmd = "bundle exec r10k puppetfile install --verbose --moduledir ./spec/fixtures/modules --puppetfile #{TMP_PUPPETFILE}"
346
346
  status = system(cmd)
347
347
 
348
+ if ! status
349
+ Escort::Logger.error.error "Failed to run the R10K command: #{cmd}"
350
+ end
351
+
348
352
  status
349
353
  end
350
354
  end
data/lib/pdqtest/rspec.rb CHANGED
@@ -12,7 +12,7 @@ module PDQTest
12
12
  module Rspec
13
13
  SPEC_DIR = './spec'
14
14
  SPEC_CLASSES_DIR = "#{SPEC_DIR}/classes"
15
- MODULE_CACHE_DIR = "#{Util::app_dir}/cache/modules"
15
+ MODULE_CACHE_DIR = "#{Util::app_dir_expanded}/cache/modules"
16
16
 
17
17
 
18
18
  def self.run
@@ -35,8 +35,6 @@ module PDQTest
35
35
  if status
36
36
  status &= system("bundle exec rake spec")
37
37
  end
38
- else
39
- Escort::Logger.error.error "Librarian command failed: #{cmd}"
40
38
  end
41
39
  PDQTest::Emoji.partial_status(status, 'RSpec-Puppet')
42
40
  status
@@ -91,7 +91,6 @@ module PDQTest
91
91
  install_skeleton('Makefile', 'Makefile')
92
92
  install_skeleton('bitbucket-pipelines.yml', 'bitbucket-pipelines.yml')
93
93
  install_skeleton('.travis.yml', 'dot_travis.yml')
94
- install_template('.r10k.yaml', 'r10k.yaml.erb', {})
95
94
  end
96
95
 
97
96
  def self.install_acceptance(example_file ="init.pp")
data/lib/pdqtest/util.rb CHANGED
@@ -1,11 +1,16 @@
1
1
  module PDQTest
2
2
  module Util
3
+
3
4
  def self.resource_path(resource)
4
5
  File.join(File.dirname(File.expand_path(__FILE__)), "../../res/#{resource}")
5
6
  end
6
7
 
7
8
  def self.app_dir
8
- "#{Dir.home}/.pdqtest"
9
+ ".pdqtest"
10
+ end
11
+
12
+ def self.app_dir_expanded
13
+ File.join(Dir.home, app_dir)
9
14
  end
10
15
  end
11
16
  end
@@ -1,4 +1,4 @@
1
1
  module PDQTest
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  PUPPET_VERSION = "5.3.5"
4
4
  end
@@ -1,6 +1,6 @@
1
1
  all:
2
2
  bundle exec pdqtest all
3
- bundle exec puppet strings
3
+ bundle exec puppet strings generate --format=markdown
4
4
 
5
5
  shell:
6
6
  bundle exec pdqtest --keep-container acceptance
@@ -5,4 +5,5 @@ Puppetfile.lock
5
5
  .tmp
6
6
  .yardoc
7
7
  /pkg
8
- .Puppetfile.pdqtest
8
+ .Puppetfile.pdqtest
9
+ .idea
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdqtest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-04 00:00:00.000000000 Z
11
+ date: 2018-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -314,7 +314,6 @@ files:
314
314
  - res/skeleton/spec_helper.rb
315
315
  - res/skeleton/test.yaml
316
316
  - res/templates/examples_init.pp.erb
317
- - res/templates/r10k.yaml.erb
318
317
  - res/templates/rspec.rb.erb
319
318
  homepage: https://github.com/GeoffWilliams/pdqtest
320
319
  licenses:
@@ -1,3 +0,0 @@
1
- ---
2
- :cachedir: <%= PDQTest::Util::app_dir %>/cache/modules
3
-