pdqtest 1.9.9beta9 → 1.9.9beta10
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 -0
 - data/doc/inplace.md +28 -0
 - data/doc/pdk.md +2 -0
 - data/lib/pdqtest/inplace.rb +12 -8
 - data/lib/pdqtest/skeleton.rb +4 -0
 - data/lib/pdqtest/version.rb +1 -1
 - data/res/skeleton/appveyor.yml +19 -0
 - data/res/skeleton/bitbucket-pipelines.yml +1 -1
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f787c7d95a40dd0243e1a79bf35c50c6f35156114fa400d969e1482847918934
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 45a75d89287e99c6c4ba900ba535e14898cb3c1ba28575dbc5d19199e86bda95
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 46f4d91ffbed0f0e856bee1960a1f54044b956102b91136445941c36d51231e815794233e6d267ba3637a0ae32279c6155e5ac5991148b09e7ac71af8456dca8
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 534779666962526e7dbc29bf28eb39e22a4d8490bba9001da36a5aa156c36f6711db2c2db26603cf3239a5f982532cd09a024df0836421fb9470b5fcc56f0af4
         
     | 
    
        data/README.md
    CHANGED
    
    
    
        data/doc/inplace.md
    ADDED
    
    | 
         @@ -0,0 +1,28 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Inplace execution
         
     | 
| 
      
 2 
     | 
    
         
            +
            Sometimes you _must_ run PDQTest inplace, on the computer your running from. 
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            This is mostly useful for CI systems where running Docker-In-Docker is too
         
     | 
| 
      
 5 
     | 
    
         
            +
            slow/heavy.
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ## Warning
         
     | 
| 
      
 8 
     | 
    
         
            +
            **Do not run PDQTest inplace on a system you care about**
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            It will run puppet against it and likely destroy the system depending what your
         
     | 
| 
      
 11 
     | 
    
         
            +
            tests look like
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            ## Requirements
         
     | 
| 
      
 14 
     | 
    
         
            +
            The current system must have available in `PATH`:
         
     | 
| 
      
 15 
     | 
    
         
            +
            * Puppet
         
     | 
| 
      
 16 
     | 
    
         
            +
            * BATS (Linux) or PATS (Windows)
         
     | 
| 
      
 17 
     | 
    
         
            +
            * PDK
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            ## Activation
         
     | 
| 
      
 20 
     | 
    
         
            +
            You have to run PDQTest with the options `--inplace --inplace-enable` to 
         
     | 
| 
      
 21 
     | 
    
         
            +
            activate inplace alteration. This is normally done from CI integration files.
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ## Problems in-place execution solves
         
     | 
| 
      
 24 
     | 
    
         
            +
            * Acceptance testing on Bitbucket Pipelines.
         
     | 
| 
      
 25 
     | 
    
         
            +
            * Acceptance testing Windows on Appveyor
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            ## Example project
         
     | 
| 
      
 28 
     | 
    
         
            +
            https://bitbucket.org/geoffwilliams_pp/test
         
     | 
    
        data/doc/pdk.md
    CHANGED
    
    | 
         @@ -138,6 +138,7 @@ or supported. 
     | 
|
| 
       138 
138 
     | 
    
         
             
            * ⚡ - File updated/replaced when you run `pdqtest upgrade`:
         
     | 
| 
       139 
139 
     | 
    
         | 
| 
       140 
140 
     | 
    
         
             
            ```
         
     | 
| 
      
 141 
     | 
    
         
            +
            ├── appveyor.yml ⚡
         
     | 
| 
       141 
142 
     | 
    
         
             
            ├── bitbucket-pipelines.yml ⚡
         
     | 
| 
       142 
143 
     | 
    
         
             
            ├── Gemfile 🛠
         
     | 
| 
       143 
144 
     | 
    
         
             
            ├── Gemfile.local
         
     | 
| 
         @@ -163,6 +164,7 @@ or supported. 
     | 
|
| 
       163 
164 
     | 
    
         
             
            ```
         
     | 
| 
       164 
165 
     | 
    
         | 
| 
       165 
166 
     | 
    
         
             
            Notes:
         
     | 
| 
      
 167 
     | 
    
         
            +
            * `appveyor.yml` - Complete test suite for Windows modules
         
     | 
| 
       166 
168 
     | 
    
         
             
            * `.travis.yml` - Complete test suite for Linux modules
         
     | 
| 
       167 
169 
     | 
    
         
             
            * `bitbucket-pipelines.yaml` - logical testing only (unit/RSpec) 
         
     | 
| 
       168 
170 
     | 
    
         
             
            * `.puppet-lint.rc` - Make lint errors test failures, ignore double quotes, etc
         
     | 
    
        data/lib/pdqtest/inplace.rb
    CHANGED
    
    | 
         @@ -27,12 +27,16 @@ module PDQTest 
     | 
|
| 
       27 
27 
     | 
    
         
             
                  $logger.debug("exec_real: running inplace command: #{real_c}")
         
     | 
| 
       28 
28 
     | 
    
         
             
                  if @@enable
         
     | 
| 
       29 
29 
     | 
    
         
             
                    # must splat to avoid "wrong first argument"
         
     | 
| 
       30 
     | 
    
         
            -
                    Open3.popen3(*real_c) do |stdin, stdout, stderr, wait_thr|
         
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                    end
         
     | 
| 
      
 30 
     | 
    
         
            +
                    # Open3.popen3(*real_c) do |stdin, stdout, stderr, wait_thr|
         
     | 
| 
      
 31 
     | 
    
         
            +
                    #   res[:OUT] = stdout.read.split("\n")
         
     | 
| 
      
 32 
     | 
    
         
            +
                    #   res[:ERR] = stderr.read.split("\n")
         
     | 
| 
      
 33 
     | 
    
         
            +
                    #   # Process::Status object returned from `.value`
         
     | 
| 
      
 34 
     | 
    
         
            +
                    #   res[:STATUS] = wait_thr.value.exitstatus
         
     | 
| 
      
 35 
     | 
    
         
            +
                    # end
         
     | 
| 
      
 36 
     | 
    
         
            +
                    stdout, stderr, status = Open3.capture3(*real_c)
         
     | 
| 
      
 37 
     | 
    
         
            +
                    res[:OUT] = stdout.split("\n")
         
     | 
| 
      
 38 
     | 
    
         
            +
                    res[:ERR] = stderr.split("\n")
         
     | 
| 
      
 39 
     | 
    
         
            +
                    res[:STATUS] = status.exitstatus
         
     | 
| 
       36 
40 
     | 
    
         
             
                  else
         
     | 
| 
       37 
41 
     | 
    
         
             
                    $logger.info "didn't run command, reason: DISABLED"
         
     | 
| 
       38 
42 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -46,13 +50,13 @@ module PDQTest 
     | 
|
| 
       46 
50 
     | 
    
         
             
                end
         
     | 
| 
       47 
51 
     | 
    
         | 
| 
       48 
52 
     | 
    
         
             
                def self.new_container(image_name, privileged)
         
     | 
| 
       49 
     | 
    
         
            -
                  FileUtils. 
     | 
| 
      
 53 
     | 
    
         
            +
                  FileUtils.rm_rf Docker.test_dir if Dir.exist? Docker.test_dir
         
     | 
| 
       50 
54 
     | 
    
         | 
| 
       51 
55 
     | 
    
         
             
                  FileUtils.cp_r(File.join(Dir.pwd, "."), Docker.test_dir)
         
     | 
| 
       52 
56 
     | 
    
         
             
                end
         
     | 
| 
       53 
57 
     | 
    
         | 
| 
       54 
58 
     | 
    
         
             
                def self.cleanup_container(container)
         
     | 
| 
       55 
     | 
    
         
            -
                  FileUtils. 
     | 
| 
      
 59 
     | 
    
         
            +
                  FileUtils.rm_rf Docker.test_dir
         
     | 
| 
       56 
60 
     | 
    
         
             
                end
         
     | 
| 
       57 
61 
     | 
    
         
             
              end
         
     | 
| 
       58 
62 
     | 
    
         
             
            end
         
     | 
    
        data/lib/pdqtest/skeleton.rb
    CHANGED
    
    | 
         @@ -42,6 +42,9 @@ module PDQTest 
     | 
|
| 
       42 
42 
     | 
    
         
             
                    "bitbucket-pipelines.yml" => {
         
     | 
| 
       43 
43 
     | 
    
         
             
                        "unmanaged" => true,
         
     | 
| 
       44 
44 
     | 
    
         
             
                    },
         
     | 
| 
      
 45 
     | 
    
         
            +
                    "appveyor.yml" => {
         
     | 
| 
      
 46 
     | 
    
         
            +
                        "unmanaged" => true,
         
     | 
| 
      
 47 
     | 
    
         
            +
                    },
         
     | 
| 
       45 
48 
     | 
    
         
             
                    ".gitignore" => {
         
     | 
| 
       46 
49 
     | 
    
         
             
                        "paths" => [
         
     | 
| 
       47 
50 
     | 
    
         
             
                            ".Puppetfile.pdqtest",
         
     | 
| 
         @@ -135,6 +138,7 @@ module PDQTest 
     | 
|
| 
       135 
138 
     | 
    
         
             
                  install_skeleton('make.ps1', 'make.ps1')
         
     | 
| 
       136 
139 
     | 
    
         
             
                  install_skeleton('bitbucket-pipelines.yml', 'bitbucket-pipelines.yml')
         
     | 
| 
       137 
140 
     | 
    
         
             
                  install_skeleton('.travis.yml', '.travis.yml')
         
     | 
| 
      
 141 
     | 
    
         
            +
                  install_skeleton('appveyor.yml', 'appveyor.yml')
         
     | 
| 
       138 
142 
     | 
    
         
             
                  Pdk.amend_sync_yml(SYNC_YML_CONTENT)
         
     | 
| 
       139 
143 
     | 
    
         
             
                end
         
     | 
| 
       140 
144 
     | 
    
         | 
    
        data/lib/pdqtest/version.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # appveyor.yml
         
     | 
| 
      
 2 
     | 
    
         
            +
            ---
         
     | 
| 
      
 3 
     | 
    
         
            +
            image: "Visual Studio 2017"
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            install:
         
     | 
| 
      
 6 
     | 
    
         
            +
              - "cinst ruby --version 2.4.3.1"
         
     | 
| 
      
 7 
     | 
    
         
            +
              - "cinst pdk"
         
     | 
| 
      
 8 
     | 
    
         
            +
              - set PATH=C:\tools\ruby24\bin;c:\pats\;%PATH%
         
     | 
| 
      
 9 
     | 
    
         
            +
              - "gem install bundler"
         
     | 
| 
      
 10 
     | 
    
         
            +
              - "ruby --version"
         
     | 
| 
      
 11 
     | 
    
         
            +
              - "gem --version"
         
     | 
| 
      
 12 
     | 
    
         
            +
              - git clone https://github.com/GeoffWilliams/pats c:\pats
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            build_script:
         
     | 
| 
      
 15 
     | 
    
         
            +
              - "gem install bundler"
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            test_script:
         
     | 
| 
      
 18 
     | 
    
         
            +
              - ps: ./make.ps1 pdqtestbundle
         
     | 
| 
      
 19 
     | 
    
         
            +
              - cd .pdqtest && bundle exec pdqtest --inplace --inplace-enable all
         
     | 
    
        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.9. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.9.9beta10
         
     | 
| 
       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-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-10-02 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -189,6 +189,7 @@ files: 
     | 
|
| 
       189 
189 
     | 
    
         
             
            - doc/enabling_testing.md
         
     | 
| 
       190 
190 
     | 
    
         
             
            - doc/examples.md
         
     | 
| 
       191 
191 
     | 
    
         
             
            - doc/hiera.md
         
     | 
| 
      
 192 
     | 
    
         
            +
            - doc/inplace.md
         
     | 
| 
       192 
193 
     | 
    
         
             
            - doc/installation.md
         
     | 
| 
       193 
194 
     | 
    
         
             
            - doc/pdk.md
         
     | 
| 
       194 
195 
     | 
    
         
             
            - doc/puppet_facts.md
         
     | 
| 
         @@ -231,6 +232,7 @@ files: 
     | 
|
| 
       231 
232 
     | 
    
         
             
            - res/skeleton/.puppet-lint.rc
         
     | 
| 
       232 
233 
     | 
    
         
             
            - res/skeleton/.travis.yml
         
     | 
| 
       233 
234 
     | 
    
         
             
            - res/skeleton/Makefile
         
     | 
| 
      
 235 
     | 
    
         
            +
            - res/skeleton/appveyor.yml
         
     | 
| 
       234 
236 
     | 
    
         
             
            - res/skeleton/bitbucket-pipelines.yml
         
     | 
| 
       235 
237 
     | 
    
         
             
            - res/skeleton/make.ps1
         
     | 
| 
       236 
238 
     | 
    
         
             
            - res/skeleton/spec/fixtures/hiera.yaml
         
     |