k1LoW / awspec

RSpec tests for your AWS resources.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

helper/codebuild.rb uses illegal sort_by param

dgillman opened this issue · comments

When trying to test a codebuild resource, a backtrace was generated claiming an illegal "sortBy" parameter was passed. It appears that the ID of the target codebuild project is being used as the sortBy parameter. The AWS REST API states this value may be one of three constants: CREATED_TIME, LAST_MODIFIED_TIME, and NAME (https://docs.aws.amazon.com/cli/latest/reference/codebuild/list-projects.html).

Stacktrace:

  1) codebuild 'test-pipeline-build' should exist
     Failure/Error: it { should exist }

     Aws::CodeBuild::Errors::InvalidInputException:
       Invalid sortBy type specified: test-pipeline-build
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/seahorse/client/plugins/response_target.rb:23:in `call'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-core-3.48.1/lib/seahorse/client/request.rb:70:in `send_request'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/aws-sdk-codebuild-1.31.0/lib/aws-sdk-codebuild/client.rb:1461:in `list_projects'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/awspec-1.17.0/lib/awspec/helper/client_wrap.rb:26:in `method_missing'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/awspec-1.17.0/lib/awspec/helper/finder/codebuild.rb:5:in `find_codebuild_project'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/awspec-1.17.0/lib/awspec/type/codebuild.rb:4:in `resource_via_client'
     # /Users/duffy/.rvm/gems/ruby-2.3.1/gems/awspec-1.17.0/lib/awspec/type/base.rb:26:in `respond_to_missing?'
     # ./test/integration/test_codebuild.rb:14:in `block (2 levels) in <top (required)>'

Code line with issue: https://github.com/k1LoW/awspec/blob/master/lib/awspec/helper/finder/codebuild.rb#L5

Hi, dgillman

Thank you for your issue.

This is a bug.
I will take care of it as soon as possible. 🙇

Regards.

Yohei

Hi, @dgillman

I fixed bug.
Please confirm ver 1.17.2 🙏

Regards.

Yohei

Thank you!

Version 1.17.2 works wonderfully. Thank you again for the quick turnaround on that!