#!/usr/bin/env bash

_common_setup() {
  bats_load_library bats-support
  bats_load_library bats-assert
  bats_load_library bats-file

  load "$PWD/tests/integration/helpers/file"
  load "$PWD/tests/integration/helpers/app"
  load "$PWD/tests/integration/helpers/git"
  load "$PWD/tests/integration/helpers/recipe"
  load "$PWD/tests/integration/helpers/server"
  load "$PWD/tests/integration/helpers/docker"

  export ABRA="$PWD/abra"
  export KADABRA="$PWD/kadabra"

  export TEST_APP_NAME="$(basename "${BATS_TEST_FILENAME//./_}")"
  export TEST_APP_DOMAIN="$TEST_APP_NAME.$TEST_SERVER"
  export TEST_RECIPE="abra-test-recipe"

  _ensure_swarm
}
