github.com/simranvc/fabric-ca@v0.0.0-20191030094829-acc364294dde/scripts/run_unit_tests (about)

     1  #!/bin/bash
     2  #
     3  # Copyright IBM Corp. All Rights Reserved.
     4  #
     5  # SPDX-License-Identifier: Apache-2.0
     6  #
     7  FCA=$GOPATH/src/github.com/hyperledger/fabric-ca
     8  
     9  echo "Running unit tests ..."
    10  {
    11  export PATH=$PATH:$GOPATH/bin
    12  
    13  go get github.com/axw/gocov/...
    14  go get github.com/AlekSi/gocov-xml
    15  
    16  # Skipping /lib/common package as there is only one file that contains request/response structs used by both client and server. It needs to be removed from exclude package list
    17  # when code is added to this package
    18  # Skipping credential package as there is only one file that contains Credential interface definition. It needs to be removed from exclude package list when code is added to this package
    19  PKGS=`go list github.com/hyperledger/fabric-ca/... | grep -Ev '/vendor/|/api|/dbutil|integration|/ldap|/mocks|/test/fabric-ca-load-tester|/fabric-ca-client$|/credential$|/lib/common$|/metrics'`
    20  
    21  gocov test -timeout 15m $PKGS | gocov-xml > coverage.xml
    22  
    23  } 2>&1 | tee /tmp/test.results
    24  echo "Finished running all tests"
    25  
    26  $FCA/scripts/check_test_results /tmp/test.results
    27  
    28  exit $?