Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing SaaS Connector Tests #1

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 2 additions & 196 deletions .github/workflows/backend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
# NOTE: These are the currently supported/tested Python Versions
python_version: ["3.8.14", "3.9.14", "3.10.7"]
python_version: ["3.10.7"]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -67,211 +67,17 @@ jobs:
path: /tmp/python-${{ matrix.python_version }}.tar
retention-days: 1

###################
## Static Checks ##
###################
Static-Checks:
strategy:
matrix:
session_name:
["isort", "black", "mypy", "pylint", "xenon", "check_install"]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"

- name: Install Nox
run: pip install nox>=2022

- name: Run Static Check
run: nox -s ${{ matrix.session_name }}

#################
## Misc Checks ##
#################
Misc-Tests:
needs: Build
strategy:
matrix:
test_selection:
- "check_fides_annotations"
- "fides_db_scan"
- "docs_check"
- "minimal_config_startup"

runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
steps:
- name: Download container
uses: actions/download-artifact@v3
with:
name: python-${{ env.DEFAULT_PYTHON_VERSION }}
path: /tmp/

- name: Load image
run: docker load --input /tmp/python-${{ env.DEFAULT_PYTHON_VERSION }}.tar

- name: Checkout
uses: actions/checkout@v3

- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"

- name: Install Nox
run: pip install nox>=2022

- name: Run test suite
run: nox -s "${{ matrix.test_selection }}"

################
## Safe Tests ##
################
Safe-Tests:
needs: Build
strategy:
matrix:
python_version: ["3.8.14", "3.9.14", "3.10.7"]
test_selection:
- "ctl-not-external"
- "ops-unit"
- "ops-integration"
- "lib"

runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
steps:
- name: Download container
uses: actions/download-artifact@v3
with:
name: python-${{ matrix.python_version }}
path: /tmp/

- name: Load image
run: docker load --input /tmp/python-${{ matrix.python_version }}.tar

- name: Checkout
uses: actions/checkout@v3

- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
cache: "pip"

- name: Install Nox
run: pip install nox>=2022

- name: Run test suite
run: nox -s "pytest(${{ matrix.test_selection }})"

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

##################
## Unsafe Tests ##
##################
# NOTE: Matrixes aren't used here due to the danger of race conditions for external resources

Pytest-Ctl-External:
needs: Build
strategy:
max-parallel: 1 # This prevents collisions in shared external resources
matrix:
python_version: ["3.8.14", "3.9.14", "3.10.7"]
runs-on: ubuntu-latest
timeout-minutes: 20
# In PRs run with the "unsafe" label, or run on a "push" event to main
if: contains(github.event.pull_request.labels.*.name, 'run unsafe ci checks') || github.event_name == 'push'
steps:
- name: Download container
uses: actions/download-artifact@v3
with:
name: python-${{ matrix.python_version }}
path: /tmp/

- name: Load image
run: docker load --input /tmp/python-${{ matrix.python_version }}.tar

- name: Checkout
uses: actions/checkout@v3

- name: Install Nox
run: pip install nox>=2022

- name: Run external test suite
run: nox -s "pytest(ctl-external)"
env:
SNOWFLAKE_FIDESCTL_PASSWORD: ${{ secrets.SNOWFLAKE_FIDESCTL_PASSWORD }}
REDSHIFT_FIDESCTL_PASSWORD: ${{ secrets.REDSHIFT_FIDESCTL_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_FIDESCTL_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_FIDESCTL_ACCESS_KEY }}
OKTA_CLIENT_TOKEN: ${{ secrets.OKTA_FIDESCTL_CLIENT_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
BIGQUERY_CONFIG: ${{ secrets.BIGQUERY_CONFIG }}

External-Datastores:
needs: Build
strategy:
max-parallel: 1 # This prevents collisions in shared external resources
matrix:
python_version: ["3.8.14", "3.9.14", "3.10.7"]
runs-on: ubuntu-latest
timeout-minutes: 20
# In PRs run with the "unsafe" label, or run on a "push" event to main
if: contains(github.event.pull_request.labels.*.name, 'run unsafe ci checks') || github.event_name == 'push'
steps:
- name: Download container
uses: actions/download-artifact@v3
with:
name: python-${{ matrix.python_version }}
path: /tmp/

- name: Load image
run: docker load --input /tmp/python-${{ matrix.python_version }}.tar

- name: Checkout
uses: actions/checkout@v3

- name: Install Nox
run: pip install nox>=2022

- name: Integration Tests (External)
env:
REDSHIFT_TEST_URI: ${{ secrets.REDSHIFT_TEST_URI }}
REDSHIFT_TEST_DB_SCHEMA: fidesops_test
BIGQUERY_KEYFILE_CREDS: ${{ secrets.BIGQUERY_KEYFILE_CREDS }}
BIGQUERY_DATASET: fidesopstest
SNOWFLAKE_TEST_URI: ${{ secrets.SNOWFLAKE_TEST_URI }}
run: nox -s "pytest(ops-external-datastores)"

External-SaaS-Connectors:
needs: Build
runs-on: ubuntu-latest
timeout-minutes: 20
# In PRs run with the "unsafe" label, or run on a "push" event to main
if: contains(github.event.pull_request.labels.*.name, 'run unsafe ci checks') || github.event_name == 'push'
permissions:
contents: read
id-token: write
strategy:
max-parallel: 1 # This prevents collisions in shared external resources
matrix:
python_version: ["3.8.14", "3.9.14", "3.10.7"]
python_version: ["3.10.7"]
steps:
- name: Download container
uses: actions/download-artifact@v3
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/cli_checks.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

Loading