Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-1688) Add BoltSpec helper to load bolt constructs #1712

Merged
merged 2 commits into from Apr 13, 2020

Commits on Apr 13, 2020

  1. (puppetlabsGH-1688) Add BoltSpec helper to load bolt constructs

    This creates a new helper module `BoltSpec::BoltContext` which provides
    the `in_bolt_context` method. This method makes Bolt datatypes and
    functions available to a block allowing code that references Bolt
    constructs to be tested. The Plans module was already doing all of this
    work, creating a mock executor, stubbing run_* functions, and setting
    default config, inventory, and modulepath values. This moves all of that
    logic into a common BoltContext module so that it can be generally
    useful instead of being coupled with testing Bolt plans. This allows
    things like Puppet functions that refer to the `Boltlib::TargetSpec`
    datatype to be tested without having to wrap them in a Bolt plan for
    testing.
    
    Closes puppetlabs#1688
    
    !feature
    
    * **Add Boltspec helper to load Bolt constructs** ([puppetlabs#1688](puppetlabs#1688))
    
      A new helper function `in_bolt_context` can be used to wrap code that
      references Bolt constructs, such as the Boltlib::TargetSpec datatype.
    lucywyman committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    7aad50e View commit details
    Browse the repository at this point in the history
  2. (maint) Wait for write stream to be writable

    This adds a try/catch around writing stdin parameters to a Bolt
    operation, which catches errors around the stream not being writable and
    retries writing up to 3 times before raising an error and exiting.
    
    I kind of hope this doesn't work.
    lucywyman committed Apr 13, 2020
    Configuration menu
    Copy the full SHA
    2405e56 View commit details
    Browse the repository at this point in the history