github.com/kaituanwang/hyperledger@v2.0.1+incompatible/testingInfo.rst (about)

     1  Testing
     2  =======
     3  
     4  .. image:: ./test-pyramid.png
     5  
     6  
     7  Unit test
     8  ~~~~~~~~~
     9  See `building Hyperledger Fabric <http://hyperledger-fabric.readthedocs.io/en/latest/dev-setup/build.html>` for unit testing instructions.
    10  
    11  See `Unit test coverage reports <https://jenkins.hyperledger.org/view/fabric/job/fabric-merge-x86_64/>`__
    12  
    13  To see coverage for a package and all sub-packages, execute the test with the ``-cover`` switch:
    14  
    15  ::
    16  
    17      go test ./... -cover
    18  
    19  To see exactly which lines are not covered for a package, generate an html report with source
    20  code annotated by coverage:
    21  
    22  ::
    23  
    24      go test -coverprofile=coverage.out
    25      go tool cover -html=coverage.out -o coverage.html
    26  
    27  
    28  Integration test
    29  ~~~~~~~~~~~~~~~~
    30  See `Hyperledger Fabric Integration tests <https://github.com/hyperledger/fabric/blob/master/integration/README.rst>`__
    31  for Hyperledger Fabric integration test details.
    32  
    33  Integration tests cover testing between components, e.g., tests between peers and an orderer, and are used to
    34  show that a feature is working as expected across different interfaces. They ensure that components and
    35  systems work together as expected for a specific feature. Integration tests are validation tests that are not
    36  expected to stress the system. Test friendly configurations with real implementations should be used.
    37  Each user consumable feature should extend the suite of integration tests.  These tests use a small number of
    38  assets (eg. chaincode, peers, orgs) across multiple tests.
    39  
    40  Integration tests are in 2 categories: Component Integration and System Integration.
    41  
    42  Component integration tests could include some mocked interfaces as necessary. This form of integration tests can
    43  be used for negative testing and forced event testing.
    44  
    45  System integration tests use live builds and packages. These also have been referred to as end-to-end tests.
    46  
    47  Once system integration tests complete successfully, a CR may be merged to a repository.
    48  
    49  For more details on how to execute the integration tests, see the integration README.
    50  
    51  See `IT Daily Results <https://jenkins.hyperledger.org/view/Daily/>`__
    52  
    53  See `IT Weekly Results <https://jenkins.hyperledger.org/view/Weekly/>`__
    54  
    55  
    56  Interoperability test
    57  ~~~~~~~~~~~~~~~~~~~~~
    58  Interoperability tests are higher-level integration tests that span across repositories to test the compatibility
    59  between fabric, fabric-ca and fabric-sdk-*. This test suite contains a very limited number of tests, which are
    60  executed after a merge is performed in any of the repositories. These tests are not feature based and do not need
    61  to be updated often. They use a maximum number of assets in order to verify compatibility between commits. Once
    62  these Interoperability tests pass, a build combination is considered good and the new build artifacts may be
    63  published for use with other repositories.
    64  
    65  
    66  System test
    67  ~~~~~~~~~~~
    68  See `System Testing Hyperledger Fabric <https://github.com/hyperledger/fabric-test/blob/master/README.md>`__
    69  for details on system testing.
    70  
    71  System testing includes the following categories:
    72  * Scalability
    73  
    74  * Performance and Concurrency
    75  
    76  * Upgrades and Fallbacks
    77  
    78  * Long Running
    79  
    80  * Compatibility
    81  
    82  * Chaos and Recovery
    83  
    84  * Functional (only for regression purposes)
    85  
    86  See `SVT Daily Results <https://jenkins.hyperledger.org/view/fabric-test/job/fabric-test-daily-results-x86_64/test_results_analyzer/>`__
    87  
    88  See `SVT Weekly Results <https://jenkins.hyperledger.org/view/fabric-test/job/fabric-test-weekly-results-x86_64/test_results_analyzer/>`__
    89  
    90  See `SVT Performance Test Results Graphs With Testviewer <https://testviewer.mybluemix.net>`__
    91  
    92  See `SVT Performance TestViewer Details <https://github.com/hyperledger/fabric-test/blob/master/tools/Testviewer/README.md>`__
    93  
    94  
    95  .. Licensed under Creative Commons Attribution 4.0 International License
    96     https://creativecommons.org/licenses/by/4.0/