You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/03/15 15:30:12 UTC

svn commit: r1456966 - in /deltacloud/trunk/site: content/ output/

Author: marios
Date: Fri Mar 15 14:30:11 2013
New Revision: 1456966

URL: http://svn.apache.org/r1456966
Log:
SITE: Update test recording instructions

This is required to better describe recent changes
for parameterizing recording and provider configuration
of credentials and resources to avoid having to edit
test source code in order to record test fixtures.
TrackedAt: http://tracker.deltacloud.org/patch/9723a4aa34c7b445973301facebb13399064aab4

Modified:
    deltacloud/trunk/site/content/running-the-white-box-tests.md
    deltacloud/trunk/site/content/send-patch.md
    deltacloud/trunk/site/content/update-vcr-test-fixtures-data-example.md
    deltacloud/trunk/site/output/running-the-white-box-tests.html
    deltacloud/trunk/site/output/send-patch.html
    deltacloud/trunk/site/output/update-vcr-test-fixtures-data-example.html

Modified: deltacloud/trunk/site/content/running-the-white-box-tests.md
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/running-the-white-box-tests.md?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/content/running-the-white-box-tests.md (original)
+++ deltacloud/trunk/site/content/running-the-white-box-tests.md Fri Mar 15 14:30:11 2013
@@ -14,8 +14,9 @@ title: Running the Whitebox Tests
 
 <h3>Running the white box tests</h3>
 
-<p>The tests can be executed in groups, using tasks in the Rakefile, or
-   individually.</p>
+<p>After getting the source and <a href="getting-sources.html"> setting
+up the development environment</a>, the tests can be executed in groups,
+using tasks in the Rakefile, or individually using ruby directly.</p>
 
 <ul>
   <li>
@@ -32,24 +33,30 @@ title: Running the Whitebox Tests
     </li>
 
     <li>
-      <p>Rake task to run the various <b><u><i>Frontend </i></u></b> tests: </p>
+      <p>Example of listing the available subtasks have available tests: </p>
+      <pre>
+      % cd <b>REPO</b>/deltacloud/server
+      % rake -T test
+      <i>output list or available tests</i>
+      </pre>
+    </li>
+
+    <li>
+      <p>Example rake task to run ec2 <b><u><i>frontend </i></u></b> tests: </p>
       <pre>
       % cd <b>REPO</b>/deltacloud/server
-      % rake test:base            # Run tests for base
-      % rake test:cimi:models     # Run tests for models
       % rake test:ec2             # Run tests for ec2
       </pre>
     </li>
 
     <li>
-      <p>Rake task to run the various <b><u><i>Driver </i></u></b>  tests: </p>
+      <p>Example rake task to run the rhevm <b><u><i>driver </i></u></b>  tests: </p>
       <pre>
       % cd <b>REPO</b>/deltacloud/server
-      % rake test:drivers:ec2     # Run tests for ec2
-      % rake test:drivers:mock    # Run tests for mock
       % rake test:drivers:rhevm   # Run tests for rhevm
       </pre>
-     </li>
+    </li>
+
   </ul>
 
   <li>

Modified: deltacloud/trunk/site/content/send-patch.md
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/send-patch.md?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/content/send-patch.md (original)
+++ deltacloud/trunk/site/content/send-patch.md Fri Mar 15 14:30:11 2013
@@ -44,9 +44,6 @@ to = dev@deltacloud.apache.org
 
 [core]
 whitespace = trailing-space,space-before-tab
-
-[apply]
-whitespace = error-all
 </pre>
 
   </li>

Modified: deltacloud/trunk/site/content/update-vcr-test-fixtures-data-example.md
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/content/update-vcr-test-fixtures-data-example.md?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/content/update-vcr-test-fixtures-data-example.md (original)
+++ deltacloud/trunk/site/content/update-vcr-test-fixtures-data-example.md Fri Mar 15 14:30:11 2013
@@ -29,12 +29,19 @@ More information can be found on the pas
 <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</p>
 
     <pre>
     rhevm:
       user:     'admin@internal'
       password: 'localpassword'
-      provider: 'https://16.1.1.3/api;b9bb11c2-f397-4f41-a57b-7ac15a894779'
+      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
@@ -42,54 +49,33 @@ More information can be found on the pas
   </li>
 
   <li>
-    <p>Modify the test source to have the realm, instance, image & provider
-       for a live cloud provider.</p>
+    <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>
-    % vim server/tests/drivers/rhevm/instance_test.rb
-    ...
-    TST_REALM    = '12345678-123a-123b-123c-123456789abc'
-    TST_INSTANCE = '23456781-23a1-23b1-23c1-23456789abce'
-    TST_IMAGE    = '34567812-3a12-3b12-3c12-3456789abcef'
-    ...
-        @driver = Deltacloud::Test::config.driver(:rhevm,
-          provider="https://16.1.1.3/api;b9bb11c2-f397-4f41-a57b-7ac15a894779")
+    % export VCR_RECORD="all"
     </pre>
 
   </li>
 
   <li>
-    <p>Set the VCR record mode to :record => :all</p>
-
-    <pre>
-    % vim server/tests/drivers/rhevm/common.rb
-    ...
-    # 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 }
-    ...
-    </pre>
-
-  </li>
-
-
-  <li>
     <p>Run the test in record mode</p>
 
     <pre>
     % cd YOUR-REPO/deltacloud/server
 
-    # Record only the single test
+    # Record only the single test:
     % ruby tests/drivers/rhevm/instance_test.rb
 
-    or
+    <b>or</b>
 
     # Record the drivers:rhevm tests:
     % rake test:drivers:rhevm
 
-    or
+    <b>or</b>
 
     # Record all the tests:
     % rake test
@@ -98,69 +84,16 @@ More information can be found on the pas
   </li>
 
   <li>
-    <p>Remove the user:password creds from the fixture.</p>
-
-    <p>
-    The recorded fixture will contain live creds. For security reasons
-    it is best to either change the credentials on the cloud provider or
-    remove them from the fixture YAML file. Removing them from the fixture
-    YAML file can easily be accomplished using sed.
-    </p>
-
-    <pre>
-    e.g.:
-    for i in $(ls tests/drivers/rhevm/fixtures/test_0*.yml); do \
-      echo $i; \
-      cat $i | sed s/admin%40internal:localpassword/fakeuser:fakepassword/ > $i.new; \
-      mv $i.new $i; \
-    done
-    </pre>
-
-  </li>
-
-  <li>
-    <p>Remove ${HOME}/.deltacloud/config</p>
-
-    <p>
-    This is done to avoid using the credentials from the config file
-    during non-recording test runs.
-    </p>
+    <p>Disable record mode.
+    <br>
+    <p>This will allow the test to be run in playback mode using the
+    recorded  fixtures data.</p>
 
     <pre>
-    e.g.: (note it might be best to save it in ".ORIG" for future re-recordings.)
-    mv ${HOME}/.deltacloud/config ${HOME}/.deltacloud/config.ORIG
-    </pre>
-  </li>
-
-  <li>
-    <p>Turn off record mode.
-
-    <p>To turn off record mode set the record mode to { :record => :none }</p>
-
-    <pre>
-    % vim server/tests/drivers/rhevm/common.rb
-    ...
-    # 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 }
-    ...
+    % unset VCR_RECORD
     </pre>
 
   </li>
-
-  <li>
-    <p>Remove trailing white space from the fixtures YAML files.</p>
-
-    <p>
-    Recording can place trailing white space in the fixtures YAML files
-    which can be removed or ignored.
-    </p>
-
-    <p>There are many ways to accomplish this.</p>
-  </li>
-
   <li>
     <p>Confirm all tests run in mock mode</p>
 
@@ -170,12 +103,12 @@ More information can be found on the pas
     # Run only the single tests that had been re-recorded
     % ruby tests/drivers/rhevm/instance_test.rb
 
-      and
+      <b>and</b>
 
     # Run all tests in that section:
     % rake test:drivers:rhevm
 
-      and
+      <b>and</b>
 
     # Record all the tests:
     % rake test

Modified: deltacloud/trunk/site/output/running-the-white-box-tests.html
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/running-the-white-box-tests.html?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/output/running-the-white-box-tests.html (original)
+++ deltacloud/trunk/site/output/running-the-white-box-tests.html Fri Mar 15 14:30:11 2013
@@ -104,8 +104,9 @@
   <li class="active">Running The White Box Tests</li>
 </ul><h3>Running the white box tests</h3>
 
-<p>The tests can be executed in groups, using tasks in the Rakefile, or
-   individually.</p>
+<p>After getting the source and <a href="getting-sources.html"> setting
+up the development environment</a>, the tests can be executed in groups,
+using tasks in the Rakefile, or individually using ruby directly.</p>
 
 <ul>
 <li>
@@ -122,24 +123,30 @@
     </li>
 
     <li>
-      <p>Rake task to run the various <b><u><i>Frontend </i></u></b> tests: </p>
+      <p>Example of listing the available subtasks have available tests: </p>
+      <pre>
+      % cd <b>REPO</b>/deltacloud/server
+      % rake -T test
+      <i>output list or available tests</i>
+      </pre>
+    </li>
+
+    <li>
+      <p>Example rake task to run ec2 <b><u><i>frontend </i></u></b> tests: </p>
       <pre>
       % cd <b>REPO</b>/deltacloud/server
-      % rake test:base            # Run tests for base
-      % rake test:cimi:models     # Run tests for models
       % rake test:ec2             # Run tests for ec2
       </pre>
     </li>
 
     <li>
-      <p>Rake task to run the various <b><u><i>Driver </i></u></b>  tests: </p>
+      <p>Example rake task to run the rhevm <b><u><i>driver </i></u></b>  tests: </p>
       <pre>
       % cd <b>REPO</b>/deltacloud/server
-      % rake test:drivers:ec2     # Run tests for ec2
-      % rake test:drivers:mock    # Run tests for mock
       % rake test:drivers:rhevm   # Run tests for rhevm
       </pre>
-     </li>
+    </li>
+
   </ul>
 <li>
     <p>Example manually running an <b><u><i>individual</i></u></b> test: </p>

Modified: deltacloud/trunk/site/output/send-patch.html
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/send-patch.html?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/output/send-patch.html (original)
+++ deltacloud/trunk/site/output/send-patch.html Fri Mar 15 14:30:11 2013
@@ -134,9 +134,6 @@ to = dev@deltacloud.apache.org
 
 [core]
 whitespace = trailing-space,space-before-tab
-
-[apply]
-whitespace = error-all
 </pre>
 
   </li>

Modified: deltacloud/trunk/site/output/update-vcr-test-fixtures-data-example.html
URL: http://svn.apache.org/viewvc/deltacloud/trunk/site/output/update-vcr-test-fixtures-data-example.html?rev=1456966&r1=1456965&r2=1456966&view=diff
==============================================================================
--- deltacloud/trunk/site/output/update-vcr-test-fixtures-data-example.html (original)
+++ deltacloud/trunk/site/output/update-vcr-test-fixtures-data-example.html Fri Mar 15 14:30:11 2013
@@ -118,12 +118,18 @@ More information can be found on the pas
 <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://16.1.1.3/api;b9bb11c2-f397-4f41-a57b-7ac15a894779'
+      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
@@ -133,54 +139,32 @@ More information can be found on the pas
   </pre>
 </li>
 <li>
-    <p>Modify the test source to have the realm, instance, image &amp; provider
-       for a live cloud provider.</p>
+    <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>
-    % vim server/tests/drivers/rhevm/instance_test.rb
-    ...
-    TST_REALM    = '12345678-123a-123b-123c-123456789abc'
-    TST_INSTANCE = '23456781-23a1-23b1-23c1-23456789abce'
-    TST_IMAGE    = '34567812-3a12-3b12-3c12-3456789abcef'
-    ...
-        @driver = Deltacloud::Test::config.driver(:rhevm,
-          provider="https://16.1.1.3/api;b9bb11c2-f397-4f41-a57b-7ac15a894779")
+    % export VCR_RECORD="all"
     </pre>
 
   </li>
 
   <li>
-    <p>Set the VCR record mode to :record =&gt; :all</p>
-
-    <pre>
-    % vim server/tests/drivers/rhevm/common.rb
-    ...
-    # 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 =&gt; :all }
-    # c.default_cassette_options = { :record =&gt; :none }
-    ...
-    </pre>
-
-  </li>
-
-
-  <li>
     <p>Run the test in record mode</p>
 
     <pre>
     % cd YOUR-REPO/deltacloud/server
 
-    # Record only the single test
+    # Record only the single test:
     % ruby tests/drivers/rhevm/instance_test.rb
 
-    or
+    <b>or</b>
 
     # Record the drivers:rhevm tests:
     % rake test:drivers:rhevm
 
-    or
+    <b>or</b>
 
     # Record all the tests:
     % rake test
@@ -189,72 +173,18 @@ More information can be found on the pas
   </li>
 
   <li>
-    <p>Remove the user:password creds from the fixture.</p>
-
-    <p>
-    The recorded fixture will contain live creds. For security reasons
-    it is best to either change the credentials on the cloud provider or
-    remove them from the fixture YAML file. Removing them from the fixture
-    YAML file can easily be accomplished using sed.
-    </p>
-
-    <pre>
-    e.g.:
-    for i in $(ls tests/drivers/rhevm/fixtures/test_0*.yml); do \
-      echo $i; \
-      cat $i | sed s/admin%40internal:localpassword/fakeuser:fakepassword/ &gt; $i.new; \
-      mv $i.new $i; \
-    done
-    </pre>
-
-  </li>
-
-  <li>
-    <p>Remove ${HOME}/.deltacloud/config</p>
-
-    <p>
-    This is done to avoid using the credentials from the config file
-    during non-recording test runs.
-    </p>
+    <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>
-    e.g.: (note it might be best to save it in ".ORIG" for future re-recordings.)
-    mv ${HOME}/.deltacloud/config ${HOME}/.deltacloud/config.ORIG
-    </pre>
-  </li>
-
-  <li>
-    <p>Turn off record mode.
-
-    </p>
-<p>To turn off record mode set the record mode to { :record =&gt; :none }</p>
-
-    <pre>
-    % vim server/tests/drivers/rhevm/common.rb
-    ...
-    # 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 =&gt; :all }
-    c.default_cassette_options = { :record =&gt; :none }
-    ...
+    % unset VCR_RECORD
     </pre>
 
   
-
   </li>
 <li>
-    <p>Remove trailing white space from the fixtures YAML files.</p>
-
-    <p>
-    Recording can place trailing white space in the fixtures YAML files
-    which can be removed or ignored.
-    </p>
-
-    <p>There are many ways to accomplish this.</p>
-  </li>
-
-  <li>
     <p>Confirm all tests run in mock mode</p>
 
     <pre>
@@ -263,12 +193,12 @@ More information can be found on the pas
     # Run only the single tests that had been re-recorded
     % ruby tests/drivers/rhevm/instance_test.rb
 
-      and
+      <b>and</b>
 
     # Run all tests in that section:
     % rake test:drivers:rhevm
 
-      and
+      <b>and</b>
 
     # Record all the tests:
     % rake test