Below is an example of recording new fixtures for the test: server/tests/drivers/rhevm/instance_test.rb tests.
More information can be found on the past recording of the Deltacloud Community Call #12
Create ${HOME}/.deltacloud/config
Create the deltacloud config file: ${HOME}/.deltacloud/config
to contain the credentials and provider resource UUIDsrhevm: user: 'admin@internal' password: 'localpassword' provider: 'https://rhevm.example.com/api' preferred: datacenter: UUID of a datacenter/realm vm: UUID of an existing instance template: UUID of an existing template/image mock: user: mockuser password: mockpassword provider: compute
Set the VCR record mode to all
Note: This does not cause all tests to be recorded. It instructs VCR to record new fixtures data for the test to be run in the next step.
% export VCR_RECORD="all"
Run the test in record mode
% cd YOUR-REPO/deltacloud/server # Record only the single test: % ruby tests/drivers/rhevm/instance_test.rb or # Record the drivers:rhevm tests: % rake test:drivers:rhevm or # Record all the tests: % rake test
Disable record mode.
This will allow the test to be run in playback mode using the recorded fixtures data.
% unset VCR_RECORD
Confirm all tests run in mock mode
% cd/deltacloud/server # Run only the single tests that had been re-recorded % ruby tests/drivers/rhevm/instance_test.rb and # Run all tests in that section: % rake test:drivers:rhevm and # Record all the tests: % rake test