diff --git a/.github/workflows/test-overpass.yml b/.github/workflows/test-overpass.yml new file mode 100644 index 000000000..270ff5c2c --- /dev/null +++ b/.github/workflows/test-overpass.yml @@ -0,0 +1,29 @@ +name: overpass-test + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: + - overpass + # schedule: + + # # Run every Sunday at 6:05 am + # - cron: '5 6 * * 0' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + # Tests runner is functional + - name: Workflow test + run: echo Good morning! + + # Runs TestOverpass.py to check for API functionality + - name: Test Overpass + env: + OVERPASS_KEY: '${{ secrets.OVERPASS_API }}' + run: ../../emission/individual_tests/setup_overpass_tests.sh + diff --git a/emission/individual_tests/setup_overpass_tests.sh b/emission/individual_tests/setup_overpass_tests.sh new file mode 100644 index 000000000..b224bd4f8 --- /dev/null +++ b/emission/individual_tests/setup_overpass_tests.sh @@ -0,0 +1,29 @@ +#Set up the testing environment +# Using an automated install +cd /src/e-mission-server + +#set database URL using environment variable +echo ${DB_HOST} +if [ -z ${DB_HOST} ] ; then + local_host=`hostname -i` + sed "s_localhost_${local_host}_" conf/storage/db.conf.sample > conf/storage/db.conf +else + sed "s_localhost_${DB_HOST}_" conf/storage/db.conf.sample > conf/storage/db.conf +fi +cat conf/storage/db.conf + +echo "Setting up conda..." +source setup/setup_conda.sh Linux-x86_64 + +echo "Setting up the test environment..." +source setup/setup_tests.sh + +echo "Running tests..." +source setup/activate_tests.sh + +echo "Adding permissions for the runIntegrationTests.sh script" +chmod +x runIntegrationTests.sh +echo "Permissions added for the runIntegrationTests.sh script" + +set -e +PYTHONPATH=. python -m unittest emission/individual_tests/TestOverpass.py