Skip to content

Conversation

@JonasJ-ap
Copy link
Contributor

@JonasJ-ap JonasJ-ap commented Mar 18, 2023

Closes #7135
Closes #7149

#

name: "Python CI"
name: "Python Integration"
Copy link
Contributor Author

@JonasJ-ap JonasJ-ap Mar 18, 2023

Choose a reason for hiding this comment

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

I observe that If two CI have the same name, the following error occurs sometimes:
Screen Shot 2023-03-18 at 01 58 00

Probably the reason that Python CI fails(get cancelled) sometimes....

python/Makefile Outdated
test:
poetry run coverage run --source=pyiceberg/ -m pytest tests/ -m unmarked ${PYTEST_ARGS}
poetry run coverage report -m --fail-under=90
poetry run coverage report -m --fail-under=88
Copy link
Contributor Author

@JonasJ-ap JonasJ-ap Mar 18, 2023

Choose a reason for hiding this comment

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

The current test coverage excluding integration, s3, and adlfs tests is 88%

Copy link
Contributor

Choose a reason for hiding this comment

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

We definitely want to keep this 90, but it's probably more important to at least run the tests and we don't want to blindly add tests just for the sake of making it 90, I will approve the PR, but can you create an Issue tracking that so we take a deeper look at where we can add more tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I created a new issue: #7149.

Since the drop of test coverage is caused of exlusion of some tests related to s3 and adlfs, adding them back when computing the test coverage may also be a solution. I argee that the top priority is to make these tests running in the CI, so I will keep the threshold at 88% as a temporal solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

@JonasJ-ap I think this only runs the tests that are marked as unmarked and checks the code coverage. How about adding another target in the Makefile that will run all the test of all the markers (unmarked, s3, adlfs, and gcs soon), and only add the code coverage check there. Right now we expect all the test suites to cover 90%+, which is not really needed.

Copy link
Contributor Author

@JonasJ-ap JonasJ-ap Mar 21, 2023

Choose a reason for hiding this comment

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

@Fokko Thank you for your suggestion. I added a new target called "test-coverage" to run all the unit tests and make this the only command to be run in the "Python CI" workflow. I also noticed that some tests utilizing @pytest.mark.parametrize(...) are marked as "parametrize", so I also included these in the "test" target.

@JonasJ-ap JonasJ-ap marked this pull request as ready for review March 18, 2023 06:07
@JonasJ-ap JonasJ-ap changed the title Pyiceberg: Make Python CI collect most of the unit tests Python: Make Python CI collect most of the unit tests Mar 19, 2023
python/Makefile Outdated
test:
poetry run coverage run --source=pyiceberg/ -m pytest tests/ -m unmarked ${PYTEST_ARGS}
poetry run coverage report -m --fail-under=90
poetry run coverage report -m --fail-under=88
Copy link
Contributor

Choose a reason for hiding this comment

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

We definitely want to keep this 90, but it's probably more important to at least run the tests and we don't want to blindly add tests just for the sake of making it 90, I will approve the PR, but can you create an Issue tracking that so we take a deeper look at where we can add more tests?

@JonasJ-ap
Copy link
Contributor Author

@jackye1995 Thanks for your review and suggestions. @Fokko May I ask if you have time to take a look at this PR?

@JonasJ-ap JonasJ-ap changed the title Python: Make Python CI collect most of the unit tests Python: Make Python CI collect most of the unit tests and Fix CI name conflict Mar 21, 2023
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks @JonasJ-ap this is great, thanks for picking this up. I left a few comments, let me know what you think

python/Makefile Outdated
test:
poetry run coverage run --source=pyiceberg/ -m pytest tests/ -m unmarked ${PYTEST_ARGS}
poetry run coverage report -m --fail-under=90
poetry run coverage report -m --fail-under=88
Copy link
Contributor

Choose a reason for hiding this comment

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

@JonasJ-ap I think this only runs the tests that are marked as unmarked and checks the code coverage. How about adding another target in the Makefile that will run all the test of all the markers (unmarked, s3, adlfs, and gcs soon), and only add the code coverage check there. Right now we expect all the test suites to cover 90%+, which is not really needed.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @JonasJ-ap

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

Thanks @JonasJ-ap!

@jackye1995 jackye1995 merged commit 34e8e2e into apache:master Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Add more unit tests to remain 90% test coverage result Python: Current Python CI ignore most of the unit tests

3 participants