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