mozilla

Compare Revisions

Marionette

Change Revisions

Revision 450313:

Revision 450313 by automatedtester on

Revision 451015:

Revision 451015 by mdas on

Title:
Marionette
Marionette
Slug:
Marionette/Marionette
Marionette/Marionette
Content:

Revision 450313
Revision 451015
t1575    <h2 id="Performance">t
1576      Performance
1577    </h2>
1578    <h3 id="log()" name="log()">
1579      add_perf_data(suite, name, value)
1580    </h3>
1581    <p>
1582      Add a (name, value) datapoint to a test suite.
1583    </p>
1584    <h5 id="Parameters">
1585      Parameters
1586    </h5>
1587    <p>
1588      <strong>suite</strong> - Name of the testsuite this datapoi
>nt will get rolled into 
1589    </p>
1590    <p>
1591      <strong>name</strong> - Name of the current test
1592    </p>
1593    <p>
1594      <strong>value</strong> - some numeric value for the test
1595    </p>
1596    <h5 id="Return_value">
1597      Return value
1598    </h5>
1599    <p>
1600      None
1601    </p>
1602    <h5 id="Example">
1603      Example
1604    </h5>
1605    <pre class="brush: python">
1606class TestSomething(MarionetteTestCase):
1607 
1608    def test_foo(self):
1609        #add data to testsuite
1610        self.marionette.add_perf_data("mySuite", "myTest", 50)
1611        #add more data to the same test in the same suite
1612        self.marionette.add_perf_data("mySuite", "myTest", 83)
1613        #add a new test datapoint to the test suite
1614        self.marionette.add_perf_data("mySuite", "myOtherTest", 9
>00) 
1615        #add data to a new testsuite
1616        self.marionette.add_perf_data("mySecondSuite", "whooTesti
>ng", 89) 
1617</pre>
1618    <h5 id="Parameters">
1619      Parameters
1620    </h5>
1621    <h3 id="get_logs()" name="get_logs()">
1622      get_perf_data()
1623    </h3>
1624    <p>
1625      Get all test data from the test in a dict.
1626    </p>
1627    <h5 id="Parameters">
1628      Parameters
1629    </h5>
1630    <p>
1631      None
1632    </p>
1633    <h5 id="Return_value">
1634      Return value
1635    </h5>
1636    <p>
1637      Dict of testsuite to datapoints. A clear example is below.
1638    </p>
1639    <h5 id=" __Example">
1640      <br>
1641      Example
1642    </h5>
1643    <p>
1644      Using the same code as the add_perf_data example above:
1645    </p>
1646    <pre class="brush: python">
1647class TestSomething(MarionetteTestCase):
1648 
1649    def test_foo(self):
1650        #add data to testsuite
1651        self.marionette.add_perf_data("mySuite", "myTest", 50)
1652        #add more data to the same test in the same suite
1653        self.marionette.add_perf_data("mySuite", "myTest", 83)
1654        #add a new test datapoint to the test suite
1655        self.marionette.add_perf_data("mySuite", "myOtherTest", 9
>00) 
1656        #add data to a new testsuite
1657        self.marionette.add_perf_data("mySecondSuite", "whooTesti
>ng", 89) 
1658        
1659        #retrieve this data:
1660        print self.marionette.get_perf_data()
1661        
1662        """
1663        
1664        you should see: 
1665        
1666        {u'mySecondSuite': 
1667                          {u'whooTesting': [89]}, 
1668         u'mySuite': 
1669                    {u'myTest': [50, 83],
1670                     u'myOtherTest': [900]}
1671        }
1672         
1673        """
1674</pre>

Back to History