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 +4 -4
 - data/README.md +1 -1
 - data/lib/onceover/octocatalog/diff/cli.rb +14 -3
 - data/lib/onceover/octocatalog/diff/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: c41d68499ea3cc7dbcb44bf646cf1da88e8677d9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9fd0f96f534bb43afb4cbca93c6d89b99740f4af
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 18ffdfb43aa9caa51945478e456ba5765f6e90c2d9bd698b6b295342407f718d875630e984123c10f723ff37d0fba4d94144a2f86b08242a5e83cce071d2b376
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8480b6c421b32fdbc9eeb0355b3f367dd840f51c89acd3901a9fb04de8b59b835273204993e5740cdf2ca8c8eb7cb891757c0018a21cd1d7db0677e3ad0d18db
         
     | 
    
        data/README.md
    CHANGED
    
    
| 
         @@ -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 
     | 
    
         
            -
                                     
     | 
| 
      
 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 
     | 
    
         |