onceover-octocatalog-diff 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 691c97a6f9063f49509f7c24f7e6a969ca77e59f
4
- data.tar.gz: 393491acfe7f393c47222b2b170cd2e92e01cee2
3
+ metadata.gz: c41d68499ea3cc7dbcb44bf646cf1da88e8677d9
4
+ data.tar.gz: 9fd0f96f534bb43afb4cbca93c6d89b99740f4af
5
5
  SHA512:
6
- metadata.gz: 33dee3aa8d06df1571bce554905711bd3c67109d4a5d6a8c417a362344078090396fa303b0484f3e70765151e092fa07ad0d259c67327f4ba1a076aff3511739
7
- data.tar.gz: 024e1ecb4bc1eaabd600e90b7749c12436b728ced60f98eb1ad970dcd29ab338b53f37b4308d33c57ce7f78dc9abf29082e239021e7eddc918576a28b977462c
6
+ metadata.gz: 18ffdfb43aa9caa51945478e456ba5765f6e90c2d9bd698b6b295342407f718d875630e984123c10f723ff37d0fba4d94144a2f86b08242a5e83cce071d2b376
7
+ data.tar.gz: 8480b6c421b32fdbc9eeb0355b3f367dd840f51c89acd3901a9fb04de8b59b835273204993e5740cdf2ca8c8eb7cb891757c0018a21cd1d7db0677e3ad0d18db
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- `onceover run diff`
25
+ `onceover run diff --from development --to production`
26
26
 
27
27
  All config follows the normal [onceover](https://github.com/dylanratcliffe/onceover) configuration.
28
28
 
@@ -25,13 +25,20 @@ revisions to compare between.
25
25
  repo = Onceover::Controlrepo.new(opts)
26
26
  test_config = Onceover::TestConfig.new(repo.onceover_yaml, opts)
27
27
  num_threads = (Facter.value('processors')['count'] / 2)
28
- #runner.prepare!
29
28
  tests = test_config.run_filters(Onceover::Test.deduplicate(test_config.spec_tests))
29
+
30
30
  @queue = tests.inject(Queue.new, :push)
31
31
  @results = []
32
32
 
33
33
  @threads = Array.new(num_threads) do
34
34
  Thread.new do
35
+ r10k_cache_dir = Dir.mktmpdir('r10k_cache')
36
+ r10k_config = {
37
+ 'cachedir' => r10k_cache_dir,
38
+ }
39
+ logger.debug "Creating r10k cache for thread at #{r10k_cache_dir}"
40
+ File.write("#{r10k_cache_dir}/r10k.yaml",r10k_config.to_yaml)
41
+
35
42
  until @queue.empty?
36
43
  test = @queue.shift
37
44
 
@@ -47,11 +54,13 @@ revisions to compare between.
47
54
  Onceover::Octocatalog::Diff.create_facts_yaml(repo,"#{tempdir}/spec/factsets")
48
55
 
49
56
  logger.info "Deploying Puppetfile for #{test.classes[0].name} on #{test.nodes[0].name}"
50
- r10k_cmd = "r10k puppetfile install --verbose --color --puppetfile #{repo.puppetfile}"
57
+ r10k_cmd = "r10k puppetfile install --verbose --color --puppetfile #{repo.puppetfile} --config #{r10k_cache_dir}/r10k.yaml"
51
58
  Open3.popen3(r10k_cmd) do |stdin, stdout, stderr, wait_thr|
52
59
  exit_status = wait_thr.value
53
60
  if exit_status.exitstatus != 0
54
- throw stderr
61
+ STDOUT.puts stdout.read
62
+ STDERR.puts stderr.read
63
+ abort "R10k encountered an error, see the logs for details"
55
64
  end
56
65
  end
57
66
 
@@ -82,6 +91,8 @@ revisions to compare between.
82
91
  logger.info "Storing results for #{test.classes[0].name} on #{test.nodes[0].name}"
83
92
  FileUtils.rm_r(tempdir)
84
93
  end
94
+
95
+ FileUtils.rm_r(r10k_cache_dir)
85
96
  end
86
97
  end
87
98
 
@@ -1,7 +1,7 @@
1
1
  class Onceover
2
2
  module Octocatalog
3
3
  module Diff
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onceover-octocatalog-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Ratcliffe