diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml new file mode 100644 index 0000000000..1ac2a78d3f --- /dev/null +++ b/.github/workflows/integration_test.yaml @@ -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 }} diff --git a/tests_integration/deployment_fixtures.py b/tests_integration/deployment_fixtures.py index cc4ef129b1..e6ba9e93dc 100644 --- a/tests_integration/deployment_fixtures.py +++ b/tests_integration/deployment_fixtures.py @@ -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: @@ -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",