Skip to content
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

Coverage Run unit tests first before docker containers are set up #1055

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

Minfante377
Copy link
Contributor

@Minfante377 Minfante377 commented Aug 13, 2024

This PR implements:

  • Run unit tests as part of the CI
  • Add a missing integration mark to one of the integration tests

Should close #1051

@Minfante377 Minfante377 force-pushed the run-unit-test-pr branch 2 times, most recently from 9f86746 to 349c9b6 Compare August 13, 2024 14:45
Makefile Outdated Show resolved Hide resolved
Copy link
Collaborator

@sungwy sungwy left a 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!

@sungwy sungwy changed the title Run unit tests on PR Coverage Run unit tests first before docker containers are set up Aug 13, 2024
Copy link
Contributor

@kevinjqliu kevinjqliu left a 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
@@ -67,7 +70,10 @@ test-coverage:
sleep 10
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}
Copy link
Contributor

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

Suggested change
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}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -753,6 +753,7 @@ def test_configure_row_group_batch_size(session_catalog: Catalog) -> None:
assert len(batches) == entries


@pytest.mark.integration
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@kevinjqliu kevinjqliu left a 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 ====

@kevinjqliu kevinjqliu merged commit b889ddd into apache:main Aug 14, 2024
7 checks passed
This was referenced Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Run unit test in CI on pull request
3 participants