You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/03/11 22:36:15 UTC
[2/41] git commit: RHEVM unit tests: allow triggering of rerecording
with env var VCR_RECORD
RHEVM unit tests: allow triggering of rerecording with env var VCR_RECORD
Setting VCR_RECORD=all will rerecord the fixtures
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8f7670a2
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8f7670a2
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8f7670a2
Branch: refs/heads/master
Commit: 8f7670a2da5b393422b0eeaf1bce99a823529e75
Parents: 0dd0249
Author: David Lutterkort <lu...@redhat.com>
Authored: Thu Mar 7 13:57:40 2013 -0800
Committer: David Lutterkort <lu...@redhat.com>
Committed: Mon Mar 11 12:17:50 2013 -0700
----------------------------------------------------------------------
server/tests/drivers/rhevm/common.rb | 9 ++++-----
server/tests/test_helper.rb | 8 ++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8f7670a2/server/tests/drivers/rhevm/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/rhevm/common.rb b/server/tests/drivers/rhevm/common.rb
index 28787bd..6db67e5 100644
--- a/server/tests/drivers/rhevm/common.rb
+++ b/server/tests/drivers/rhevm/common.rb
@@ -26,9 +26,8 @@ VCR.configure do |c|
u.password = "fakepassword"
i.request.uri = u.to_s
end
- # Set :record to :all, when re-recording and between re-record attemps
- # be sure to clear fixtures/*.yml files which can be done with "git checkout".
- # e.g.:
- # c.default_cassette_options = { :record => :all }
- c.default_cassette_options = { :record => :none, :match_requests_on => [ :method, :path, :query ] }
+ c.default_cassette_options = {
+ :record => vcr_record_mode,
+ :match_requests_on => [ :method, :path, :query ]
+ }
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8f7670a2/server/tests/test_helper.rb
----------------------------------------------------------------------
diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb
index b659227..15d37e4 100644
--- a/server/tests/test_helper.rb
+++ b/server/tests/test_helper.rb
@@ -45,6 +45,14 @@ def record_retries(name='', opts = {})
opts
end
+def vcr_record_mode
+ (ENV['VCR_RECORD'] || :none).to_sym
+end
+
+def vcr_recording?
+ vcr_record_mode != :none
+end
+
include Rack::Test::Methods
def run_frontend(frontend=:deltacloud)