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

Test are failing #59

Open
stefan-kolb opened this issue Sep 24, 2015 · 4 comments
Open

Test are failing #59

stefan-kolb opened this issue Sep 24, 2015 · 4 comments

Comments

@stefan-kolb
Copy link
Owner

Tests are failing for me (especially Heroku for now).
It's pretty hard to debug this stuff ^^

describe 'create application', :mock_fs_on_replay, cassette_group: 'app;create' do
    describe 'succeeds' do
      describe 'of type nodejs with all properties', :as_cassette do
        before do
          application = {
            application: {
              name: @app_all[:original_name], runtimes: ['nodejs'],
              region: @app_all[:region], autoscaled: false
            }
          }
          application[:application][:vendor_specific] = @application_params if @application_params
          post "/endpoints/#{@endpoint}/applications", application, request_headers
        end
        include_examples 'a valid POST request'
        include_examples 'application entity schema'
        include_examples 'application state: created'
      end

@croeck Should the before block really be run before each of the included examples? How can this work? Shouldn't it return a name is already taken error at the second call (as it always does for me)? I don't fully understand the control flow I think. Should it replay the interaction on the second call?

@croeck
Copy link
Collaborator

croeck commented Sep 30, 2015

I never had such issues with the final version. What it indeed does is to replay the interaction for all further assertions. Meaning the first create is recorded and its assertion run, whereas all further assertions are then based on the recorded interaction and thus do not expect the name is already taken error.

Were there any changes regarding the RSpec gem recently?

@stefan-kolb
Copy link
Owner Author

Not that I know of. I also checked out your last commit.
Same problem there. The first request to post "/endpoints/#{@endpoint}/applications", application, request_headers succeeds and writes a cassette which gets overriden or just the post request? on the second attempt. Dunno what I'm missing there.

@stefan-kolb
Copy link
Owner Author

It looks like it just ignores the first recording, records a second time, and only matches requests on the third run.

@stefan-kolb
Copy link
Owner Author

From my understanding it is very dependent on the record mode how the behavior is:
With :all these tests will never work as every new call in before will be re-recorded.
With :new_episodes the first call will be recorded, all subsequent will be replayed which should work in that case.

There may also be side effects if some interactions already exists in a cassette or a parent cassette (which we don't use by exclude: true).

To record new one must delete the files manually however.
Or maybe we can use a hacked https://www.relishapp.com/vcr/vcr/v/1-6-0/docs/cassettes/automatic-re-recording.

Maybe we can also set the recording flag on non-repeatable interactions explicitely.

I still wonder how this worked for you. Did you only record with :new_episodes or :once?
Some tests that use rspec/wait gem should have failed then tho as the first request that will be too early will be replayed all the time?!

@stefan-kolb stefan-kolb removed the bug label Mar 7, 2016
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

No branches or pull requests

2 participants