Skip to content

Commit

Permalink
add workflow for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jul 20, 2023
1 parent f653d30 commit 9794b7d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Integration Tests"

on:
pull_request:
push:

jobs:
test-integration:
name: "Pytest Integration"
runs-on: ubuntu-latest
steps:
- name: "Checkout Infrastructure"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Nebari
run: |
pip install .[dev]
conda install --quiet --yes conda-build
- name: Integration Tests
run: |
pytest --version
pytest tests_integration -vvv
env:
NEBARI_K8S_VERSION: 1.24.13-do.0
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
NEBARI_K8S_VERSION: ${{ secrets.NEBARI_K8S_VERSION }}
SPACES_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}
SPACES_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
10 changes: 8 additions & 2 deletions tests_integration/deployment_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def random_letters(length=5):


def get_or_create_deployment_directory(cloud):
deployment_dirs = list(Path(Path(DEPLOYMENT_DIR) / cloud).glob("pytest{cloud}*"))
deployment_dirs = list(Path(Path(DEPLOYMENT_DIR) / cloud).glob(f"pytest{cloud}*"))
if deployment_dirs:
deployment_dir = deployment_dirs[0]
else:
Expand All @@ -44,15 +44,21 @@ def get_or_create_deployment_directory(cloud):
return deployment_dir


def set_do_environment():
os.environ['AWS_ACCESS_KEY_ID'] = os.environ['SPACES_ACCESS_KEY_ID']
os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ['SPACES_SECRET_ACCESS_KEY']


@pytest.fixture(scope="session")
def deploy(request):
ignore_warnings()
cloud = request.param
set_do_environment()
deployment_dir = get_or_create_deployment_directory(cloud)
config = render_config_partial(
project_name=deployment_dir.name,
namespace="dev",
nebari_domain=f"{cloud}.nebari.dev",
nebari_domain=f"ci-{cloud}.nebari.dev",
cloud_provider=cloud,
ci_provider="github-actions",
auth_provider="github",
Expand Down

0 comments on commit 9794b7d

Please sign in to comment.