From 87538d1c15acff165fbe4cadcb26d1be542dfae6 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 14 Nov 2019 20:45:12 -0800 Subject: [PATCH 1/3] Remove references to Travis GONE! Signed-off-by: Tim Smith --- .travis.yml | 24 ------------------------ CONTRIBUTING.md | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ddbbdc5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -sudo: required -language: ruby -cache: bundler -dist: xenial - -bundler_args: "--without integration tools" - -before_install: - - gem install bundler - - gem --version - -branches: - only: - - master - -matrix: - include: - - rvm: 2.4.5 - script: bundle exec rake - - rvm: 2.5.3 - script: bundle exec rake - - rvm: 2.6.2 - script: bundle exec rake diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a28bfb4..756379c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Chef Projects are built to last. We strive to ensure high quality throughout the 1. **Tests:** To ensure high quality code and protect against future regressions, we require all the code in Chef Projects to have appropriate test coverage. If a new feature is being added, that means unit tests that check internal correctness, and functional tests that verify user experience. For bug fixes, that means tests that clearly demonstrate the defect, fail prior to the change, and pass after the change. See the [test](https://github.com/inspec/train-aws/tree/master/test) directory for the existing tests and use ```bundle exec rake test``` to run them. -2. **Green CI Tests:** We use [Travis CI](https://travis-ci.org/) and/or [AppVeyor](https://www.appveyor.com/) CI systems to test all pull requests. We require these test runs to succeed on every pull request before being merged. +2. **Green CI Tests:** We use Buildkite CI to test all pull requests. We require these test runs to succeed on every pull request before being merged. In addition to this it would be nice to include the description of the problem you are solving with your change. You can use [Issue Template](https://github.com/inspec/train-aws/tree/master/ISSUE_TEMPLATE.md) in the description section From 33731ce1b9fda58b654da5f54a19307f4672f706 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 14 Nov 2019 20:47:58 -0800 Subject: [PATCH 2/3] Ship the license file and not the gemfile/gemspec Ship what we need and not what we don't Signed-off-by: Tim Smith --- train-aws.gemspec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/train-aws.gemspec b/train-aws.gemspec index 3e73037..73355b7 100644 --- a/train-aws.gemspec +++ b/train-aws.gemspec @@ -24,9 +24,7 @@ Gem::Specification.new do |spec| # Though complicated-looking, this is pretty standard for a gemspec. # It just filters what will actually be packaged in the gem (leaving # out tests, etc) - spec.files = %w{ - train-aws.gemspec Gemfile - } + Dir.glob( + spec.files = %w{ LICENSE } + Dir.glob( "lib/**/*", File::FNM_DOTMATCH ).reject { |f| File.directory?(f) } spec.require_paths = ["lib"] From 7a8b5e114f8ee1fb88ccca510d8b2b7f48ba0a0c Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 14 Nov 2019 20:48:52 -0800 Subject: [PATCH 3/3] Chefstyle fixes Signed-off-by: Tim Smith --- Rakefile | 2 +- lib/train-aws/connection.rb | 1 + test/unit/connection_test.rb | 16 ++++++++-------- test/unit/transport_test.rb | 14 +++++++------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Rakefile b/Rakefile index ea7f288..3d7265c 100644 --- a/Rakefile +++ b/Rakefile @@ -6,7 +6,7 @@ #------------------------------------------------------------------# # Do not run integration by default -task default: [:'test:unit', :'test:functional'] +task default: %i{test:unit test:functional} #------------------------------------------------------------------# # Test Runner Tasks diff --git a/lib/train-aws/connection.rb b/lib/train-aws/connection.rb index 25c3dd5..d39139c 100644 --- a/lib/train-aws/connection.rb +++ b/lib/train-aws/connection.rb @@ -76,6 +76,7 @@ def initialize(options) # We support caching on the aws_client call, but not the aws_resource call def aws_client(klass) return klass.new unless cache_enabled?(:api_call) + @cache[:api_call][klass.to_s.to_sym] ||= klass.new end diff --git a/test/unit/connection_test.rb b/test/unit/connection_test.rb index dbd7dea..949498f 100644 --- a/test/unit/connection_test.rb +++ b/test/unit/connection_test.rb @@ -31,10 +31,10 @@ end # Since this is an API-type connection, we MUST NOT implement these three. - [ - :file_via_connection, - :run_command_via_connection, - ].each do |method_name| + %i{ + file_via_connection + run_command_via_connection + }.each do |method_name| it "should NOT provide a #{method_name}() method" do # false passed to instance_methods says 'don't use inheritance' connection_class.instance_methods(false).wont_include(method_name) @@ -49,10 +49,10 @@ # a client-based approach (which focuses on explicit API calls) and a # resource-based approach (which allows you to ask for all EC2 instances, # and the SDK will handle pagination, etc.) - [ - :aws_client, - :aws_resource, - ].each do |method_name| + %i{ + aws_client + aws_resource + }.each do |method_name| it "should provide a #{method_name}() method" do # false passed to instance_methods says 'don't use inheritance' connection_class.instance_methods(false).must_include(method_name) diff --git a/test/unit/transport_test.rb b/test/unit/transport_test.rb index 64b9306..6ada393 100644 --- a/test/unit/transport_test.rb +++ b/test/unit/transport_test.rb @@ -44,13 +44,13 @@ let(:transport) { plugin_class.new } it "should have the correct options" do - [ - :access_key_id, - :profile, - :region, - :secret_access_key, - :session_token, - ].each do |option_name| + %i{ + access_key_id + profile + region + secret_access_key + session_token + }.each do |option_name| transport.options.keys.must_include(option_name) end end