github.com/bestbeforetoday/fabric-ca@v2.0.0-alpha+incompatible/scripts/fvt/README.md (about)

     1  ##Fabric CA FVT tests for Continuous Integration<br>
     2  
     3  ###Building the test image
     4  The tests that will run are in  
     5  &nbsp;&nbsp;&nbsp;``$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt``  
     6  
     7  From ``${GOPATH}/src/github.com/hyperledger/fabric-ca``, issue  
     8  &nbsp;&nbsp;&nbsp;``make docker-fvt``  
     9  to generate the docker test image.
    10  
    11  You can verify the successful build of the test images by issuing  
    12  &nbsp;&nbsp;&nbsp;``docker images``  
    13  and look for the ``hyperledger/fabric-ca-fvt`` image in the output.  
    14  
    15  To remove build artifacts of the docker fvt test image, issue  
    16  &nbsp;&nbsp;&nbsp;``make docker-clean``<br>
    17  
    18  ###Running the fvt tests
    19  Once the test image is successfully built, from ``${GOPATH}/src/github.com/hyperledger/fabric-ca``, issue  
    20  &nbsp;&nbsp;&nbsp;``docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca hyperledger/fabric-ca-fvt``  
    21  By default, the resulting container will run ``scripts/run_fvt_tests`` in the environment provided by the hyperledger/fabric-ca-fvt docker image. Output will go to the associated terminal.<br>
    22  
    23  ###Interactively interfacing with the test container
    24  To start a command-line instance of the test container without automatically running the tests, issue  
    25  &nbsp;&nbsp;&nbsp;``docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca -ti hyperledger/fabric-ca-fvt bash``
    26  
    27  Since the source code is mounted from your host, you can make any changes you want, then manually issue ``make fvt-tests`` from inside the container.<br>
    28  
    29  ###Running continuous integration tests
    30  To simulate a continuous integration test run, issue:  
    31  &nbsp;&nbsp;&nbsp;``make ci-tests``  
    32  This will build a docker-fvt test image and run all of the currently defined unit tests, as well as all fvt tests.<br>
    33  
    34  ###Creating tests
    35  You may add additional tests (essentially any scripts or executables, in any language, that generates a return code and follows the naming convention `*test.sh`) by placing them in the ``$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt`` directory. You may invoke them directly within an interactive test container, or rely on the image's default command to succesively run all of the tests in the `$GOPATH/src/github.com/hyperledger/fabric-ca/scripts/fvt`` directory. Note that each test in the fvt directory will be run twice: once using TLS and once without using TLS. Consequently, the tests should be written to run in either environment.
    36  
    37  <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
    38  s