Automate creation and maintenance of complete fact sets for rspec-puppet tests
Перейти к файлу
dependabot[bot] 500771ba80
Bump pry from 0.14.2 to 0.15.0 in the bundler-dev group
Bumps the bundler-dev group with 1 update: [pry](https://github.com/pry/pry).


Updates `pry` from 0.14.2 to 0.15.0
- [Release notes](https://github.com/pry/pry/releases)
- [Changelog](https://github.com/pry/pry/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pry/pry/compare/v0.14.2...v0.15.0)

---
updated-dependencies:
- dependency-name: pry
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: bundler-dev
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 17:41:08 +00:00
.github Bump the github-actions group with 2 updates 2024-09-09 17:56:42 +00:00
bin adding many more syntax fixes 2023-12-08 10:41:32 -08:00
contrib/plugins Initial public release 2017-10-06 08:15:17 -05:00
doc Missing commit incl gems and fixes to gem build/release 2024-08-14 02:23:28 +00:00
examples Add note on ENC and example configuration in quickstart.yaml 2017-10-07 09:00:00 -05:00
lib Fix nodes accessor 2024-01-22 14:33:44 -08:00
rake Missing commit incl gems and fixes to gem build/release 2024-08-14 02:23:28 +00:00
script avoid deprecation warnings 2024-08-13 14:23:27 +00:00
spec Missing commit incl gems and fixes to gem build/release 2024-08-14 02:23:28 +00:00
vendor/cache Bump pry from 0.14.2 to 0.15.0 in the bundler-dev group 2024-11-18 17:41:08 +00:00
.gitignore creating 0.6.1 release 2024-09-13 11:38:31 -07:00
.rubocop.yml Initial commit 2024-03-22 13:49:32 -07:00
.ruby-version Initial commit 2024-03-22 13:49:32 -07:00
.version creating 0.6.1 release 2024-09-13 11:38:31 -07:00
CODE_OF_CONDUCT.md Initial public release 2017-10-06 08:15:17 -05:00
CONTRIBUTING.md Initial public release 2017-10-06 08:15:17 -05:00
Gemfile Bump pry from 0.14.2 to 0.15.0 in the bundler-dev group 2024-11-18 17:41:08 +00:00
Gemfile.lock Bump pry from 0.14.2 to 0.15.0 in the bundler-dev group 2024-11-18 17:41:08 +00:00
LICENSE Initial public release 2017-10-06 08:15:17 -05:00
README.md Initial public release 2017-10-06 08:15:17 -05:00
Rakefile Make rubocop happy 2024-01-22 13:12:36 -08:00
octofacts-updater.gemspec raise ruby floor for compatibility 2024-08-13 08:41:02 -05:00
octofacts.gemspec raise ruby floor for compatibility 2024-08-13 08:41:02 -05:00

README.md

octofacts

octofacts is a tool that enables Puppet developers to provide complete sets of facts for rspec-puppet tests. It works by saving facts from actual hosts as fixture files, and then presenting a straightforward programming interface to select and manipulate those facts within tests. Using nearly real-life facts is a good way to ensure that rspec-puppet tests match production as closely as possible.

octofacts is actively used in production at GitHub. This project is actively maintained by the original authors and the rest of the Site Reliability Engineering team at GitHub.

Overview

The octofacts project is distributed with two components:

  • The octofacts gem is called within your rspec-puppet tests, to provide facts from indexed fact fixture files in your repository. This allows you to replace a hard-coded let (:facts) { ... } hash with more realistic facts from recent production runs.

  • The octofacts-updater gem is a utility to maintain the indexed fact fixture files consumed by octofacts. It pulls facts from a data source (e.g. PuppetDB, fact caches, or SSH), indexes your facts, and can even create Pull Requests on GitHub to update those fixture files for you.

Requirements

To use octofacts in your rspec-puppet tests, those tests must be executed with Ruby 2.1 or higher and rspec-puppet 2.3.2 or higher, and executed on a Unix-like operating system. We explicitly test octofacts with Linux and Mac OS, but do not test under Windows.

To use octofacts-updater, we recommend using PuppetDB, and if you do you'll need version 3.0 or higher.

Example

Once you complete the initial setup and generate fact fixtures, you'll be able to use code like this in your rspec-puppet tests:

describe "modulename::classname" do
  let(:node) { "fake-node.example.net" }
  let(:facts) { Octofacts.from_index(app: "my_app_name", role: "my_role_name") }

  it "should do whatever..."
    ...
  end
end

Installation and use

The basics:

More advanced usage:

Contributing

Please see our contributing document if you would like to participate!

We would specifically appreciate contributions in these areas:

  • Any updates you make to make octofacts compatible with your site -- there are probably assumptions made from the original environment that need to be more flexible.
  • Any interesting anonymization plugins you write for octofacts-updater -- you may place these in the contrib/plugins directory.

Getting help

If you have a problem or suggestion, please open an issue in this repository, and we will do our best to help. Please note that this project adheres to its Code of Conduct.

License

octofacts is licensed under the MIT license.

Authors