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

add an internal api for update handles #35

Merged
merged 1 commit into from
Mar 28, 2013

Conversation

SlimYang
Copy link
Contributor

No description provided.

@cf-frameworks
Copy link
Contributor

We pulled corresponding change locally in vcap-common (HandleUpdateRequestV2) but specs are still failing, Does this change require some other changes?

$ bundle install
Fetching https://github.com/SlimYang/vcap-common.git
remote: Counting objects: 860, done.
remote: Compressing objects: 100% (379/379), done.
remote: Total 860 (delta 483), reused 805 (delta 437)
Receiving objects: 100% (860/860), 267.60 KiB, done.
Resolving deltas: 100% (483/483), done.
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using addressable (2.3.2)
Using backports (2.6.1)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.0)
Using cf-uaa-lib (1.3.7) from https://github.com/cloudfoundry/cf-uaa-lib.git (at 8d34eed)
Using ci_reporter (1.7.0)
Using crack (0.3.1)
Using daemons (1.1.8)
Using diff-lcs (1.1.3)
Using eventmachine (1.0.0)
Using em-socksify (0.2.1)
Using http_parser.rb (0.5.3)
Using em-http-request (1.0.0.beta.3)
Using excon (0.16.10)
Using formatador (0.2.4)
Using mime-types (1.19)
Using net-ssh (2.6.3)
Using net-scp (1.0.4)
Using nokogiri (1.5.6)
Using ruby-hmac (0.4.0)
Using fog (1.9.0)
Using hashie (1.2.0)
Using multi_xml (0.5.1)
Using rack (1.4.1)
Using rack-accept (0.4.5)
Using rack-mount (0.8.3)
Using virtus (0.5.2)
Using grape (0.2.2)
Using listen (0.5.3)
Using thor (0.15.4)
Using guard (1.4.0)
Using guard-rspec (1.2.1)
Using httpclient (2.2.5)
Using json_pure (1.7.4)
Using machinist (1.0.6)
Using membrane (0.0.2)
Using multipart-post (1.2.0)
Using mysql2 (0.3.11)
Using thin (1.3.1)
Using nats (0.4.24)
Using pg (0.13.2)
Using posix-spawn (0.3.6)
Using rack-protection (1.2.0)
Using rack-test (0.6.1)
Using rfc822 (0.1.1)
Using rspec-core (2.12.2)
Using rspec-expectations (2.12.1)
Using rspec-mocks (2.12.2)
Using rspec (2.12.0)
Using ruby-graphviz (1.0.5)
Using sequel (3.43.0)
Using simplecov-html (0.5.3)
Using simplecov (0.6.4)
Using simplecov-rcov (0.2.3)
Using tilt (1.3.3)
Using sinatra (1.3.2)
Using sinatra-contrib (1.3.1)
Using sqlite3 (1.3.6)
Using yajl-ruby (1.1.0)
Using stager-client (0.0.2) from https://github.com/cloudfoundry/stager-client.git (at 04c2aee)
Using steno (1.0.0)
Using timecop (0.5.9.1)
Using vcap-concurrency (0.1.0) from https://github.com/cloudfoundry/vcap-concurrency.git (at 2a5b017)
Using vcap_common (2.0.10) from https://github.com/SlimYang/vcap-common.git (at b152b40)
Using webmock (1.8.11)
Using bundler (1.2.3)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
bliss:cloud_controller_ng (SlimYang-master) ms mr$ bundle exec rspec
........................................................................................................................................................................................................................................................................................................................................................................*.*...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*................................................................................................................................................................................*....................................................................*.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................FFF.......................................................................................................................................................................................................................................................FFF..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Pending:
  VCAP::CloudController::App on route change sends a dea.update message when we add one url through PUT /v2/apps/:guid/routes
    # Not yet implemented
    # ./spec/api/app_spec.rb:297
  VCAP::CloudController::App on route change sends a dea.update message when we remove one url through PUT /v2/apps/:guid/routes
    # Not yet implemented
    # ./spec/api/app_spec.rb:332
  VCAP::CloudController::LegacyBulk GET /bulk/apps with authentication returns bulk_token with the intial request
    # bulk_token is mandatory in ccng
    # ./spec/api/legacy_bulk_spec.rb:65
  VCAP::CloudController::LegacyServiceLifecycle PUT /services/v1/configurations/:gateway_name/serialized/data returns a 501 Not Implemented if upstream says so
    # Temporarily disabled with xit
    # ./spec/api/legacy_service_lifecycle_spec.rb:372
  VCAP::CloudController::LegacyStaging GET /staged_droplets/:id with a valid droplet should return the droplet
    # Temporarily disabled with xit
    # ./spec/api/legacy_staging_spec.rb:255

Failures:

  1) VCAP::CloudController::ServiceBinding PUT /v2/service_bindings/internal/:id should allow access with valid token
     Failure/Error: last_response.status.should == 200
       expected: 200
            got: 500 (using ==)
     # ./spec/api/service_binding_spec.rb:214:in `block (3 levels) in <module:CloudController>'

  2) VCAP::CloudController::ServiceBinding PUT /v2/service_bindings/internal/:id should forbidden access with invalid token
     Failure/Error: last_response.status.should == 403
       expected: 403
            got: 500 (using ==)
     # ./spec/api/service_binding_spec.rb:225:in `block (3 levels) in <module:CloudController>'

  3) VCAP::CloudController::ServiceBinding PUT /v2/service_bindings/internal/:id should forbidden access with invalid request body
     Failure/Error: last_response.status.should == 400
       expected: 400
            got: 500 (using ==)
     # ./spec/api/service_binding_spec.rb:235:in `block (3 levels) in <module:CloudController>'

  4) VCAP::CloudController::ServiceInstance PUT /v2/service_instances/internal/:instance_id should allow access with valid token
     Failure/Error: last_response.status.should == 200
       expected: 200
            got: 500 (using ==)
     # ./spec/api/service_instance_spec.rb:221:in `block (3 levels) in <module:CloudController>'

  5) VCAP::CloudController::ServiceInstance PUT /v2/service_instances/internal/:instance_id should forbidden access with invalid token
     Failure/Error: last_response.status.should == 403
       expected: 403
            got: 500 (using ==)
     # ./spec/api/service_instance_spec.rb:232:in `block (3 levels) in <module:CloudController>'

  6) VCAP::CloudController::ServiceInstance PUT /v2/service_instances/internal/:instance_id should forbidden access with invalid request body
     Failure/Error: last_response.status.should == 400
       expected: 400
            got: 500 (using ==)
     # ./spec/api/service_instance_spec.rb:242:in `block (3 levels) in <module:CloudController>'

Finished in 2 minutes 48.12 seconds
5985 examples, 6 failures, 5 pending

@SlimYang
Copy link
Contributor Author

the new commit added the following thing:

  1. it rebased the new commits so that it can be merged elegantly.
  2. it modified the spec a bit -- previously the service_id of a service instance are the same string, but when we are looking up the table according to the SERVICE_ID, we would find the wrong tuple, i.e., records inserted by other unit test will influence the result in this unit test. I make the SERVICE_ID a uuid now to work around this issue.

I am still confused where the 500 internal error comes from, please run the spec again (still with that vcap-common change

cloudfoundry/vcap-common#2

) to make sure that this case gets solved or provide more information... thanks.

@SlimYang
Copy link
Contributor Author

@andl

@SlimYang
Copy link
Contributor Author

The spec does not require any change locally and just need to bump the vcap-common code as in

cloudfoundry/vcap-common#2

The unit test passed in my dev environment.

@felixhoo
Copy link

+1

@cf-services
Copy link

I still get 2 failing tests when I merge your commit and bump the version of vcap_common (which I already merged the pull request in):

stevenson:cloud_controller_ng (master) ds$ ls
Gemfile Guardfile NOTICE Rakefile config docs spec
Gemfile.lock LICENSE README.md bin db lib vendor
stevenson:cloud_controller_ng (master) ds$ bundle exec rspec spec
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F.........................................................................................................................................................................................................................................................F...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Pending:
VCAP::CloudController::App on route change sends a dea.update message when we add one url through PUT /v2/apps/:guid/routes
# Not yet implemented
# ./spec/api/app_spec.rb:256
VCAP::CloudController::App on route change sends a dea.update message when we remove one url through PUT /v2/apps/:guid/routes
# Not yet implemented
# ./spec/api/app_spec.rb:291
VCAP::CloudController::LegacyBulk GET /bulk/apps with authentication returns bulk_token with the intial request
# bulk_token is mandatory in ccng
# ./spec/api/legacy_bulk_spec.rb:65
VCAP::CloudController::LegacyStaging GET /staged_droplets/:id with a valid droplet should return the droplet
# Temporarily disabled with xit
# ./spec/api/legacy_staging_spec.rb:255
VCAP::CloudController::Models::App validations name does not allow the same name in a different case
# This test is not valid for SQLite
# ./spec/models/app_spec.rb:233

Failures:

  1. VCAP::CloudController::ServiceBinding PUT /v2/service_bindings/internal/:id should forbidden access with invalid token
    Failure/Error: last_response.status.should == 403
    expected: 403
    got: 500 (using ==)

    ./spec/api/service_binding_spec.rb:225:in `block (3 levels) in module:CloudController'

  2. VCAP::CloudController::ServiceInstance PUT /v2/service_instances/internal/:instance_id should forbidden access with invalid token
    Failure/Error: last_response.status.should == 403
    expected: 403
    got: 500 (using ==)

    ./spec/api/service_instance_spec.rb:232:in `block (3 levels) in module:CloudController'

Finished in 2 minutes 33.11 seconds
5433 examples, 2 failures, 5 pending

Failed examples:

rspec ./spec/api/service_binding_spec.rb:217 # VCAP::CloudController::ServiceBinding PUT /v2/service_bindings/internal/:id should forbidden access with invalid token
rspec ./spec/api/service_instance_spec.rb:224 # VCAP::CloudController::ServiceInstance PUT /v2/service_instances/internal/:instance_id should forbidden access with invalid token
stevenson:cloud_controller_ng (master) ds$ git cherry -v

@SlimYang
Copy link
Contributor Author

Hi David, thanks for your review. I bumped the vcap-common version in this patch and modified the code so that it is able to find the correct error code (I did not know why the unit test failure does not happen in my local dev env but I think now travis should be happy with this new patch). There is no code logic change in the new patch. @andl @felixhoo @figof

@felixhoo
Copy link

+1

cf-services pushed a commit that referenced this pull request Mar 28, 2013
add an internal api for update handles
@cf-services cf-services merged commit fb33231 into cloudfoundry:master Mar 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants