github.com/hyperledger/aries-framework-go@v0.3.2/scripts/check_js_integration.sh (about)

     1  #!/bin/bash
     2  #
     3  # Copyright SecureKey Technologies Inc. All Rights Reserved.
     4  #
     5  # SPDX-License-Identifier: Apache-2.0
     6  #
     7  set -e
     8  
     9  ROOT=`pwd`
    10  
    11  echo ""
    12  echo "Running aries-js-worker integration tests..."
    13  echo ""
    14  echo "----> packing aries-js-worker"
    15  echo ""
    16  cd $ROOT/cmd/aries-js-worker
    17  npm install
    18  npm link
    19  echo ""
    20  echo "----> setting up aries-js-worker tests"
    21  echo ""
    22  cd $ROOT/test/aries-js-worker
    23  npm install
    24  npm link @hyperledger/aries-framework-go
    25  echo ""
    26  echo "----> starting fixtures"
    27  echo ""
    28  cd $ROOT/test/aries-js-worker/fixtures
    29  docker-compose down --remove-orphans && docker-compose up -d
    30  echo ""
    31  echo "----> executing aries-js-worker tests"
    32  echo ""
    33  cd $ROOT/test/aries-js-worker
    34  command=$1
    35  if [ -z "$command" ]; then
    36      command=test
    37  fi
    38  # capture exit code if it fails
    39  npm run "$command" || code=$?
    40  if [ -z ${code+x} ]; then
    41    # set exit code because it did not fail
    42    code=0
    43  fi
    44  echo ""
    45  echo "----> stopping fixtures"
    46  echo ""
    47  cd $ROOT/test/aries-js-worker/fixtures
    48  docker-compose logs > docker-compose.log
    49  docker-compose stop
    50  cd $ROOT
    51  exit $code