Skip to content

Commit

Permalink
Resolved trino and presto test
Browse files Browse the repository at this point in the history
  • Loading branch information
sudohainguyen committed Apr 30, 2024
1 parent 5b33e39 commit 1e2c248
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ jobs:
java-version: "8"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
- name: Start Testing Containers
run: |
cd python/docker/
docker compose up -d --wait
docker compose exec hive-server /opt/hive/scripts/make_test_tables.sh
- name: Install dependencies
run: |
cd python
./scripts/install-deps.sh
- name: Run tests
run: |
cd python
docker compose -f docker/docker-compose.yml up -d --wait
pytest -v
pytest -v
2 changes: 1 addition & 1 deletion python/docker/conf/presto/catalog/hive.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
connector.name=hive
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hive-metastore:9083
2 changes: 1 addition & 1 deletion python/docker/conf/trino/catalog/hive.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
connector.name=hive
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hive-metastore:9083
1 change: 0 additions & 1 deletion python/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ services:
image: bde2020/hive:2.3.2-postgresql-metastore
env_file:
- hadoop-hive.env
command: /opt/hive/scripts/make_test_tables.sh
volumes:
- ../scripts:/opt/hive/scripts
environment:
Expand Down
2 changes: 1 addition & 1 deletion python/pyhive/tests/test_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
_HOST = 'localhost'


@pytest.mark.skip
@pytest.mark.skip(reason="Temporary disabled")
class TestHive(unittest.TestCase, DBAPITestCase):
__test__ = True

Expand Down
2 changes: 2 additions & 0 deletions python/pyhive/tests/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import requests

import pytest
from pyhive import exc
from pyhive import presto
from pyhive.tests.dbapi_test_case import DBAPITestCase
Expand Down Expand Up @@ -231,6 +232,7 @@ def test_invalid_kwargs(self):
).cursor()
)

@pytest.mark.skip(reason='This test requires a proxy server running on localhost:9999')
def test_requests_kwargs(self):
connection = presto.connect(
host=_HOST, port=_PORT, source=self.id(),
Expand Down
2 changes: 2 additions & 0 deletions python/pyhive/tests/test_sqlalchemy_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pyhive.sqlalchemy_hive import HiveDecimal
from pyhive.sqlalchemy_hive import HiveTimestamp
from sqlalchemy.exc import NoSuchTableError, OperationalError
import pytest
from pyhive.tests.sqlalchemy_test_case import SqlAlchemyTestCase
from pyhive.tests.sqlalchemy_test_case import with_engine_connection
from sqlalchemy import types
Expand Down Expand Up @@ -60,6 +61,7 @@
# ]


@pytest.mark.skip(reason="Temporarily disabled")
class TestSqlAlchemyHive(unittest.TestCase, SqlAlchemyTestCase):
def create_engine(self):
return create_engine('hive://localhost:10000/default')
Expand Down
6 changes: 3 additions & 3 deletions python/pyhive/tests/test_trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def test_complex(self, cursor):
('timestamp', 'timestamp', None, None, None, None, True),
('binary', 'varbinary', None, None, None, None, True),
('array', 'array(integer)', None, None, None, None, True),
('map', 'map(integer,integer)', None, None, None, None, True),
('struct', 'row(a integer,b integer)', None, None, None, None, True),
('map', 'map(integer, integer)', None, None, None, None, True),
('struct', 'row(a integer, b integer)', None, None, None, None, True),
# ('union', 'varchar', None, None, None, None, True),
('decimal', 'decimal(10,1)', None, None, None, None, True),
('decimal', 'decimal(10, 1)', None, None, None, None, True),
])
rows = cursor.fetchall()
expected = [(
Expand Down
2 changes: 1 addition & 1 deletion python/scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ sudo apt-get -q update
sudo apt-get -q install -y g++ libsasl2-dev libkrb5-dev

pip install --upgrade pip
pip install -e .
pip install -r dev_requirements.txt
pip install -e .

0 comments on commit 1e2c248

Please sign in to comment.