github.com/49746628/fabric-ca-gm@v2.0.0-alpha.0.20200822143404-8a07eefa7452+incompatible/scripts/fvt/README.md (about)

     1  ## Fabric CA FVT tests for Continuous Integration
     2  
     3  ### Building the test image
     4  
     5  The tests scripts that will run are in `scripts/fvt`.
     6  
     7  From `${GOPATH}/src/github.com/hyperledger/fabric-ca`, issue `make docker-fvt`
     8  to generate the docker test image.  To remove build artifacts of the docker
     9  fvt test image, run `make docker-clean`.
    10  
    11  ### Running the fvt tests
    12  
    13  Once the test image is successfully built, execute
    14  
    15  ```sh
    16  docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca hyperledger/fabric-ca-fvt
    17  ```
    18  
    19  By default, the resulting container will run `scripts/run_fvt_tests` in the
    20  environment provided by the `hyperledger/fabric-ca-fvt` docker image. Output
    21  will go to the terminal.
    22  
    23  ### Interacting with the test container
    24  
    25  To start a command-line instance of the test container without automatically
    26  running the tests, issue
    27  
    28  ```sh
    29  docker run -v $PWD:/opt/gopath/src/github.com/hyperledger/fabric-ca -ti hyperledger/fabric-ca-fvt bash
    30  ```
    31  
    32  This mounts the source code from the host into the container. You can make any
    33  changes you want, then manually issue `make fvt-tests` from inside the
    34  container.
    35  
    36  ### Running All Tests
    37  
    38  To execute all of the tests that will run in CI, issue
    39  
    40  ```sh
    41  make all-tests fvt-tests
    42  ```
    43  
    44  This will build a docker-fvt test image and run all of the unit tests,
    45  integration tests, and fvt tests.
    46  
    47  ### Creating tests
    48  
    49  You may add additional tests (essentially any scripts or executables, in any
    50  language, that generates a return code and follows the naming convention
    51  `*test.sh`) by placing them in the `scripts/fvt` directory. You may invoke
    52  them directly within an interactive test container, or rely on the image's
    53  default command run all of the fvt tests.  Note that each test in the fvt
    54  directory will be run twice: once using TLS and once without using TLS.
    55  Consequently, the tests should be written to run in either environment.
    56  
    57  <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>.