-
Notifications
You must be signed in to change notification settings - Fork 412
Coverage Run unit tests first before docker containers are set up #1055
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9f86746 to
349c9b6
Compare
349c9b6 to
244f635
Compare
sungwy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Minfante377 for this PR, and @youssef-itanii as well!
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Added a comment about testing this method and some nits
Makefile
Outdated
| docker compose -f dev/docker-compose-integration.yml cp ./dev/provision.py spark-iceberg:/opt/spark/provision.py | ||
| docker compose -f dev/docker-compose-integration.yml exec -T spark-iceberg ipython ./provision.py | ||
| poetry run coverage run --source=pyiceberg/ -m pytest tests/ ${PYTEST_ARGS} | ||
| poetry run coverage run --data-file=.coverage.integration --source=pyiceberg/ -m pytest tests/ -m integration ${PYTEST_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: to match the other command, also added -v to match test-integration
| poetry run coverage run --data-file=.coverage.integration --source=pyiceberg/ -m pytest tests/ -m integration ${PYTEST_ARGS} | |
| poetry run coverage run --source=pyiceberg/ --data-file=.coverage.integration -m pytest tests/ -v -m integration ${PYTEST_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| assert len(batches) == entries | ||
|
|
||
|
|
||
| @pytest.mark.integration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CI fail if we don't add this line? It's what we're testing for in #1051
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fails indeed. If I don't add that marker the test-coverage-unit command will try to run that test without initializing any docker container
244f635 to
09b0298
Compare
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Verified that unit test fails
#1060
https://github.com/apache/iceberg-python/actions/runs/10380009878/job/28739139875?pr=1060
=========================== short test summary info ============================
FAILED tests/integration/test_reads.py::test_table_scan_default_to_large_types[session_catalog_hive] - thrift.transport.TTransport.TTransportException: Could not connect to any of [('::1', 9083, 0, 0), ('127.0.0.1', 9083)]
ERROR tests/integration/test_reads.py::test_table_scan_default_to_large_types[session_catalog] - requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8181): Max retries exceeded with url: /v1/config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2b1351e0d0>: Failed to establish a new connection: [Errno 111] Connection refused'))
=== 1 failed, 2781 passed, 834 deselected, 1113 warnings, 1 error in 54.83s ====
This PR implements:
Should close #1051