Compare commits

...

5 Commits

Author SHA1 Message Date
leahwicz
fc49828618 Adding job dependency and env secrets 2021-06-08 22:53:23 -04:00
leahwicz
611465b20c More indentation issues 2021-06-08 22:46:38 -04:00
leahwicz
8f4777db5a Fixed indentation 2021-06-08 22:44:24 -04:00
leahwicz
06d87c0fe4 Adding python matrix 2021-06-08 22:41:39 -04:00
leahwicz
00c0780b56 Adding postgres tests for mac 2021-06-08 22:27:32 -04:00

View File

@@ -40,13 +40,14 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.8'
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'
@@ -55,8 +56,17 @@ jobs:
- name: 'Run unit tests'
run: python -m tox -e py -- -v
PostgresIntegrationTest:
runs-on: 'windows-latest' #TODO: Add Mac support
PostgresIntegrationTest-Windows:
strategy:
matrix:
include:
- python-version: '3.6'
environment-version: 'py36-postgres'
- python-version: '3.7'
environment-version: 'py37-postgres'
- python-version: '3.8'
environment-version: 'py38-postgres'
runs-on: 'windows-latest'
environment: 'Postgres'
needs: UnitTest
steps:
@@ -81,21 +91,75 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.7'
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'
run: python -m pip install --upgrade pip && pip install tox
- name: 'Run integration tests'
run: python -m tox -e py-postgres -- -v -n4
run: python -m tox -e ${{ matrix.environment-version }} -- -v -n4
PostgresIntegrationTest-Mac:
strategy:
matrix:
include:
- python-version: '3.6'
environment-version: 'py36-postgres'
- python-version: '3.7'
environment-version: 'py37-postgres'
- python-version: '3.8'
environment-version: 'py38-postgres'
runs-on: 'macos-latest'
environment: 'Postgres'
needs: UnitTest
steps:
- uses: actions/checkout@v2
- name: Start PostgreSQL on MacOS
run: |
brew services start postgresql
echo "Check PostgreSQL service is running"
i=10
COMMAND='pg_isready'
while [ $i -gt 0 ]; do
echo "Check PostgreSQL service status"
eval $COMMAND && break
((i--))
if [ $i == 0 ]; then
echo "PostgreSQL service not ready, all attempts exhausted"
exit 1
fi
echo "PostgreSQL service not ready, wait 10 more sec, attempts left: $i"
sleep 10
done
- name: Create users and DBs
run: |
psql --command="CREATE USER root PASSWORD '$env:ROOT_PASSWORD'" --command="\du" postgres
createdb --owner=root dbt
PGPASSWORD=$env:ROOT_PASSWORD psql --username=root --host=localhost --list dbt
psql --command="CREATE USER noaccess PASSWORD '$env:NOACCESS_PASSWORD'" --command="\du" postgres
psql --command="grant all privileges on database dbt to noaccess" --command="\du" postgres
createdb --owner=root dbtMixedCase
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'
run: python -m pip install --upgrade pip && pip install tox
- name: 'Run integration tests'
run: tox -p -e ${{ matrix.environment-version }} -- -v -n4
# These three are all similar except secure environment variables, which MUST be passed along to their tasks,
# but there's probably a better way to do this!
SnowflakeIntegrationTest:
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8']
runs-on: ${{ matrix.os }}
environment: 'Snowflake'
needs: UnitTest
@@ -104,7 +168,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.7'
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'
@@ -130,6 +194,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8']
runs-on: ${{ matrix.os }}
environment: 'Bigquery'
needs: UnitTest
@@ -138,7 +203,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.7'
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'
@@ -154,6 +219,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8']
runs-on: ${{ matrix.os }}
environment: 'Redshift'
needs: UnitTest
@@ -162,7 +228,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2.2.2
with:
python-version: '3.7'
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: 'Install dependencies'