-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Summary
Any of the specs using VCR fixtures are hard-coded to match github API paths for wireframe/gitx. When these specs are run on a fork of the gitx repo, the username portion of the github API request will no longer be wireframe, so VCR fails to match appropriate the response fixture and the specs fail.
Repro Steps
- Fork the
gitxrepo - Checkout the fork
bundle installbundle exec rake
Expected Result
Specs should pass.
Actual Result
Several specs fail with VCR errors, ex:
1) Gitx::Cli::ReleaseCommand#release when target_branch is not nil and user confirms release and pull request exists with success status runs expected commands
Failure/Error: pull_requests = github_client.pull_requests(github_slug, params)
VCR::Errors::UnhandledHTTPRequestError:
================================================================================
An HTTP request has been made that VCR does not know how to handle:
GET https://api.github.com/repos/ndonald2/gitx/pulls?head=ndonald2:feature-branch&state=open
VCR is currently using the following cassette:
- /Users/nick/Developer/gitx/spec/fixtures/vcr_cassettes/pull_request_does_exist_with_success_status.yml
- :record => :once
- :match_requests_on => [:method, :uri]
Under the current configuration VCR can not find a suitable HTTP interaction
to replay and is prevented from recording new requests. There are a few ways
you can deal with this:
* If you're surprised VCR is raising this error
and want insight about how VCR attempted to handle the request,
you can use the debug_logger configuration option to log more details [1].
* You can use the :new_episodes record mode to allow VCR to
record this new request to the existing cassette [2].
* If you want VCR to ignore this request (and others like it), you can
set an `ignore_request` callback [3].
* The current record mode (:once) does not allow new requests to be recorded
to a previously recorded cassette. You can delete the cassette file and re-run
your tests to allow the cassette to be recorded with this request [4].
* The cassette contains 2 HTTP interactions that have not been
played back. If your request is non-deterministic, you may need to
change your :match_requests_on cassette option to be more lenient
or use a custom request matcher to allow it to match [5].
[1] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/debug-logging
[2] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/record-modes/new-episodes
[3] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/configuration/ignore-request
[4] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/record-modes/once
[5] https://www.relishapp.com/vcr/vcr/v/3-0-3/docs/request-matching
================================================================================
# ./lib/gitx/github.rb:43:in `find_pull_request'
# ./lib/gitx/github.rb:22:in `find_or_create_pull_request'
# ./lib/gitx/cli/release_command.rb:21:in `release'
# ./spec/gitx/cli/release_command_spec.rb:125:in `block (5 levels) in <top (required)>'
# ./spec/gitx/cli/release_command_spec.rb:124:in `block (4 levels) in <top (required)>'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels