Skip to content

Commit

Permalink
Adding shell script and workflow file
Browse files Browse the repository at this point in the history
Workflow file runs the shell script.

Shell script sets up emission environment and runs TestOverpass.py.
  • Loading branch information
nataliejschultz committed Feb 7, 2024
1 parent 7839951 commit b1b0698
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test-overpass.yml
Original file line number Diff line number Diff line change
@@ -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

29 changes: 29 additions & 0 deletions emission/individual_tests/setup_overpass_tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b1b0698

Please sign in to comment.