#!/bin/bash
set -e

export Environment=dev
export AWS_ACCESS_KEY_ID=dummy
export AWS_SECRET_ACCESS_KEY=dummy
export AWS_REGION=us-east-1
export SNOWFLAKE_ACCOUNT=nouser
export SNOWFLAKE_DATABASE=nopass
export SNOWFLAKE_KEY=bm93c2U=
export SNOWFLAKE_ROLE=nodb
export SNOWFLAKE_SCHEMA=noschema
export SNOWFLAKE_SCHEMA=noschema
export SNOWFLAKE_USER=noschema
export SNOWFLAKE_WAREHOUSE=noschema

echo 'Running linting...'
flake8 yt_conflict_elasticsearch/ tests/

#python -m pytest
echo 'Running testing...'
PYTHONDONTWRITEBYTECODE=1 COVERAGE_FILE=build/.coverage python -m pytest -v tests/ \
        -p no:cacheprovider \
        --cov yt_conflict_elasticsearch tests\
        --cov-report xml:build/coverage.xml \
        --cov-report term \
        --junitxml=build/pyunit.xml

