Changes between Version 2 and Version 3 of Ticket #4218


Ignore:
Timestamp:
Aug 9, 2009, 5:57:03 PM (15 years ago)
Author:
Garry Yao
Comment:

Update description according to implementation:

  1. Rename 'runner' to 'fort' for disambiguation;
  2. Adding 'running mode' concepts of cell;
  3. Simplify 'criteria' pattern;
  4. Adding 'cell shortcut' concept;

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4218 – Description

    v2 v3  
    1 CKTester is our internal universal testing forge, it should be capable of running tests for different projects
     1CKTester is our internal universal testing swarm, it should be capable of running tests for different projects
    22with different testing tools easily while remain simplicity, below are some basic ideas of the project
    33based on the previous effort on 'FCKtest'. [[BR]]
     
    55=== Test Cell ===
    66A '''test cell''' is basically a plain html file reside in individual project's testing source, in which test suites/test cases
    7 are written. It'll be executed inside an iframe/popup of the runner page so '''full page life cycle'''
     7are written. It'll be executed inside an iframe/popup of the fort so '''full page life cycle'''
    88( from page load to page destroy ) is guaranteed when performing the test.[[BR]]
    99
    10 Each cell has only key responsibility of '''reporting''' the sucess/failure/time of it's execution to the runner, this is
    11 done by cross-frame communication with parent runner window.[[BR]]
     10Each cell has only key responsibility of '''reporting''' the sucess/failure/time of it's execution to the fort, this is
     11done by cross-frame communication with parent/opener window.[[BR]]
    1212
    13 The cell's testing environment, including testing target, runtime libraries, etc. will be all injected by it's belonging
    14 runner, initiatively or passively, the only required effort in the cell is to include the bootstrap file.
     13The cell's testing environment, including testing target, runtime libraries, etc. will be all injected by the fort,
     14initiatively or passively, the only required effort in the cell is to include the bootstrap file.
    1515{{{
    16 <script type="text/javascript" src="{path-to-runner}/bootstrap.js"></script>
     16<script type="text/javascript" src="{CKTester_ROOT}/bootstrap.js"></script>
    1717}}}
    18 It could choose to manually pull in resources provided by the runner also,
    19 e.g. A cell want to load an testing target manually, it could have:
    20 {{{
    21 <script type="text/javascript" src="../../bootstrap.js"></script>
    22 <script type="text/javascript">
    23         CKTester.require( '${myProjectRoot}/myTarget.js' );     // inline variable ${myProjectRoot}
    24 </script>
    25 }}}
    26 Note that inline variables like above used in the path are not determined by the runner but are defined in '''testing profile''' which know well about the
    27 testing stage( target ) location.
     18
     19A cell could be running in '''two modes''':
     20 1. Managed Mode : It's the default mode when it's running in a batch of cells by the forge, where the cell is running in an iframe.
     21 2. Standalone Mode : This mode is adapted when a cell is running separately, on the opposite of 'Managed Mode', the cell will be running inside a popup window, and it doesn't require to report to the fort.
    2822
    2923=== Profile ===
    3024A '''tests profile''' is a js file contains information about running a bunch of test cells.
    3125It a function declaration which return a configuration object, contains:
    32  1. Cell variables : A object contains key/value pair definition of variables which are to be used by individual test cell when communicating  with runner.
    33  1. Cells list : A list of key/values as:
    34   * Key : The test cell html '''file path''', with each directory within the path is resolved as a tag;
     26 1. Cell variables : An hash of variable names and their values which are often embeded in profile paths to indicate location.
     27 1. Cells list : A list of key/values:
     28  * Key : The test cell '''file path''', where all the paths are relative to the runner;
    3529  * Value :  An array of '''tags'''.
    36 It will basically looks like:
     30 1. Cell resolvers : An array of function which were used to manipulate each cell's attributes at run-time, e.g. Inject necessary dependencies for
     31  cells when encounter certain tags. Note that The fort already has a few default resolvers, usages including : converting the cell path to tags; calculate resource path for each cell, etc.
     32A profile will basically looks like:
    3733{{{
    3834        CKTester.profile = function ()
     
    4036                return
    4137                {
    42                         variables : [ [ 'ckeditorRoot', 'path-to-CKEditor-root'] ],
     38                        variables : { 'CKEDITOR_ROOT' : 'path-to-editor-root' },
    4339                        cells : [
    44                                 [ 'tt/unit/htmldataprocessor/1' ],      // Implicit tags declaration by file path.
    45                                 [ 'ckeditor/3210.html' , [ 'ticket', 'unit', 'htmldataprocessor'] ] // Explicit tag declaration.
     40                                [ 'editor/tt/unit/plugins/htmldataprocessor/1' ],               // Implicit tag declaration.
     41                                [ '3210.html' , [ 'tt', 'unit', 'htmldataprocessor'] ] // Explicit tag declaration.
    4642                        ]
     43                        cellResolvers : [ ... ]
    4744                };
    4845        }
    4946}}}
    50 The '''tag''' plays an important role as an identifier to denote the following aspects of a test cell:
    51  1. Environments of the cell, e.g. if it has tags 'unit' and 'editor', it denote a unit test running by YUITest, along with the CKEditor testing stage is required to run the test.
    52  2. Categories of the cell, when it's been run in a runner with a specific criteria. E.g. A url criteria as 'http://t/runner?cells=tt,plugins' will run only the ticket test of plugins ( with 'ticket' and 'plugins' tags ).
     47
     48It's important to note that '''tag''' plays an important role as the following indicators:
     49 1. Environments( dependencies ) of a cell, e.g. if the cell has tags 'unit' and 'editor', it denote a unit test running by YUITest, along with the CKEditor testing stage is required to run the test;
     50 2. Categories of the cell, when it's been run in a runner with a specific criteria. E.g. A url criteria as 'http://t/runner?cells=tt,plugins' will run only the tests of category 'ticket' and 'plugins' ( with 'ticket' and 'plugins' tags );
     51 3. Any reasonable denotation.
    5352
    5453
    55 === Runner ===
    56 Test runner is bridge between the testing tools/framework ( e.g. Selenium ) underneath,
    57 and the testing resources( our various test cases ), it's resided in CKTester project.
     54=== Fort ===
     55The '''Test Fort''' is a bridge between the runner tools/framework ( e.g. Selenium ) underneath, and the testing resources, so it's above the level of any TC or TS. It's resided in CKTester project.[[BR]]
    5856
    59 The runner is responsible for delegating the running of all the tests to the under-laying tools/framework and collect
     57The fort is responsible for delegating the running of all the tests to the under-laying tools/framework and collecting
    6058the testing result neutrally. It consist of a UI to interact with and providing report.
    6159
    62 The runner is required to be running with a specified profile, from which it will register all the defined tests cells .
    63 Upon requesting by a specific '''testing criteria''' on running, it should filtering down the registered cells
     60The runner is required to be running with a specified profile, from which it will register all the defined tests cells in it.
     61Upon requesting by a specific '''criteria''' on running, it filtering down the registered cells
    6462to only execute the satisfied ones.
    6563
    66 Before runner execute each test cell, an extensible '''environment resolver''' is running there to determinate the required/requested
     64Generally, before runner execute each test cell, an extensible '''cell resolver''' is working out the required/requested
    6765resources of a specific cell by analysing the '''tags''', guarantee the cell always has all the dependencies
    6866it should receive. These resources are typically
     
    7068   * The testing target
    7169   * The testing library
    72    * Any resources dedicate the one kind of test   
     70   * Any resources dedicated to the cell.
    7371
    7472=== Testing Request ===
    75 A request is simply a loading of the runner page, which is the beginning of the testing life cycle.
    76  1. The request must contains a profile param in the url to specify the location of profile of this running.
    77  1. The request could optionally consist of a criteria which is a list of '''tags''' or '''path''' to filter down the test cells to run, could be
    78 specified via :
    79  * A ampersand separated url params;
    80  * A predefined JSON file denote the criteria;
     73A request is simply a page load of the fort, which form the begin of the testing life cycle.
     74 1. The request must use url param to specify the location of profile file relative of the fort.
     75 1. The request url could optionally consist of a criteria which is a list of '''tags''' or '''path''' to filter the test cells to run, it could be
     76specified in various ways:
     77 * A comma separated param in URL;
    8178 * Specified through UI of the test runner page;
    82 Some example testing requests look like:
    83  * Running only the tickets test of unit test : http://t/runner.html?profile=../profile.js&cells=tt,unit
    84  * Running a specific test : http://t/runner.html?profile=../profile.js&cells=../editor/tt/unit/htmldataprocessor/1
    85  * Running two specific tests : http://t/runner.html?profile=../profile.js&cells=../editor/tt/unit/htmldataprocessor/1,../editor/dd/selenium/visual/1
    86 
     79Some example testing requests look like ( I've remove the 'profile' param for clear understanding ):
     80 * Running only the ticket tests of unit test type: http://t/fort.html?cells=tt,unit
     81 * Running all the '''stable''' tests : http://t/fort.html?cells=stable
     82 * Running two specific tests : http://t/fort.html?cells=../editor/tt/unit/htmldataprocessor/1,../editor/dd/selenium/visual/1 [[BR]]
     83   Note that since it's not convenient to specify a cell path within URL, it's a shortcut that open the cell url directly would have it redirect to correct url back to the forge.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy