Skip to content

Commit 1c3f0a7

Browse files
committed
CI: Enable testing for BigQuery
1 parent 8778285 commit 1c3f0a7

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,29 @@ jobs:
4242
- name: Install package
4343
run: "poetry install"
4444

45+
# BigQuery start
46+
- id: 'auth'
47+
uses: 'google-github-actions/auth@v1'
48+
with:
49+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
50+
51+
- name: 'Set up BigQuery Cloud SDK'
52+
uses: 'google-github-actions/setup-gcloud@v1'
53+
54+
# - name: 'Use gcloud CLI'
55+
# run: "gcloud config configurations list"
56+
57+
- name: "Install BigQuery for Python"
58+
run: poetry add google-cloud-bigquery
59+
60+
# BigQuery end
61+
4562
- name: Run unit tests
4663
env:
4764
DATADIFF_SNOWFLAKE_URI: '${{ secrets.DATADIFF_SNOWFLAKE_URI }}'
4865
DATADIFF_PRESTO_URI: '${{ secrets.DATADIFF_PRESTO_URI }}'
4966
DATADIFF_TRINO_URI: '${{ secrets.DATADIFF_TRINO_URI }}'
67+
DATADIFF_BIGQUERY_URI: '${{ secrets.DATADIFF_BIGQUERY_URI }}'
5068
DATADIFF_CLICKHOUSE_URI: 'clickhouse://clickhouse:Password1@localhost:9000/clickhouse'
5169
DATADIFF_VERTICA_URI: 'vertica://vertica:Password1@localhost:5433/vertica'
5270
run: |

.github/workflows/ci_full.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,30 @@ jobs:
3939
- name: Install package
4040
run: "poetry install"
4141

42+
# BigQuery start
43+
- id: 'auth'
44+
uses: 'google-github-actions/auth@v1'
45+
with:
46+
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
47+
48+
- name: 'Set up BigQuery Cloud SDK'
49+
uses: 'google-github-actions/setup-gcloud@v1'
50+
51+
# - name: 'Use gcloud CLI'
52+
# run: "gcloud config configurations list"
53+
54+
- name: "Install BigQuery for Python"
55+
run: poetry add google-cloud-bigquery
56+
57+
# BigQuery end
58+
4259
- name: Run unit tests
4360
env:
4461
DATADIFF_SNOWFLAKE_URI: '${{ secrets.DATADIFF_SNOWFLAKE_URI }}'
4562
DATADIFF_PRESTO_URI: '${{ secrets.DATADIFF_PRESTO_URI }}'
4663
DATADIFF_CLICKHOUSE_URI: 'clickhouse://clickhouse:Password1@localhost:9000/clickhouse'
4764
DATADIFF_VERTICA_URI: 'vertica://vertica:Password1@localhost:5433/vertica'
65+
DATADIFF_BIGQUERY_URI: '${{ secrets.DATADIFF_BIGQUERY_URI }}'
4866
run: |
4967
chmod +x tests/waiting_for_stack_up.sh
5068
./tests/waiting_for_stack_up.sh && TEST_ACROSS_ALL_DBS=full poetry run unittest-parallel -j 16

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ presto-python-client = "*"
5151
clickhouse-driver = "*"
5252
vertica-python = "*"
5353
duckdb = "^0.6.0"
54+
# google-cloud-bigquery = "*"
5455
# databricks-sql-connector = "*"
5556

5657
[tool.poetry.extras]

tests/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
TEST_POSTGRESQL_CONN_STRING: str = "postgresql://postgres:Password1@localhost/postgres"
2525
TEST_SNOWFLAKE_CONN_STRING: str = os.environ.get("DATADIFF_SNOWFLAKE_URI") or None
2626
TEST_PRESTO_CONN_STRING: str = os.environ.get("DATADIFF_PRESTO_URI") or None
27-
TEST_BIGQUERY_CONN_STRING: str = None
27+
TEST_BIGQUERY_CONN_STRING: str = os.environ.get("DATADIFF_BIGQUERY_URI") or None
2828
TEST_REDSHIFT_CONN_STRING: str = None
2929
TEST_ORACLE_CONN_STRING: str = None
3030
TEST_DATABRICKS_CONN_STRING: str = os.environ.get("DATADIFF_DATABRICKS_URI")
@@ -97,7 +97,7 @@ def _print_used_dbs():
9797
used = {k.__name__ for k, v in CONN_STRINGS.items() if v is not None}
9898
unused = {k.__name__ for k, v in CONN_STRINGS.items() if v is None}
9999

100-
logging.info(f"Testing databases: {', '.join(used)}")
100+
print(f"Testing databases: {', '.join(used)}")
101101
if unused:
102102
logging.info(f"Connection not configured; skipping tests for: {', '.join(unused)}")
103103
if TEST_ACROSS_ALL_DBS:

0 commit comments

Comments
 (0)