From 876df07a1b432eef88003fe5d3ccc4319b206035 Mon Sep 17 00:00:00 2001 From: Dakota Schneider Date: Tue, 12 Jun 2018 11:18:15 -0700 Subject: [PATCH 1/8] (BKR-1168) Early exit from CLI on --help/--version/--parse-only Previous "dry-run"-esque behavior was leaky, resulting in a not-so-dry run. - Subcommand spec tests for exec should not actually call cli.execute!, so intercept them. - Process all early-exit flags first --- lib/beaker/cli.rb | 35 +++++++++++----------------------- spec/beaker/cli_spec.rb | 21 ++++++++++++++++++++ spec/beaker/subcommand_spec.rb | 1 + 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/lib/beaker/cli.rb b/lib/beaker/cli.rb index 6e96027ae3..5ddcfd0415 100644 --- a/lib/beaker/cli.rb +++ b/lib/beaker/cli.rb @@ -19,9 +19,9 @@ def initialize @options = {} end - def parse_options + def parse_options(args = ARGV) @options_parser = Beaker::Options::Parser.new - @options = @options_parser.parse_args + @options = @options_parser.parse_args(args) @attribution = @options_parser.attribution @logger = Beaker::Logger.new(@options) InParallel::InParallelExecutor.logger = @logger @@ -30,16 +30,18 @@ def parse_options @options_parser.update_option(:beaker_version, Beaker::Version::STRING, 'runtime') beaker_version_string = VERSION_STRING % @options[:beaker_version] + # Some flags should exit early if @options[:help] @logger.notify(@options_parser.usage) - @execute = false - return self + exit(0) end - if @options[:beaker_version_print] @logger.notify(beaker_version_string) - @execute = false - return self + exit(0) + end + if @options[:parse_only] + print_version_and_options + exit(0) end #add additional paths to the LOAD_PATH @@ -52,13 +54,6 @@ def parse_options require File.expand_path(helper) end - if @options[:parse_only] - print_version_and_options - @execute = false - return self - end - - @execute = true self end @@ -69,11 +64,8 @@ def print_version_and_options @logger.info(@options.dump) end - #Provision, validate and configure all hosts as defined in the hosts file + # Provision, validate and configure all hosts as defined in the hosts file def provision - # return self if only invoking the OptionsParser help - return self if @options[:help] - begin @hosts = [] initialize_network_manager @@ -96,18 +88,13 @@ def initialize_network_manager end end - #Run Beaker tests. + # Run Beaker tests. # - # - provision hosts (includes validation and configuration) # - run pre-suite # - run tests # - run post-suite # - cleanup hosts def execute! - if !@execute - return - end - print_version_and_options begin diff --git a/spec/beaker/cli_spec.rb b/spec/beaker/cli_spec.rb index 4cbc4c7f1c..2ad06e8eff 100644 --- a/spec/beaker/cli_spec.rb +++ b/spec/beaker/cli_spec.rb @@ -32,6 +32,27 @@ module Beaker end end + describe '#parse_options special behavior' do + # NOTE: this `describe` block must be separate, with the following `before` block. + # Use the above `describe` block for #parse_options when access to the logger object is not needed + before do + # Within parse_options() the reassignment of cli.logger makes it impossible to capture subsequent logger calls. + # So, hijack the reassignment call so that we can keep a reference to it. + allow(Beaker::Logger).to receive(:new).with(no_args).once.and_call_original + allow(Beaker::Logger).to receive(:new).once.and_return(cli.instance_variable_get(:@logger)) + end + + it 'prints the version and exits cleanly' do + expect(cli.logger).to receive(:notify).once + expect{ cli.parse_options(['--version']) }.to raise_exception(SystemExit) { |e| expect(e.success?).to eq(true) } + end + + it 'prints the help and exits cleanly' do + expect(cli.logger).to receive(:notify).once + expect{ cli.parse_options(['--help']) }.to raise_exception(SystemExit) { |e| expect(e.success?).to eq(true) } + end + end + describe '#print_version_and_options' do before do options = Beaker::Options::OptionsHash.new diff --git a/spec/beaker/subcommand_spec.rb b/spec/beaker/subcommand_spec.rb index 7235e0a70b..764b9f31e8 100644 --- a/spec/beaker/subcommand_spec.rb +++ b/spec/beaker/subcommand_spec.rb @@ -176,6 +176,7 @@ module Beaker before :each do allow(subcommand.cli).to receive(:parse_options) allow(subcommand.cli).to receive(:initialize_network_manager) + allow(subcommand.cli).to receive(:execute!) end it 'calls execute! when no resource is given' do From ce2c3e224e4620c97fa09a11009e290da6c7bd5a Mon Sep 17 00:00:00 2001 From: Dakota Schneider Date: Thu, 21 Jun 2018 13:25:49 -0700 Subject: [PATCH 2/8] (BKR-1168) Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e09536270d..aaa6b9a95e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ git logs & PR history. # [Unreleased](https://github.com/puppetlabs/beaker/compare/3.36.0...master) +### Fixed + +- Exit early on --help/--version/--parse-only arguments instead of partial dry-run + # [3.36.0](https://github.com/puppetlabs/beaker/compare/3.35.0...3.36.0) - 2018-06-18 ### Fixed From b59f7b395d11ac3c982e15fb3284e132d787d07d Mon Sep 17 00:00:00 2001 From: jonathannewman Date: Tue, 26 Jun 2018 07:20:31 -0700 Subject: [PATCH 3/8] (maint) allow loggin of frozen strings If a frozen string was passed into the logging routines, it would fail with an exception about strings being frozen. This change allows frozen strings to be logged. For example: irb(main):001:0> foo = "hello there" => "hello there" irb(main):002:0> foo.freeze => "hello there" irb(main):003:0> foo.to_s.force_encoding('UTF-8') RuntimeError: can't modify frozen String from (irb):3:in `force_encoding' from (irb):3 from /Users/jnewman/.rbenv/versions/2.3.1/bin/irb:11:in `
' irb(main):004:0> foo.to_s.dup.force_encoding('UTF-8') => "hello there" --- lib/beaker/logger.rb | 2 +- spec/beaker/logger_spec.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/beaker/logger.rb b/lib/beaker/logger.rb index 97f1b30df6..39a55250ba 100644 --- a/lib/beaker/logger.rb +++ b/lib/beaker/logger.rb @@ -203,7 +203,7 @@ def convert string end else # Remove invalid and undefined UTF-8 character encodings - string.to_s.force_encoding('UTF-8') + string = string.to_s.dup.force_encoding('UTF-8') return string.to_s.chars.select{|i| i.valid_encoding?}.join end end diff --git a/spec/beaker/logger_spec.rb b/spec/beaker/logger_spec.rb index cc452a7247..1cb58539ed 100644 --- a/spec/beaker/logger_spec.rb +++ b/spec/beaker/logger_spec.rb @@ -24,6 +24,10 @@ module Beaker pending "not supported in ruby 1.8 (using #{RUBY_VERSION})" end end + it 'supports frozen strings' do + valid_utf8.freeze + expect( logger.convert(valid_utf8) ).to be === valid_utf8 + end end context '#generate_dated_log_folder' do From 8ab012f61db5370939b57c69383bc453c1eaa2b0 Mon Sep 17 00:00:00 2001 From: Dakota Schneider Date: Thu, 28 Jun 2018 15:48:51 -0700 Subject: [PATCH 4/8] (BKR-816) Expand contribution guidelines with PR requirements Also includes a rebase workflow. --- CONTRIBUTING.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7838ad316f..43ac9abf86 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,8 +16,10 @@ Beaker does not use GitHub Issues, but an internal ticketing system running Jira ## Making Changes -* Create a topic branch on your fork of [puppetlabs/beaker](https://github.com/puppetlabs/beaker). -* Make commits of logical units. If your commits are a mess, you may be asked to [rebase or at least squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) your PR. +Contributions are accepted in the form of pull requests against the master branch on GitHub. + +* Create a topic branch on your fork of [puppetlabs/beaker](https://github.com/puppetlabs/beaker) based on `master`. +* Make commits of logical units. If your commits are a mess, you will be asked to [rebase or at least squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) your PR. * Check for unnecessary whitespace with `git diff --check` before committing. * Make sure your commit messages are in the proper format: ``` @@ -28,6 +30,48 @@ Beaker does not use GitHub Issues, but an internal ticketing system running Jira The first line is a real life imperative statement with a ticket number from our issue tracker. The body describes the behavior without the patch, why this is a problem, and how the patch fixes the problem when applied. ``` * During the time that you are working on your patch the master Beaker branch may have changed - be sure to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) on top of [Beaker's](https://github.com/puppetlabs/beaker) master branch before you submit your PR. A successful rebase ensures that your PR will merge cleanly. +* When you're ready for review, create a new pull request. + +#### PR Requirements + +Pull Requests are subject to the following requirements: + +* Commits must be logical units. Follow these [basic guidelines](https://github.com/trein/dev-best-practices/wiki/Git-Commit-Best-Practices#basic-rules), and don't be afraid to make too many commits: it's always easier to squash than to fixup. +* Must not contain changes unrelated to the ticket being worked on. Issues you encounter as directly related to the main work for a ticket are fiar game. Many beaker components only get infrequent updates so it is not uncommon to encounter dependency version changes that cause problems. These can be addressed with a `(MAINT)` commit within the feature PR you're working on. Larger or only peripherally related changes should go through their own ticket, which you can create; tickets with attached PRs are generally accepted. +* Must merge cleanly. Only fast-forward merges are accepted, so make sure the PR shows as a clean merge. +* On that note, merge commits are not accepted. In order to keep your feature branch up-to-date and ensure a clean merge, you should [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) on top of beaker's master. You can also use this opportunity to keep your fork up to date. That workflow looks like this: + ~~~console + you@local:beaker $ git checkout master + Switched to branch 'master' + Your branch is up to date with 'origin/master'. + you@local:beaker $ git fetch upstream + you@local:beaker $ git merge upstream/master + Updating a01b5732..a565e1ac + Fast-forward + lib/beaker/logger.rb | 2 +- + spec/beaker/logger_spec.rb | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + you@local:beaker $ git push + Total 0 (delta 0), reused 0 (delta 0) + To https://github.com/Dakta/beaker.git + a01b5732..a565e1ac master -> master + you@local:beaker $ git checkout BKR-816 + Switched to branch 'BKR-816' + you@local:beaker $ git rebase master + # if you have conflicts, they'll appear here. Manually fix the listed files then use `git rebase --continue`. Repeat as necessary for each conflicting commit. + First, rewinding head to replay your work on top of it... + Fast-forwarded BKR-816 to master. + you@local:beaker $ git push --set-upstream origin BKR-816 + Counting objects: 9, done. + Delta compression using up to 8 threads. + Compressing objects: 100% (9/9), done. + Writing objects: 100% (9/9), 2.05 KiB | 2.05 MiB/s, done. + Total 9 (delta 6), reused 0 (delta 0) + remote: Resolving deltas: 100% (6/6), completed with 6 local objects. + To https://github.com/Dakta/beaker.git + + [new branch] BKR-816 -> BKR-816 + Branch 'BKR-816' set up to track remote branch 'BKR-816' from 'origin'. + ~~~ #### Courtesy From 63799b525526e03dcca12346e7cde851482d0cac Mon Sep 17 00:00:00 2001 From: Dakota Schneider Date: Mon, 2 Jul 2018 09:15:21 -0700 Subject: [PATCH 5/8] (BKR-1481) Introduce Beaker::Shared::FogFileParser.parse_fog_file() (#1526) * (BKR-1481) Introduce Beaker::Shared::FogFileParser.parse_fog_file() Introduces a shared module for parsing .fog credential files, with descriptive error messages and spec coverage. * (BKR-1481) Fix environment vairable handling Also updates examples in documentation. * (BKR-1481) Rename FogFileParser to FogCredentials * (BKR-1481) Refactor .fog credentials exception handling * (BKR-1481) Don't forget the changelog --- CHANGELOG.md | 4 + docs/how_to/hypervisors/README.md | 14 +-- lib/beaker/shared.rb | 3 +- lib/beaker/shared/fog_credentials.rb | 61 +++++++++++++ spec/beaker/shared/fog_credentials_spec.rb | 100 +++++++++++++++++++++ 5 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 lib/beaker/shared/fog_credentials.rb create mode 100644 spec/beaker/shared/fog_credentials_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index aaa6b9a95e..6cb67fa053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ git logs & PR history. - Exit early on --help/--version/--parse-only arguments instead of partial dry-run +### Added + +- `Beaker::Shared::FogCredentials.get_fog_credentials()` to parse .fog credential files + # [3.36.0](https://github.com/puppetlabs/beaker/compare/3.35.0...3.36.0) - 2018-06-18 ### Fixed diff --git a/docs/how_to/hypervisors/README.md b/docs/how_to/hypervisors/README.md index 2c43a9be26..7a4d4efbdf 100644 --- a/docs/how_to/hypervisors/README.md +++ b/docs/how_to/hypervisors/README.md @@ -13,13 +13,17 @@ By default, the file is located under the user's home directory. This helps to k The `.fog` file is written in YAML. The keys are particular to the service that they correspond to, and each hypervisor's documentation should include the keys that are needed for it. An example `.fog` file is below: ```yaml -:default: - :vsphere_server: 'vsphere.example.com' - :vsphere_username: 'joe' - :vsphere_password: 'MyP@$$w0rd' - :vmpooler_token: 'randomtokentext' +default: + vsphere_server: 'vsphere.example.com' + vsphere_username: 'joe' + vsphere_password: 'MyP@$$w0rd' + vmpooler_token: 'randomtokentext' ``` +Note: keys can be specified as either Strings or as Ruby Symbols (e.g. `:vsphere_server`). For interoprability with other systems, however, it is prudent to use Strings. + +The credentials file supports multiple sections. Hypervisors currently do not specify a section, and the normal behavior is to fall back to using the `default` section. You can override the section by specifying an environment variable, [as documented on the fog website](https://fog.io/about/getting_started.html). Set `ENV['FOG_CREDENTIAL']` to specify an alternative provider section and `Beaker::Shared::FogFileParser.parse_fog_file()` will attempt to load that section, no matter what other section the hypervisor specifies. + # External Hypervisors Puppet and its community have made several gems that support different hypervisors with beaker, the reason for this is that we're looking to decrease Beaker's dependency footprint, and hypervisors are one of the places where we can often increase the load across all Beaker uses to benefit a small group that uses a particular hypervisor. diff --git a/lib/beaker/shared.rb b/lib/beaker/shared.rb index 04e5eba0fe..96d61cdab3 100644 --- a/lib/beaker/shared.rb +++ b/lib/beaker/shared.rb @@ -1,4 +1,4 @@ -[ 'repetition', 'error_handler', 'host_manager', 'timed', 'semvar', 'options_resolver'].each do |lib| +[ 'repetition', 'error_handler', 'host_manager', 'timed', 'semvar', 'options_resolver', 'fog_credentials'].each do |lib| require "beaker/shared/#{lib}" end module Beaker @@ -9,6 +9,7 @@ module Shared include Beaker::Shared::Timed include Beaker::Shared::Semvar include Beaker::Shared::OptionsResolver + include Beaker::Shared::FogCredentials end end include Beaker::Shared diff --git a/lib/beaker/shared/fog_credentials.rb b/lib/beaker/shared/fog_credentials.rb new file mode 100644 index 0000000000..e51afc9b60 --- /dev/null +++ b/lib/beaker/shared/fog_credentials.rb @@ -0,0 +1,61 @@ +require 'stringify-hash' + +module Beaker + module Shared + # A set of functions to read .fog files + module FogCredentials + # Constructs ArgumentError with common phrasing for #get_fog_credentials errors + # + # @param path [String] path to offending file + # @param from_env [String] if the path was overridden in ENV + # @param reason [String] explanation for the failure + # @return [ArgumentError] ArgumentError with preformatted message + def fog_credential_error(path = nil, from_env = nil, reason = nil) + message = "Failed loading credentials from .fog file" + message << " '#{path}'" if path + message << " #{from_env}" if from_env + message << "." + message << "Reason: #{reason}" if reason + ArgumentError.new(message) + end + + # Load credentials from a .fog file + # + # @note Loaded .fog files may use symbols for keys. + # Although not clearly documented, it is valid: + # https://www.rubydoc.info/gems/fog-core/1.42.0/Fog#credential-class_method + # https://github.com/fog/fog-core/blob/7865ef77ea990fd0d085e49c28e15957b7ce0d2b/spec/utils_spec.rb#L11 + # + # @param fog_file_path [String] dot fog path. Overridden by ENV["FOG_RC"] + # @param credential_group [String, Symbol] Credential group to use. Overridden by ENV["FOG_CREDENTIAL"] + # @return [StringifyHash] credentials stored in fog_file_path + # @raise [ArgumentError] when the credentials cannot be loaded, describing the reson + def get_fog_credentials(fog_file_path = '~/.fog', credential_group = :default) + # respect file location from env + if ENV["FOG_RC"] + fog_file_path = ENV["FOG_RC"] + from_env = ' set in ENV["FOG_RC"]' + end + begin + fog = YAML.load_file(fog_file_path) + rescue Psych::SyntaxError, Errno::ENOENT => e + raise fog_credential_error fog_file_path, from_env, "(#{e.class}) #{e.message}" + end + if fog == false # YAML.load => false for empty file + raise fog_credential_error fog_file_path, from_env, "is empty." + end + # transparently support symbols or strings for keys + fog = StringifyHash.new.merge!(fog) + # respect credential from env + # @note ENV must be a string, e.g. "default" not ":default" + if ENV["FOG_CREDENTIAL"] + credential_group = ENV["FOG_CREDENTIAL"].to_sym + end + if not fog[credential_group] + raise fog_credential_error fog_file_path, from_env, "could not load the specified credential group '#{credential_group}'." + end + fog[credential_group] + end + end + end +end diff --git a/spec/beaker/shared/fog_credentials_spec.rb b/spec/beaker/shared/fog_credentials_spec.rb new file mode 100644 index 0000000000..c72c963556 --- /dev/null +++ b/spec/beaker/shared/fog_credentials_spec.rb @@ -0,0 +1,100 @@ +require 'spec_helper' + +module Beaker + module Shared + describe FogCredentials do + context "#get_fog_credentials" do + it 'raises ArgumentError when fog file is missing' do + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog' ) }.to raise_error( ArgumentError ) + end + + it 'raises ArgumentError when fog file is empty' do + expect( File ).to receive( :open ) { "" } + + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog') }.to raise_error( ArgumentError ) + end + + it 'raises ArgumentError when fog file does not contain "default" section and no section is specified' do + data = { :some => { :other => :data } } + + expect( YAML ).to receive( :load_file ) { data } + + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog' ) }.to raise_error( ArgumentError ) + end + + it 'raises ArgumentError when fog file does not contain another section passed by argument' do + data = { :some => { :other => :data } } + + expect( YAML ).to receive( :load_file ) { data } + + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog', credential = :other_credential ) }.to raise_error( ArgumentError ) + end + + it 'raises ArgumentError when there are formatting errors in the fog file' do + data = { "'default'" => { :vmpooler_token => "b2wl8prqe6ddoii70md" } } + + expect( YAML ).to receive( :load_file ) { data } + + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog' ) }.to raise_error( ArgumentError ) + end + + it 'raises ArgumentError when there are syntax errors in the fog file' do + data = ";default;\n :vmpooler_token: z2wl8prqe0ddoii707d" + + allow( File ).to receive( :open ).and_yield( StringIO.new( data ) ) + + expect{ get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog' ) }.to raise_error( ArgumentError, /Psych::SyntaxError/ ) + end + + it 'returns the named credential section' do + data = { + :default => { :vmpooler_token => "wrong_token"}, + :other_credential => { :vmpooler_token => "correct_token" } + } + + expect( YAML ).to receive( :load_file ) { data } + + expect( get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog', credential = :other_credential )[:vmpooler_token] ).to eq( "correct_token" ) + end + + it 'returns the named credential section from ENV["FOG_CREDENTIAL"]' do + ENV['FOG_CREDENTIAL'] = 'other_credential' + data = { + :default => { :vmpooler_token => "wrong_token"}, + :other_credential => { :vmpooler_token => "correct_token" } + } + + expect( YAML ).to receive( :load_file ) { data } + + expect( get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog' )[:vmpooler_token] ).to eq( "correct_token" ) + ENV.delete( 'FOG_CREDENTIAL' ) + end + + it 'returns the named credential section from ENV["FOG_CREDENTIAL"] even when an argument is provided' do + ENV['FOG_CREDENTIAL'] = 'other_credential' + data = { + :default => { :vmpooler_token => "wrong_token"}, + :other_credential => { :vmpooler_token => "correct_token" } + } + + expect( YAML ).to receive( :load_file ) { data } + + expect( get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog', credential = :default )[:vmpooler_token] ).to eq( "correct_token" ) + ENV.delete( 'FOG_CREDENTIAL' ) + end + + it 'returns the named credential section from ENV["FOG_RC"] path' do + ENV['FOG_RC'] = '/some/other/path/to/.fog' + data = { + :default => { :vmpooler_token => "correct_token"}, + :other_credential => { :vmpooler_token => "wrong_token" } + } + + expect( YAML ).to receive( :load_file ).with( '/some/other/path/to/.fog' ) { data } + + expect( get_fog_credentials( fog_file_path = '/path/that/does/not/exist/.fog', credential = :default )[:vmpooler_token] ).to eq( "correct_token" ) + end + end + end + end +end From dcee6536c14205d3362f53f4ca27b7ffecda0a38 Mon Sep 17 00:00:00 2001 From: Dakota Schneider Date: Mon, 2 Jul 2018 09:39:24 -0700 Subject: [PATCH 6/8] (BKR-1393) Update documentation on multiple arguments to subcommand exec (#1528) * (BKR-1393) Update exec help description Clarify behavior to support passing multiple test files, directories, or suites as a comma-separated list, as long as that list is homogeneous. * (BKR-1393) Update docs/tutorials/subcommands.md Clarify that exec accepts comma-separated list of tests. --- docs/tutorials/subcommands.md | 2 +- lib/beaker/subcommand.rb | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/subcommands.md b/docs/tutorials/subcommands.md index 775013e2b6..7149e04c2c 100644 --- a/docs/tutorials/subcommands.md +++ b/docs/tutorials/subcommands.md @@ -22,7 +22,7 @@ Provisions hosts defined in your `subcommand_options file`. You can pass the `-- ### beaker exec -Run a single file, directory, or Beaker suite. If supplied a file or directory, that resource will be run in the context of the `tests` suite; if supplied a Beaker suite, then just that suite will run. If no resource is supplied, then this command executes the suites as they are defined in the configuration in the `subcommand_options.yaml`. +Run either files, directories, or beaker suites. If supplied a file or directory, that resource will be run in the context of the `tests` suite; If supplied a beaker suite, then just that suite will run. If no resource is supplied, then this command executes the suites as they are defined in the configuration. Accepts a comma-separated, homogeneous list. E.g. only files, only directories, or only suites, such as: `exec pre-suite,tests` ### beaker destroy diff --git a/lib/beaker/subcommand.rb b/lib/beaker/subcommand.rb index 8db567b7c8..334b656aae 100644 --- a/lib/beaker/subcommand.rb +++ b/lib/beaker/subcommand.rb @@ -149,12 +149,14 @@ def provision() end end - desc 'exec FILE/BEAKER_SUITE', 'execute a directory, file, or beaker suite' + desc 'exec FILE(S)/BEAKER_SUITE', 'execute directories, files, or beaker suites' long_desc <<-LONG_DESC - Run a single file, directory, or beaker suite. If supplied a file or directory, + Run either files, directories, or beaker suites. If supplied a file or directory, that resource will be run in the context of the `tests` suite; If supplied a beaker suite, then just that suite will run. If no resource is supplied, then this command - executes the suites as they are defined in the configuration. + executes the suites as they are defined in the configuration. Accepts a comma + -separated, homogeneous list. E.g. only files, only directories, or only suites, + such as: exec pre-suite,tests LONG_DESC option :help, :type => :boolean, :hide => true def exec(resource=nil) From c17eb5749d88e2307cf0550e7a34ee9fe4fe0849 Mon Sep 17 00:00:00 2001 From: kevpl Date: Wed, 11 Jul 2018 13:28:44 -0700 Subject: [PATCH 7/8] (MAINT) release 3.37.0 [skip ci] --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cb67fa053..0f4f4e315f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,9 @@ Tracking in this Changelog began for this project in version 3.25.0. If you're looking for changes from before this, refer to the project's git logs & PR history. -# [Unreleased](https://github.com/puppetlabs/beaker/compare/3.36.0...master) +# [Unreleased](https://github.com/puppetlabs/beaker/compare/3.37.0...master) + +# [3.37.0](https://github.com/puppetlabs/beaker/compare/3.36.0...3.37.0) - 2018-07-11 ### Fixed From 1fcd0909f754da9e039825ca790a815c8f9a5656 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Wed, 11 Jul 2018 20:33:02 +0000 Subject: [PATCH 8/8] (GEM) update beaker version to 3.37.0 --- lib/beaker/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/beaker/version.rb b/lib/beaker/version.rb index be3ab3fb16..85a28d8f0f 100644 --- a/lib/beaker/version.rb +++ b/lib/beaker/version.rb @@ -1,5 +1,5 @@ module Beaker module Version - STRING = '3.36.0' + STRING = '3.37.0' end end