- Notifications
You must be signed in to change notification settings - Fork126
Set up github actions + remove databricks-specific test infra#3
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| name:Code Quality Checks | ||
| on:[push] | ||
| jobs: | ||
| run-tests: | ||
| runs-on:ubuntu-latest | ||
| steps: | ||
| #---------------------------------------------- | ||
| # check-out repo and set-up python | ||
| #---------------------------------------------- | ||
| -name:Check out repository | ||
| uses:actions/checkout@v2 | ||
| -name:Set up python | ||
| id:setup-python | ||
| uses:actions/setup-python@v2 | ||
| with: | ||
| python-version:3.7 | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. do we need to extend the test matrix to cover other supported versions? which versions do we officially support? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It's easy enough to duplicate this workflow for Python 3.8 through 3.10. I think to minimise duplication we can have one workflow that uses the latest version of python and another that uses the oldest version we support. | ||
| #---------------------------------------------- | ||
| # ----- install & configure poetry ----- | ||
| #---------------------------------------------- | ||
| -name:Install Poetry | ||
| uses:snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create:true | ||
| virtualenvs-in-project:true | ||
| installer-parallel:true | ||
| #---------------------------------------------- | ||
| # load cached venv if cache exists | ||
| #---------------------------------------------- | ||
| -name:Load cached venv | ||
| id:cached-poetry-dependencies | ||
| uses:actions/cache@v2 | ||
| with: | ||
| path:.venv | ||
| key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| #---------------------------------------------- | ||
| # install dependencies if cache does not exist | ||
| #---------------------------------------------- | ||
| -name:Install dependencies | ||
| if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| run:poetry install --no-interaction --no-root | ||
| #---------------------------------------------- | ||
| # install your root project, if required | ||
| #---------------------------------------------- | ||
| -name:Install library | ||
| run:poetry install --no-interaction | ||
| #---------------------------------------------- | ||
| # run test suite | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @susodapop
let's say we have a bug in packaging of the connector, that bug will be discovered if we do 1) but not if we do 2). I wonder which approach we are doing? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Actually it's a combination of both. Since we are now using I believe we're safe on this front. | ||
| #---------------------------------------------- | ||
| -name:Run tests | ||
| run:poetry run pytest tests/ | ||
| check-linting: | ||
| runs-on:ubuntu-latest | ||
| steps: | ||
| #---------------------------------------------- | ||
| # check-out repo and set-up python | ||
| #---------------------------------------------- | ||
| -name:Check out repository | ||
| uses:actions/checkout@v2 | ||
| -name:Set up python | ||
| id:setup-python | ||
| uses:actions/setup-python@v2 | ||
| with: | ||
| python-version:3.7 | ||
| #---------------------------------------------- | ||
| # ----- install & configure poetry ----- | ||
| #---------------------------------------------- | ||
| -name:Install Poetry | ||
| uses:snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create:true | ||
| virtualenvs-in-project:true | ||
| installer-parallel:true | ||
| #---------------------------------------------- | ||
| # load cached venv if cache exists | ||
| #---------------------------------------------- | ||
| -name:Load cached venv | ||
| id:cached-poetry-dependencies | ||
| uses:actions/cache@v2 | ||
| with: | ||
| path:.venv | ||
| key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| #---------------------------------------------- | ||
| # install dependencies if cache does not exist | ||
| #---------------------------------------------- | ||
| -name:Install dependencies | ||
| if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| run:poetry install --no-interaction --no-root | ||
| #---------------------------------------------- | ||
| # install your root project, if required | ||
| #---------------------------------------------- | ||
| -name:Install library | ||
| run:poetry install --no-interaction | ||
| #---------------------------------------------- | ||
| # black the code | ||
| #---------------------------------------------- | ||
| -name:Black | ||
| run:poetry run black --check src | ||
| check-types: | ||
| runs-on:ubuntu-latest | ||
| steps: | ||
| #---------------------------------------------- | ||
| # check-out repo and set-up python | ||
| #---------------------------------------------- | ||
| -name:Check out repository | ||
| uses:actions/checkout@v2 | ||
| -name:Set up python | ||
| id:setup-python | ||
| uses:actions/setup-python@v2 | ||
| with: | ||
| python-version:3.7 | ||
| #---------------------------------------------- | ||
| # ----- install & configure poetry ----- | ||
| #---------------------------------------------- | ||
| -name:Install Poetry | ||
| uses:snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create:true | ||
| virtualenvs-in-project:true | ||
| installer-parallel:true | ||
| #---------------------------------------------- | ||
| # load cached venv if cache exists | ||
| #---------------------------------------------- | ||
| -name:Load cached venv | ||
| id:cached-poetry-dependencies | ||
| uses:actions/cache@v2 | ||
| with: | ||
| path:.venv | ||
| key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| #---------------------------------------------- | ||
| # install dependencies if cache does not exist | ||
| #---------------------------------------------- | ||
| -name:Install dependencies | ||
| if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| run:poetry install --no-interaction --no-root | ||
| #---------------------------------------------- | ||
| # install your root project, if required | ||
| #---------------------------------------------- | ||
| -name:Install library | ||
| run:poetry install --no-interaction | ||
| #---------------------------------------------- | ||
| # black the code | ||
| #---------------------------------------------- | ||
| -name:Mypy | ||
| run:poetry run mypy src | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,9 +9,7 @@ | ||
| class FetchTests(unittest.TestCase): | ||
| """ | ||
| Unit tests for checking the fetch logic. | ||
| """ | ||
| @staticmethod | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,6 +4,7 @@ | ||
| import pyarrow as pa | ||
| import uuid | ||
| import time | ||
| import pytest | ||
| import databricks.sql.client as client | ||
| from databricks.sql.utils import ExecuteResponse, ArrowQueue | ||
| @@ -39,6 +40,7 @@ def make_dummy_result_set_from_initial_results(arrow_table): | ||
| for col_id in range(arrow_table.num_columns)] | ||
| return rs | ||
| @pytest.mark.skip(reason="Test has not been updated for latest connector API (June 2022)") | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This test fails because this test file was not updated as the connector API changed. Unclear if we should just remove this test completely or update it. I didn't find any notes on this subject. Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @susodapop was there any breaking changes in the public API of the PySQL? Did we do breaking change as part of open sourcing? or the breaking change was introduced before that? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. From what I recall the test is broken because we changed the API and didn't update this test accordingly. Since I'm not familiar with what this test is meant to do orwhy it wasn't updated I don't have further context. | ||
| def test_benchmark_fetchall(self): | ||
| print("preparing dummy arrow table") | ||
| arrow_table = FetchBenchmarkTests.make_arrow_table(10, 25000) | ||
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.