# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

unit-tests:
  image: hyperledger/fabric-testenv
  links:
    - couchdb
  environment:
    - GO_TAGS
    - OUTPUT
    - TEST_PKGS=${TEST_PKGS}
    - CORE_VM_DOCKER_ATTACHSTDOUT=true
    - VERBOSE
    - JOB_TYPE=${JOB_TYPE}
    - COUCHDB_ADDR=couchdb:5984
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - ${GOPATH}/src/github.com/hyperledger/fabric:/opt/gopath/src/github.com/hyperledger/fabric
  command: ./unit-test/run.sh

couchdb:
  container_name: couchdb
  image: hyperledger/fabric-couchdb
  log_driver: none
  ports:
    - "5984:5984"

