Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit770412a

Browse files
Jessesaishreeeee
Jesse
authored andcommitted
Set up github actions + remove databricks-specific test infra (#3)
* Remove databricks-specific test fixtures* Introduce pytest, black, and mypy workflows* Skip test_fetches_bench case* Remove references to databricks-specific testing infraSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent534555f commit770412a

File tree

11 files changed

+152
-75
lines changed

11 files changed

+152
-75
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name:Code Quality Checks
2+
on:[push]
3+
jobs:
4+
run-tests:
5+
runs-on:ubuntu-latest
6+
steps:
7+
#----------------------------------------------
8+
# check-out repo and set-up python
9+
#----------------------------------------------
10+
-name:Check out repository
11+
uses:actions/checkout@v2
12+
-name:Set up python
13+
id:setup-python
14+
uses:actions/setup-python@v2
15+
with:
16+
python-version:3.7
17+
#----------------------------------------------
18+
# ----- install & configure poetry -----
19+
#----------------------------------------------
20+
-name:Install Poetry
21+
uses:snok/install-poetry@v1
22+
with:
23+
virtualenvs-create:true
24+
virtualenvs-in-project:true
25+
installer-parallel:true
26+
27+
#----------------------------------------------
28+
# load cached venv if cache exists
29+
#----------------------------------------------
30+
-name:Load cached venv
31+
id:cached-poetry-dependencies
32+
uses:actions/cache@v2
33+
with:
34+
path:.venv
35+
key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
36+
#----------------------------------------------
37+
# install dependencies if cache does not exist
38+
#----------------------------------------------
39+
-name:Install dependencies
40+
if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
41+
run:poetry install --no-interaction --no-root
42+
#----------------------------------------------
43+
# install your root project, if required
44+
#----------------------------------------------
45+
-name:Install library
46+
run:poetry install --no-interaction
47+
#----------------------------------------------
48+
# run test suite
49+
#----------------------------------------------
50+
-name:Run tests
51+
run:poetry run pytest tests/
52+
check-linting:
53+
runs-on:ubuntu-latest
54+
steps:
55+
#----------------------------------------------
56+
# check-out repo and set-up python
57+
#----------------------------------------------
58+
-name:Check out repository
59+
uses:actions/checkout@v2
60+
-name:Set up python
61+
id:setup-python
62+
uses:actions/setup-python@v2
63+
with:
64+
python-version:3.7
65+
#----------------------------------------------
66+
# ----- install & configure poetry -----
67+
#----------------------------------------------
68+
-name:Install Poetry
69+
uses:snok/install-poetry@v1
70+
with:
71+
virtualenvs-create:true
72+
virtualenvs-in-project:true
73+
installer-parallel:true
74+
75+
#----------------------------------------------
76+
# load cached venv if cache exists
77+
#----------------------------------------------
78+
-name:Load cached venv
79+
id:cached-poetry-dependencies
80+
uses:actions/cache@v2
81+
with:
82+
path:.venv
83+
key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
84+
#----------------------------------------------
85+
# install dependencies if cache does not exist
86+
#----------------------------------------------
87+
-name:Install dependencies
88+
if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
89+
run:poetry install --no-interaction --no-root
90+
#----------------------------------------------
91+
# install your root project, if required
92+
#----------------------------------------------
93+
-name:Install library
94+
run:poetry install --no-interaction
95+
#----------------------------------------------
96+
# black the code
97+
#----------------------------------------------
98+
-name:Black
99+
run:poetry run black --check src
100+
101+
check-types:
102+
runs-on:ubuntu-latest
103+
steps:
104+
#----------------------------------------------
105+
# check-out repo and set-up python
106+
#----------------------------------------------
107+
-name:Check out repository
108+
uses:actions/checkout@v2
109+
-name:Set up python
110+
id:setup-python
111+
uses:actions/setup-python@v2
112+
with:
113+
python-version:3.7
114+
#----------------------------------------------
115+
# ----- install & configure poetry -----
116+
#----------------------------------------------
117+
-name:Install Poetry
118+
uses:snok/install-poetry@v1
119+
with:
120+
virtualenvs-create:true
121+
virtualenvs-in-project:true
122+
installer-parallel:true
123+
124+
#----------------------------------------------
125+
# load cached venv if cache exists
126+
#----------------------------------------------
127+
-name:Load cached venv
128+
id:cached-poetry-dependencies
129+
uses:actions/cache@v2
130+
with:
131+
path:.venv
132+
key:venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }}
133+
#----------------------------------------------
134+
# install dependencies if cache does not exist
135+
#----------------------------------------------
136+
-name:Install dependencies
137+
if:steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
138+
run:poetry install --no-interaction --no-root
139+
#----------------------------------------------
140+
# install your root project, if required
141+
#----------------------------------------------
142+
-name:Install library
143+
run:poetry install --no-interaction
144+
#----------------------------------------------
145+
# black the code
146+
#----------------------------------------------
147+
-name:Mypy
148+
run:poetry run mypy src

‎python-37-slim-buster.dockerfile‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎test-container-with-reqs.dockerfile‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎tests/docker-run-unit.sh‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎tests/test_fetches.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
classFetchTests(unittest.TestCase):
1111
"""
12-
Unit tests for checking the fetch logic. See
13-
qa/test/cmdexec/python/suites/simple_connection_test.py for integration tests that
14-
interact with the server.
12+
Unit tests for checking the fetch logic.
1513
"""
1614

1715
@staticmethod

‎tests/test_fetches_bench.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importpyarrowaspa
55
importuuid
66
importtime
7+
importpytest
78

89
importdatabricks.sql.clientasclient
910
fromdatabricks.sql.utilsimportExecuteResponse,ArrowQueue
@@ -39,6 +40,7 @@ def make_dummy_result_set_from_initial_results(arrow_table):
3940
forcol_idinrange(arrow_table.num_columns)]
4041
returnrs
4142

43+
@pytest.mark.skip(reason="Test has not been updated for latest connector API (June 2022)")
4244
deftest_benchmark_fetchall(self):
4345
print("preparing dummy arrow table")
4446
arrow_table=FetchBenchmarkTests.make_arrow_table(10,25000)

‎tests/tests.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919

2020
classClientTestSuite(unittest.TestCase):
2121
"""
22-
Unit tests for isolated client behaviour. See
23-
qa/test/cmdexec/python/suites/simple_connection_test.py for integration tests that
24-
interact with the server.
22+
Unit tests for isolated client behaviour.
2523
"""
2624

2725
PACKAGE_NAME="databricks.sql"

‎thrift_dbr_test/README.md‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎thrift_dbr_test/__init__.py‎

Whitespace-only changes.

‎thrift_dbr_test/thrift_basic_tests.py‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp