github.com/m3db/m3@v1.5.0/scripts/docker-integration-tests/prom_remote_write_backend/test.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -xe
     4  
     5  M3_PATH=${M3_PATH:-$GOPATH/src/github.com/m3db/m3}
     6  TESTDIR="$M3_PATH"/scripts/docker-integration-tests/
     7  REVISION=$(git rev-parse HEAD)
     8  export REVISION
     9  COMPOSE_FILE="$TESTDIR"/prom_remote_write_backend/docker-compose.yml
    10  PROMREMOTECLI_IMAGE=quay.io/m3db/prometheus_remote_client_golang:v0.4.3
    11  TEST_SUCCESS=false
    12  
    13  source "$TESTDIR"/common.sh
    14  source "$TESTDIR"/prom_remote_write_backend/utils.sh
    15  source "$TESTDIR"/prom_remote_write_backend/tests.sh
    16  
    17  echo "Pull containers required for test"
    18  docker pull $PROMREMOTECLI_IMAGE
    19  
    20  trap 'cleanup ${COMPOSE_FILE} ${TEST_SUCCESS}' EXIT
    21  
    22  echo "Run ETCD"
    23  docker-compose -f "${COMPOSE_FILE}" up -d etcd01
    24  
    25  echo "Run Coordinator in Admin mode"
    26  docker-compose -f "${COMPOSE_FILE}" up -d coordinatoradmin
    27  wait_until_ready "0.0.0.0:7201"
    28  
    29  initialize_m3_via_coordinator_admin
    30  
    31  echo "Run M3 containers"
    32  docker-compose -f "${COMPOSE_FILE}" up -d m3aggregator01
    33  docker-compose -f "${COMPOSE_FILE}" up -d m3aggregator02
    34  docker-compose -f "${COMPOSE_FILE}" up -d m3coordinator01
    35  
    36  echo "Start Prometheus containers"
    37  docker-compose -f "${COMPOSE_FILE}" up -d prometheusraw
    38  docker-compose -f "${COMPOSE_FILE}" up -d prometheusagg
    39  
    40  wait_until_leader_elected
    41  wait_until_ready "0.0.0.0:7202"
    42  
    43  echo "Running tests"
    44  
    45  test_prometheus_remote_write_multi_namespaces
    46  
    47  TEST_SUCCESS=true