Faster module tests with Facter 4 and rspec-puppet

This page summarizes the projects mentioned and recommended in the original post on dev.to

Scout Monitoring - Performance metrics and, now, Logs Management Monitoring with Scout Monitoring
Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.
www.scoutapm.com
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • facter

    Collect and display system facts

    The latest major version of Facter—Puppet's tool for collecting system information—has been out for some time now. However, we've been hard at work fixing bugs ever since. The fact that Facter has to be able to run on a variety of operating systems and architectures makes maintenance quite a challenging ordeal.

  • Scout Monitoring

    Performance metrics and, now, Logs Management Monitoring with Scout Monitoring. Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.

    Scout Monitoring logo
  • facterdb

    A Database of OS facts provided by Facter

    For each test, rspec-puppet stubs the fake facts using the custom facts API. The fake facts it gets from facterdb, which is a gem that contains "dummy" facts for a variety of operating systems and Facter versions—basically lots of files containing facter --json output. The resulting information is then fed to Puppet for catalog compilation.

  • Puppet

    Server automation framework and application

    We started by decoupling Puppet from Facter as much as we could, introducing the possibility of having multiple Facter backends. While Puppet would use the default Facter implementation when running on its own, external users would be able to define and pass their own Facter implementation when initializing Puppet, similar to how puppetserver configures Puppet to use its JRuby-compliant HTTP client.

  • rspec-puppet

    RSpec tests for your Puppet manifests

    To avoid breaking the Facter API, we ended up implementing an overcomplicated way of interacting with a hash. Using our dumb Facter backend, custom facts were now simply added to a hash, and querying them would just produce them from the hash if available:

  • kmo-501-nginx

    Discontinued A mock nginx module for training

    And because performance improvements mean nothing without showing the numbers, here's how test times have changed for the puppet-nginx module:

  • puppet-nginx

    Puppet Module to manage NGINX on various UNIXes (by GabrielNagy)

    One thing I haven't mentioned is that running the same tests with Puppet 6 takes a total of 25 minutes, so there's more to improve in Puppet itself as well. However, from a Facter standpoint it's impossible to make the tests any faster, unless Ruby itself improves hash access speed 😜.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Setup a k3s Cluster at home quickly

    1 project | dev.to | 14 Jul 2024
  • No Need For Docker Anymore

    4 projects | dev.to | 12 Jul 2024
  • Docker Compose Develop Watch and Syncing Files from the Host Container to a Service

    1 project | dev.to | 12 Jul 2024
  • Run A NodeJs Application In a Docker Container

    1 project | dev.to | 9 Jul 2024
  • Introducing the new feature of DevOps Toolkit: Configuration Reusability

    2 projects | dev.to | 9 Jul 2024

Did you konow that Ruby is
the 12th most popular programming language
based on number of metions?