| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <title>Updating VCR Fixtures Example</title> |
| <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> |
| <!--[if lt IE 9]> |
| <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
| <![endif]--> |
| |
| <!-- Le JavaScript --> |
| <script src="/assets/js/jquery-1.7.1.min.js" type="text/javascript"></script> |
| <script src="/assets/js/bootstrap-dropdown.js" type="text/javascript"></script> |
| <script src="/assets/js/jquery.tweet.js" type="text/javascript"></script> |
| <script src="/assets/js/application.js" type="text/javascript"></script> |
| <script src="/assets/js/bootstrap-transition.js"></script> |
| <script src="/assets/js/bootstrap-alert.js"></script> |
| <script src="/assets/js/bootstrap-modal.js"></script> |
| <script src="/assets/js/bootstrap-scrollspy.js"></script> |
| <script src="/assets/js/bootstrap-tab.js"></script> |
| <script src="/assets/js/bootstrap-tooltip.js"></script> |
| <script src="/assets/js/bootstrap-popover.js"></script> |
| <script src="/assets/js/bootstrap-button.js"></script> |
| <script src="/assets/js/bootstrap-collapse.js"></script> |
| <script src="/assets/js/bootstrap-carousel.js"></script> |
| <script src="/assets/js/bootstrap-typeahead.js"></script> |
| |
| <!-- Le styles --> |
| <link href="/assets/css/bootstrap.css" rel="stylesheet"> |
| <link href="/assets/css/application.css" rel="stylesheet"> |
| <link rel="shortcut icon" href="/assets/img/favicon.ico"> |
| </head> |
| |
| <body> |
| |
| <div class="navbar navbar-fixed-top"> |
| <div class="navbar-inner"> |
| <div class="container"> |
| <a class="brand" href="/"><img src="/assets/img/logo.png" width="152" |
| alt="Deltacloud API"/></a> |
| <ul class="nav top-nav"> |
| <li><a href="/">Home</a></li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/about.html">What is Deltacloud?</a></li> |
| <li><a href="/drivers.html#drivers">Supported Providers</a></li> |
| </ul> |
| </li> |
| <li><a href="/download.html">Download</a></li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Installation<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/install-deltacloud.html">Install Deltacloud</a></li> |
| <li><a href="/run-deltacloud-server.html">Run the Deltacloud Server</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="/usage.html" class="dropdown-toggle" data-toggle="dropdown">Usage<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/usage.html#usingapi">Using API</a></li> |
| <li><a href="/usage.html#clients">Client Libraries</a></li> |
| <li><a href="/command-tools.html">Command Line Tools</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contribute<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/getting-sources.html">Getting Sources</a></li> |
| <li><a href="/how-to-contribute.html">How Can I Contribute?</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">API<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/rest-api.html">Deltacloud REST API</a></li> |
| <li><a href="/curl-examples.html">Deltacloud API cURL examples</a></li> |
| <li><a href="/drivers.html">Drivers API</a></li> |
| </ul> |
| </li> |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">CIMI<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| <li><a href="/cimi-rest.html">CIMI REST API</a></li> |
| <li><a href="/cimi-curl.html">CIMI cURL Examples</a></li> |
| </ul> |
| </li> |
| <li><a href="/contact.html">Contact</a></li> |
| </ul> |
| |
| </div> |
| </div> |
| |
| </div> |
| |
| <div class="container content"> |
| |
| <p><br></p> |
| |
| <ul class="breadcrumb"> |
| <li> |
| <a href="white-box-tests.html">White Box Tests?</a> <span class="divider">/</span> |
| </li> |
| <li class="active">Updating VCR Fixtures Example</li> |
| </ul> |
| |
| <h3>An Example of Re-recording the VCR test fixtures.</h3> |
| |
| <p> |
| Below is an example of recording new fixtures for the test: |
| <i><u><b>server/tests/drivers/rhevm/instance_test.rb</b></u></i> |
| tests. |
| </p> |
| |
| <p> |
| More information can be found on the past recording of the |
| <a href="http://youtu.be/zTCGRDO_3dU">Deltacloud Community Call #12</a> |
| </p> |
| |
| <ol> |
| <li> |
| <p> Create ${HOME}/.deltacloud/config</p> |
| <br> |
| <p> Create the deltacloud config file: ${HOME}/.deltacloud/config</p> |
| to contain the credentials and provider resource UUIDs |
| |
| <pre> |
| 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 |
| |
| |
| </pre> |
| </li> |
| <li> |
| <p>Set the VCR record mode to <i>all</i></p> |
| <br> |
| <p> Note: This does not cause <i>all</i> tests to be recorded. |
| It instructs VCR to record new fixtures data for the test to |
| be run in the next step.</p> |
| |
| <pre> |
| % export VCR_RECORD="all" |
| </pre> |
| |
| </li> |
| |
| <li> |
| <p>Run the test in record mode</p> |
| |
| <pre> |
| % cd YOUR-REPO/deltacloud/server |
| |
| # Record only the single test: |
| % ruby tests/drivers/rhevm/instance_test.rb |
| |
| <b>or</b> |
| |
| # Record the drivers:rhevm tests: |
| % rake test:drivers:rhevm |
| |
| <b>or</b> |
| |
| # Record all the tests: |
| % rake test |
| </pre> |
| |
| </li> |
| |
| <li> |
| <p>Disable record mode. |
| <br> |
| </p> |
| <p>This will allow the test to be run in playback mode using the |
| recorded fixtures data.</p> |
| |
| <pre> |
| % unset VCR_RECORD |
| </pre> |
| |
| |
| </li> |
| <li> |
| <p>Confirm all tests run in mock mode</p> |
| |
| <pre> |
| % cd <repo>/deltacloud/server |
| |
| # Run only the single tests that had been re-recorded |
| % ruby tests/drivers/rhevm/instance_test.rb |
| |
| <b>and</b> |
| |
| # Run all tests in that section: |
| % rake test:drivers:rhevm |
| |
| <b>and</b> |
| |
| # Record all the tests: |
| % rake test |
| |
| |
| |
| |
| </repo></pre> |
| </li> |
| </ol> |
| |
| |
| <footer class="footer"> |
| <p class="pull-right"><span class='icon-circle-arrow-up'> </span><a href="#">Back to top</a></p> |
| <div class='row'> |
| <div class='span3'> |
| <img src="/assets/img/asf.png" alt="Apache Software Foundation"/> |
| </div> |
| <div class='span9'> |
| <strong>Apache Deltacloud</strong> is a top-level project at the <a |
| href="http://www.apache.org">Apache Software Foundation</a>, |
| having graduated from the ASF Incubator in October |
| 2011. Through a collaborative and meritocratic development process, Apache |
| projects deliver enterprise-grade, freely available software products that |
| attract large communities of users. |
| </div> |
| </div> |
| </footer> |
| |
| </div> <!-- /container --> |
| |
| <!-- Piwik --> |
| <script type="text/javascript"> |
| var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.salasaga.org/aeolus/piwik/" : "http://stats.salasaga.org/aeolus/piwik/"); |
| document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); |
| </script><script type="text/javascript"> |
| try { |
| var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2); |
| piwikTracker.trackPageView(); |
| piwikTracker.enableLinkTracking(); |
| } catch( err ) {} |
| </script><noscript><p><img src="http://stats.salasaga.org/aeolus/piwik/piwik.php?idsite=2" style="border:0" alt="" /></p></noscript> |
| <!-- End Piwik Tracking Code --> |
| |
| </body> |
| </html> |