Skip to content

Commit

Permalink
clickhouse workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
neelasha23 committed Jan 24, 2024
1 parent 9701a11 commit 6831873
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci-integration-db-sqlalchemy-v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# CI - DB Integration - SqlAlchemy v1 is designed to run integration testing against SQLAlchemy v1.
# Target database: Clickhouse
# Sqlalchemy version: 1.4 (required by clickhouse-sqlalchemy)

name: CI - DB Integration - SQLAlchemy V1

on:
workflow_call:

jobs:
database-sqlalchemy-v1-integration-test:
strategy:
matrix:
python-version: ['3.11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

env:
PLOOMBER_VERSION_CHECK_DISABLED: true
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
if : ${{ steps.secret-check.outputs.available == 'true' }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}


- name: Install dependencies
run: |
nox --session test_integration_cloud --no-install --reuse-existing-virtualenvs
- name: Upload failed images artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: failed-image-artifacts-integration-live ${{ matrix.os }} ${{ matrix.python-version }}
path: result_images/
8 changes: 7 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ jobs:
fi
integration-test-sqlaclchemy-v1:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
uses: ./.github/workflows/ci-integration-db-sqlalchemy-v1.yaml
secrets: inherit

integration-test-non-live:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
Expand Down Expand Up @@ -191,7 +197,7 @@ jobs:
release:
needs: [test, test-sqlalchemy-v1, check, integration-test-non-live]
needs: [test, test-sqlalchemy-v1, check, integration-test-non-live, integration-test-sqlaclchemy-v1]
if: startsWith(github.ref, 'refs/tags') && github.event_name != 'pull_request'
runs-on: ubuntu-latest

Expand Down
27 changes: 26 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def test_unit_sqlalchemy_one(session):
SKIP_IMAGE_TEST = "--skip-image-tests" in session.posargs

_install(session, integration=False)
session.install("sqlalchemy<2")
session.install("sqlalchemy/")
_check_sqlalchemy(session, version=1)
_run_unit(session, skip_image_tests=SKIP_IMAGE_TEST)

Expand Down Expand Up @@ -147,6 +147,31 @@ def test_integration_cloud(session):
)


@nox.session(
venv_backend=VENV_BACKEND,
python=environ.get("PYTHON_VERSION", "3.11"),
)
def test_integration_cloud(session):
"""
Run integration tests on SQLAlchemy v1
(NOTE: the clickhouse-sqlalchemy driver only works with
SQLAlchemy 1.x)
"""

# tests
_install(session, integration=True)
session.install(
"clickhouse-sqlalchemy",
)
session.run(
"pytest",
"src/tests/integration",
"-k",
"clickhouse",
"-v",
)


@nox.session(
venv_backend=VENV_BACKEND,
python=environ.get("PYTHON_VERSION", "3.11"),
Expand Down

0 comments on commit 6831873

Please sign in to comment.