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

[KYUUBI #6281][PY] Initialize github action for python unit testing #6343

Closed
wants to merge 11 commits into from

Conversation

sudohainguyen
Copy link
Contributor

@sudohainguyen sudohainguyen commented Apr 28, 2024

🔍 Description

Issue References 🔗

This pull request fixes #6281

Describe Your Solution 🔧

The change initialize a CI job to run unit testing on python client, including:

  • Set up Github Action based on docker-compose
  • Update test cases and test succeeded for dialect presto and trino
  • Temporary disabled hive related test due to test cases are not valid, not about connection
  • Update dev dependencies to support python 3.10
  • Speed up testing with pytest-xdist plugin

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Not able to ran unit test in local and on CI

Behavior With This Pull Request 🎉

Able to run and partially cover a couple of test cases

Related Unit Tests

No

Additional notes

Next action is about fixing failing test cases or considering skipping some of them if necessary


Checklist 📝

Be nice. Be informative.

@github-actions github-actions bot added the kind:infra license, community building, project builds, asf infra related, etc. label Apr 28, 2024
@sudohainguyen sudohainguyen force-pushed the ci/init branch 2 times, most recently from f235c71 to 2172f69 Compare April 28, 2024 16:30
@sudohainguyen
Copy link
Contributor Author

@pan3793 not sure this is which type of change, new feature or bug fix?

@yaooqinn
Copy link
Member

hoverkraft-tech/compose-action@v1.5.1 is not allowed to be used in apache/kyuubi. Actions in this workflow must be: within a repository owned by apache, created by GitHub, verified in the GitHub Marketplace, or matching the following: /@[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]+, AdoptOpenJDK/install-jdk@, JamesIves/github-pages-deploy-action@5dc1d5a, TobKed/label-when-approved-action@, actions-cool/issues-helper@, actions-rs/, al-cheb/configure-pagefile-action@, amannn/action-semantic-pull-request@, apache/, burrunan/gradle-cache-action@, bytedeco/javacpp-presets/.github/actions/, chromaui/action@, codecov/codecov-action@, conda-incubator/setup-miniconda@, container-tools/kind-action@, container-tools/microshift-action@, dawidd6/action-download-artifact@, delaguardo/setup-graalvm@, docker://jekyll/jekyll:, docker://pandoc/core:2.9, eps1lon/actions-label-merge-conflict@, gaurav-nelson/github-action-markdown-link-che...

Are there any other options that we can consider?

@yaooqinn yaooqinn requested a review from pan3793 April 29, 2024 06:41
@sudohainguyen
Copy link
Contributor Author

thanks for informing, where can I see that message in full version? @yaooqinn

@yaooqinn
Copy link
Member

https://github.com/apache/kyuubi/actions/runs/8868934136

You can navi to this page via Checks tab of this PR

@sudohainguyen
Copy link
Contributor Author

ah thanks a lot, that's why it doesn't appear below

@yaooqinn
Copy link
Member

Yeah, We can refer to other Apache repos for available actions

@sudohainguyen
Copy link
Contributor Author

sudohainguyen commented Apr 29, 2024

@pan3793 also suggested me another adopting this approach
I went for docker-compose first because it provides isolation and flexibility with less set up efforts

let me try this one

@pan3793
Copy link
Member

pan3793 commented Apr 29, 2024

docker compose is fine too. and trino provides some pre-built images for Hadoop/Hive/Spark https://github.com/trinodb/docker-images

@pan3793
Copy link
Member

pan3793 commented Apr 29, 2024

@sudohainguyen hadoop-testing is for local dev. for CI case, docker compose / single docker image approach is preferred. so I suggest u refer to Trino's approach. Apache has strict rules for GitHub Actions plugins, you may need to install docker compose manually or leverage testcontainers(we already use the Java/Scala one)

@sudohainguyen
Copy link
Contributor Author

sudohainguyen commented Apr 30, 2024

just switched action provider to docker and seems working now 🙌

failed somewhere, testing on my personal repo

Signed-off-by: Harry <quanghai.ng1512@gmail.com>
Signed-off-by: Harry <quanghai.ng1512@gmail.com>
Signed-off-by: Harry <quanghai.ng1512@gmail.com>
Signed-off-by: Harry <quanghai.ng1512@gmail.com>
@sudohainguyen sudohainguyen force-pushed the ci/init branch 2 times, most recently from d12a723 to 248e7e4 Compare April 30, 2024 09:38
@sudohainguyen
Copy link
Contributor Author

sudohainguyen commented Apr 30, 2024

ok works now @pan3793
update:

  • Update test cases and test succeeded for dialect presto and trino
  • Temporary disable hive related test due to test cases are not valid, not about connection, will resolve in the next PR
  • Speed up testing with pytest-xdist plugin

@codecov-commenter
Copy link

codecov-commenter commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.44%. Comparing base (ef28a61) to head (96ef831).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6343      +/-   ##
============================================
- Coverage     58.47%   58.44%   -0.04%     
  Complexity       24       24              
============================================
  Files           653      653              
  Lines         39880    39880              
  Branches       5481     5481              
============================================
- Hits          23320    23306      -14     
- Misses        14071    14075       +4     
- Partials       2489     2499      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sudohainguyen
Copy link
Contributor Author

@pan3793 could we process this MR please 👀 ?

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

Temporary disabled hive related test due to test cases are not valid

Can you elaborate more on it?

.github/workflows/python.yml Outdated Show resolved Hide resolved
.github/workflows/python.yml Outdated Show resolved Hide resolved
python/dev_requirements.txt Show resolved Hide resolved

services:
namenode:
image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8
Copy link
Member

Choose a reason for hiding this comment

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

hadoop 2.0.0 is extremely old, why choose this image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was using existing images on the internet to save overhead preparation time 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you think in the future this should be kyuubi image instead?

python/setup.cfg Outdated Show resolved Hide resolved
python/pyhive/tests/test_sqlalchemy_hive.py Show resolved Hide resolved
@pan3793
Copy link
Member

pan3793 commented May 6, 2024

@sudohainguyen sorry for being late, just got back to the office today

sudohainguyen and others added 3 commits May 6, 2024 22:43
@sudohainguyen
Copy link
Contributor Author

sudohainguyen commented May 7, 2024

Temporary disabled hive related test due to test cases are not valid

Can you elaborate more on it?

yep, I've ran all test cases and can see the result here
there are 2 failed cases but I'm not sure if we should skip them or not, think we can work this out in the next PR?

@pan3793
Copy link
Member

pan3793 commented May 7, 2024

there are 2 failed cases

but I found 5 @pytest.mark.skip in changes, and one is applied to the class, is it expected?

@sudohainguyen
Copy link
Contributor Author

sudohainguyen commented May 7, 2024

yes this relates to hive test cases we need to resolve in the upcoming PR 😄,

annotation parts are to skip those test cases trigger restarted hive server, we cannot replicate those ones

@pan3793 pan3793 added this to the v1.10.0 milestone May 7, 2024
@pan3793 pan3793 closed this in 9075fbb May 7, 2024
@pan3793
Copy link
Member

pan3793 commented May 7, 2024

Thanks, merged to master

pan3793 pushed a commit that referenced this pull request May 8, 2024
# 🔍 Description
## Issue References 🔗

This pull request fixes #6281

Following up to #6343 , this PR adds `pytest-xdist` plugin to speed up python client unit testing

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️
Running tests usually takes ~10 mins

#### Behavior With This Pull Request 🎉
Running tests can take up to 5 mins

#### Related Unit Tests

---

# Checklist 📝

- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6369 from sudohainguyen/ci/speed-up-test.

Closes #6281

f0ce557 [Harry] [KYUUBI #6281][PY] Speed up testing with xdist plugin

Authored-by: Harry <quanghai.ng1512@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
pan3793 pushed a commit that referenced this pull request May 15, 2024
# 🔍 Description
## Issue References 🔗

This pull request enables running hive test cases in python client, however there's one trivial case not covered yet and two others require a proper container setup

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️
Hive test disabled in #6343

#### Behavior With This Pull Request 🎉
Can cover hive test cases

#### Related Unit Tests
No

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6381 from sudohainguyen/ci/hive.

Closes #6281

a861382 [Harry] [KYUUBI #6281][PY] Enable hive test in python client

Authored-by: Harry <quanghai.ng1512@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:infra license, community building, project builds, asf infra related, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK][MEDIUM] Setup GitHub Actions for Kyuubi Python client (former PyHive)
4 participants