2015/07/20 - Apache Deltacloud has been retired.

For more information, please explore the Attic.


An Example of Re-recording the VCR test fixtures.

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

  1. Create ${HOME}/.deltacloud/config


    Create the deltacloud config file: ${HOME}/.deltacloud/config

    to contain the credentials and provider resource UUIDs
        rhevm:
          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
      
    
      
  2. 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"
        
  3. 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
        
  4. Disable record mode.

    This will allow the test to be run in playback mode using the recorded fixtures data.

        % unset VCR_RECORD
        
  5. 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