puppet-debugger 0.10.3 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +16 -74
  3. data/.rubocop_todo.yml +59 -59
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +7 -0
  6. data/Gemfile +3 -2
  7. data/lib/plugins/puppet-debugger/input_responders/functions.rb +100 -1
  8. data/lib/puppet-debugger/cli.rb +1 -2
  9. data/lib/puppet-debugger/input_responder_plugin.rb +8 -1
  10. data/lib/puppet-debugger/support.rb +14 -2
  11. data/lib/puppet-debugger/version.rb +1 -1
  12. data/puppet-debugger.gemspec +2 -0
  13. data/spec/fixtures/modules/extlib/.editorconfig +14 -0
  14. data/spec/fixtures/modules/extlib/.fixtures.yml +3 -0
  15. data/spec/fixtures/modules/extlib/.github/CONTRIBUTING.md +184 -0
  16. data/spec/fixtures/modules/extlib/.github/ISSUE_TEMPLATE.md +26 -0
  17. data/spec/fixtures/modules/extlib/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  18. data/spec/fixtures/modules/extlib/.gitignore +21 -0
  19. data/spec/fixtures/modules/extlib/.msync.yml +1 -0
  20. data/spec/fixtures/modules/extlib/.overcommit.yml +64 -0
  21. data/spec/fixtures/modules/extlib/.pmtignore +21 -0
  22. data/spec/fixtures/modules/extlib/.rspec +2 -0
  23. data/spec/fixtures/modules/extlib/.rspec_parallel +1 -0
  24. data/spec/fixtures/modules/extlib/.rubocop.yml +545 -0
  25. data/spec/fixtures/modules/extlib/.sync.yml +12 -0
  26. data/spec/fixtures/modules/extlib/.travis.yml +47 -0
  27. data/spec/fixtures/modules/extlib/.yardopts +2 -0
  28. data/spec/fixtures/modules/extlib/Gemfile +82 -0
  29. data/spec/fixtures/modules/extlib/Rakefile +82 -0
  30. data/spec/fixtures/modules/extlib/functions/dir_split.pp +25 -0
  31. data/spec/fixtures/modules/extlib/functions/file_separator.pp +7 -0
  32. data/spec/fixtures/modules/extlib/functions/mkdir_p.pp +20 -0
  33. data/spec/fixtures/modules/extlib/functions/path_join.pp +29 -0
  34. data/spec/fixtures/modules/extlib/lib/puppet/functions/cache_data.rb +11 -0
  35. data/spec/fixtures/modules/extlib/lib/puppet/functions/default_content.rb +11 -0
  36. data/spec/fixtures/modules/extlib/lib/puppet/functions/dump_args.rb +11 -0
  37. data/spec/fixtures/modules/extlib/lib/puppet/functions/echo.rb +11 -0
  38. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/cache_data.rb +48 -0
  39. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/default_content.rb +37 -0
  40. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/dump_args.rb +20 -0
  41. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/echo.rb +45 -0
  42. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/has_module.rb +33 -0
  43. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/ip_to_cron.rb +39 -0
  44. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/random_password.rb +63 -0
  45. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/resources_deep_merge.rb +87 -0
  46. data/spec/fixtures/modules/extlib/lib/puppet/functions/extlib/sort_by_version.rb +15 -0
  47. data/spec/fixtures/modules/extlib/lib/puppet/functions/ip_to_cron.rb +11 -0
  48. data/spec/fixtures/modules/extlib/lib/puppet/functions/random_password.rb +11 -0
  49. data/spec/fixtures/modules/extlib/lib/puppet/functions/resources_deep_merge.rb +11 -0
  50. data/spec/fixtures/modules/extlib/metadata.json +66 -0
  51. data/spec/input_responder_plugin_spec.rb +1 -1
  52. data/spec/input_responders/functions_spec.rb +46 -1
  53. data/spec/spec_helper.rb +5 -5
  54. data/spec/support_spec.rb +0 -8
  55. metadata +69 -4
  56. data/lib/puppet-debugger/support/functions.rb +0 -72
@@ -0,0 +1,184 @@
1
+ This module has grown over time based on a range of contributions from
2
+ people using it. If you follow these contributing guidelines your patch
3
+ will likely make it into a release a little more quickly.
4
+
5
+ ## Contributing
6
+
7
+ Please note that this project is released with a Contributor Code of Conduct.
8
+ By participating in this project you agree to abide by its terms.
9
+ [Contributor Code of Conduct](https://voxpupuli.org/coc/).
10
+
11
+ 1. Fork the repo.
12
+
13
+ 1. Create a separate branch for your change.
14
+
15
+ 1. We only take pull requests with passing tests, and documentation. [travis-ci](http://travis-ci.org)
16
+ runs the tests for us. You can also execute them locally. This is explained
17
+ in a later section.
18
+
19
+ 1. Checkout [our docs](https://voxpupuli.org/docs/#reviewing-a-module-pr) we
20
+ use to review a module and the [official styleguide](https://puppet.com/docs/puppet/6.0/style_guide.html).
21
+ They provide some guidance for new code that might help you before you submit a pull request.
22
+
23
+ 1. Add a test for your change. Only refactoring and documentation
24
+ changes require no new tests. If you are adding functionality
25
+ or fixing a bug, please add a test.
26
+
27
+ 1. Squash your commits down into logical components. Make sure to rebase
28
+ against our current master.
29
+
30
+ 1. Push the branch to your fork and submit a pull request.
31
+
32
+ Please be prepared to repeat some of these steps as our contributors review
33
+ your code.
34
+
35
+ ## Dependencies
36
+
37
+ The testing and development tools have a bunch of dependencies,
38
+ all managed by [bundler](http://bundler.io/) according to the
39
+ [Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions).
40
+
41
+ By default the tests use a baseline version of Puppet.
42
+
43
+ If you have Ruby 2.x or want a specific version of Puppet,
44
+ you must set an environment variable such as:
45
+
46
+ ```sh
47
+ export PUPPET_VERSION="~> 5.5.6"
48
+ ```
49
+
50
+ You can install all needed gems for spec tests into the modules directory by
51
+ running:
52
+
53
+ ```sh
54
+ bundle install --path .vendor/ --without development system_tests release
55
+ ```
56
+
57
+ If you also want to run acceptance tests:
58
+
59
+ ```sh
60
+ bundle install --path .vendor/ --with system_tests --without development release
61
+ ```
62
+
63
+ Our all in one solution if you don't know if you need to install or update gems:
64
+
65
+ ```sh
66
+ bundle install --path .vendor/ --with system_tests --without development release; bundle update; bundle clean
67
+ ```
68
+
69
+ ## Syntax and style
70
+
71
+ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
72
+ [Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
73
+ check various syntax and style things. You can run these locally with:
74
+
75
+ ```sh
76
+ bundle exec rake lint
77
+ bundle exec rake validate
78
+ ```
79
+
80
+ It will also run some [Rubocop](http://batsov.com/rubocop/) tests
81
+ against it. You can run those locally ahead of time with:
82
+
83
+ ```sh
84
+ bundle exec rake rubocop
85
+ ```
86
+
87
+ ## Running the unit tests
88
+
89
+ The unit test suite covers most of the code, as mentioned above please
90
+ add tests if you're adding new functionality. If you've not used
91
+ [rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
92
+ about how best to test your new feature.
93
+
94
+ To run the linter, the syntax checker and the unit tests:
95
+
96
+ ```sh
97
+ bundle exec rake test
98
+ ```
99
+
100
+ To run your all the unit tests
101
+
102
+ ```sh
103
+ bundle exec rake spec
104
+ ```
105
+
106
+ To run a specific spec test set the `SPEC` variable:
107
+
108
+ ```sh
109
+ bundle exec rake spec SPEC=spec/foo_spec.rb
110
+ ```
111
+
112
+ ### Unit tests in docker
113
+
114
+ Some people don't want to run the dependencies locally or don't want to install
115
+ ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
116
+ You only need to run:
117
+
118
+ ```sh
119
+ docker build .
120
+ ```
121
+
122
+ Please ensure that a docker daemon is running and that your user has the
123
+ permission to talk to it. You can specify a remote docker host by setting the
124
+ `DOCKER_HOST` environment variable. it will copy the content of the module into
125
+ the docker image. So it will not work if a Gemfile.lock exists.
126
+
127
+ ## Integration tests
128
+
129
+ The unit tests just check the code runs, not that it does exactly what
130
+ we want on a real machine. For that we're using
131
+ [beaker](https://github.com/puppetlabs/beaker).
132
+
133
+ This fires up a new virtual machine (using vagrant) and runs a series of
134
+ simple tests against it after applying the module. You can run this
135
+ with:
136
+
137
+ ```sh
138
+ bundle exec rake acceptance
139
+ ```
140
+
141
+ This will run the tests on the module's default nodeset. You can override the
142
+ nodeset used, e.g.,
143
+
144
+ ```sh
145
+ BEAKER_set=centos-7-x64 bundle exec rake acceptance
146
+ ```
147
+
148
+ There are default rake tasks for the various acceptance test modules, e.g.,
149
+
150
+ ```sh
151
+ bundle exec rake beaker:centos-7-x64
152
+ bundle exec rake beaker:ssh:centos-7-x64
153
+ ```
154
+
155
+ If you don't want to have to recreate the virtual machine every time you can
156
+ use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will at
157
+ least need `BEAKER_provision` set to yes (the default). The Vagrantfile for the
158
+ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
159
+
160
+ Beaker also supports docker containers. We also use that in our automated CI
161
+ pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:
162
+
163
+ ```
164
+ PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
165
+ ```
166
+
167
+ You can replace the string `debian9` with any common operating system.
168
+ The following strings are known to work:
169
+
170
+ * ubuntu1604
171
+ * ubuntu1804
172
+ * debian8
173
+ * debian9
174
+ * centos6
175
+ * centos7
176
+
177
+ The easiest way to debug in a docker container is to open a shell:
178
+
179
+ ```sh
180
+ docker exec -it -u root ${container_id_or_name} bash
181
+ ```
182
+
183
+ The source of this file is in our [modulesync_config](https://github.com/voxpupuli/modulesync_config/blob/master/moduleroot/.github/CONTRIBUTING.md.erb)
184
+ repository.
@@ -0,0 +1,26 @@
1
+ <!--
2
+ Thank you for contributing to this project!
3
+
4
+ - This project has a Contributor Code of Conduct: https://voxpupuli.org/coc/
5
+ - Please check that here is no existing issue or PR that addresses your problem.
6
+ - Please fill the following form to enable us to help you.
7
+ - Our vulnerabilities reporting process is at https://voxpupuli.org/security/
8
+
9
+ -->
10
+
11
+ ## Affected Puppet, Ruby, OS and module versions/distributions
12
+
13
+ - Puppet:
14
+ - Ruby:
15
+ - Distribution:
16
+ - Module version:
17
+
18
+ ## How to reproduce (e.g Puppet code you use)
19
+
20
+ ## What are you seeing
21
+
22
+ ## What behaviour did you expect instead
23
+
24
+ ## Output log
25
+
26
+ ## Any additional information you'd like to impart
@@ -0,0 +1,20 @@
1
+ <!--
2
+ Thank you for contributing to this project!
3
+
4
+ - This project has a Contributor Code of Conduct: https://voxpupuli.org/coc/
5
+ - Please check that here is no existing issue or PR that addresses your problem.
6
+ - Our vulnerabilities reporting process is at https://voxpupuli.org/security/
7
+
8
+ -->
9
+ #### Pull Request (PR) description
10
+ <!--
11
+ Replace this comment with a description of your pull request.
12
+ -->
13
+
14
+ #### This Pull Request (PR) fixes the following issues
15
+ <!--
16
+ Replace this comment with the list of issues or n/a.
17
+ Use format:
18
+ Fixes #123
19
+ Fixes #124
20
+ -->
@@ -0,0 +1,21 @@
1
+ pkg/
2
+ Gemfile.lock
3
+ Gemfile.local
4
+ vendor/
5
+ .vendor/
6
+ spec/fixtures/manifests/
7
+ spec/fixtures/modules/
8
+ .vagrant/
9
+ .bundle/
10
+ .ruby-version
11
+ coverage/
12
+ log/
13
+ .idea/
14
+ .dependencies/
15
+ .librarian/
16
+ Puppetfile.lock
17
+ *.iml
18
+ .*.sw?
19
+ .yardoc/
20
+ Guardfile
21
+ spec/fixtures/tmpdir/
@@ -0,0 +1 @@
1
+ modulesync_config_version: '2.7.0'
@@ -0,0 +1,64 @@
1
+ # Managed by https://github.com/voxpupuli/modulesync_configs
2
+ #
3
+ # Hooks are only enabled if you take action.
4
+ #
5
+ # To enable the hooks run:
6
+ #
7
+ # ```
8
+ # bundle exec overcommit --install
9
+ # # ensure .overcommit.yml does not harm to you and then
10
+ # bundle exec overcommit --sign
11
+ # ```
12
+ #
13
+ # (it will manage the .git/hooks directory):
14
+ #
15
+ # Examples howto skip a test for a commit or push:
16
+ #
17
+ # ```
18
+ # SKIP=RuboCop git commit
19
+ # SKIP=PuppetLint git commit
20
+ # SKIP=RakeTask git push
21
+ # ```
22
+ #
23
+ # Don't invoke overcommit at all:
24
+ #
25
+ # ```
26
+ # OVERCOMMIT_DISABLE=1 git commit
27
+ # ```
28
+ #
29
+ # Read more about overcommit: https://github.com/brigade/overcommit
30
+ #
31
+ # To manage this config yourself in your module add
32
+ #
33
+ # ```
34
+ # .overcommit.yml:
35
+ # unmanaged: true
36
+ # ```
37
+ #
38
+ # to your modules .sync.yml config
39
+ ---
40
+ PreCommit:
41
+ RuboCop:
42
+ enabled: true
43
+ description: 'Runs rubocop on modified files only'
44
+ command: ['bundle', 'exec', 'rubocop']
45
+ PuppetLint:
46
+ enabled: true
47
+ description: 'Runs puppet-lint on modified files only'
48
+ command: ['bundle', 'exec', 'puppet-lint']
49
+ YamlSyntax:
50
+ enabled: true
51
+ JsonSyntax:
52
+ enabled: true
53
+ TrailingWhitespace:
54
+ enabled: true
55
+
56
+ PrePush:
57
+ RakeTarget:
58
+ enabled: true
59
+ description: 'Run rake targets'
60
+ targets:
61
+ - 'validate'
62
+ - 'test'
63
+ - 'rubocop'
64
+ command: [ 'bundle', 'exec', 'rake' ]
@@ -0,0 +1,21 @@
1
+ docs/
2
+ pkg/
3
+ Gemfile.lock
4
+ Gemfile.local
5
+ vendor/
6
+ .vendor/
7
+ spec/fixtures/manifests/
8
+ spec/fixtures/modules/
9
+ .vagrant/
10
+ .bundle/
11
+ .ruby-version
12
+ coverage/
13
+ log/
14
+ .idea/
15
+ .dependencies/
16
+ .librarian/
17
+ Puppetfile.lock
18
+ *.iml
19
+ .*.sw?
20
+ .yardoc/
21
+ Dockerfile
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1 @@
1
+ --format progress