#!/bin/bash
# This script is used for running the tests with proper arguments
# from within Jenkins

set -e
set -u
set -x

if [ -d /results ] ; then
  # Running from Jenkins (RW)
  RESULTS="/results"

  cd "/code"
else
  # Running locally in Docker
  RESULTS="$(pwd)/results"
  mkdir -p "${RESULTS}"
fi

RESULTS=${RESULTS} FORMAT=JUNIT ./run_tests.sh
WORKSPACE="${RESULTS}/tmp" py.test-3 --junit-xml="${RESULTS}/reports/test_dlgcnt.xml" ./tests/test_dlgcnt.py
