#!/bin/bash

# The AWS_DEFAULT_REGION parameter determines the region used for SWF
# Leaving it to a value different than "us-east-1" would break moto,
# because moto.swf only mocks calls to us-east-1 region for now.
unset AWS_DEFAULT_REGION

# Disable AWS credentials
# NB: we set them to wrong values so boto believes they're here, so it
# issues integration requests later caught by VCR. For more information
# see tests/integration/README.md
export AWS_ACCESS_KEY_ID=1234
export AWS_SECRET_ACCESS_KEY=1234

# Enable various test optimizations
export SIMPLEFLOW_ENV=test
export SIMPLEFLOW_CLEANUP_PROCESSES=yes

# Simple variable to control the number of connection retries
export SWF_CONNECTION_RETRIES=1

# Don't run real SWF requests if a cassette doesn't match
# See tests/integration/README.md for instructions about cassettes updating
export SIMPLEFLOW_VCR_RECORD_MODE=none

# Disable jumbo fields
export SIMPLEFLOW_JUMBO_FIELDS_BUCKET=""

# Prevent Travis from overriding boto configuration
export BOTO_CONFIG=/dev/null

PYTHON=${PYTHON:-python}
# run tests
$PYTHON -m pytest --no-success-flaky-report -q $PYTEST_OPTIONS "$@"
