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

[#2992] improvement(PyClient): Fix unstable Python client integration test #2994

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

xunliu
Copy link
Member

@xunliu xunliu commented Apr 17, 2024

What changes were proposed in this pull request?

  1. Add skipPyClientITs param in Gradle build script. Let's Python client integration test not running in the backend ITs

  2. Combined Gradle build command of Python client test and integration test

  3. improvement FilesetCatalog integration test codes.

  4. Test mode

    • Test Principle: Every Python ITs class base on the IntegrationTestEnv, IntegrationTestEnv will automatic start and stop Gravitino server to support ITs, But when you run multiple ITs class at same time, The first test class that finishes running will shut down the Gravitino server, which will cause other test classes to fail if they can't connect to the Gravitino server.
    • Run test in the IDE: Through IntegrationTestEnv class automatic start and stop Gravitino server to support ITs.
    • Run test in the Github Action: Manual start and stop Gravitino server, and set EXTERNAL_START_GRAVITINO environment variable
    • Run test in the Gradle command :client:client-python:test: Gradle automatic start and stop Gravitino server, and set EXTERNAL_START_GRAVITINO environment variable.

Why are the changes needed?

Fix: #2992

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

Through CI check.

@xunliu xunliu self-assigned this Apr 17, 2024
@xunliu xunliu requested review from shaofengshi and diqiu50 April 17, 2024 08:47
fileset_propertie_value2: str = "fileset_propertie_value2"
fileset_properties: Dict[str, str] = {fileset_propertie_key1: fileset_propertie_value1,
fileset_propertie_key2: fileset_propertie_value2}
fileset_new_name = fileset_name + "_new"
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better that you can add a random prefix to all the names so that you will not fail for any case, like what we did in Java IT?

@yuqi1129
Copy link
Contributor

@xunliu
Is it ready for review?

Comment on lines 69 to 71
echo "Use Python version ${pythonVersion} to test the Python client."
# Start Gravitino server and set the environment variable
./distribution/package/bin/gravitino.sh start
Copy link
Contributor

Choose a reason for hiding this comment

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

With this manual startUp step, how do we test in local environment using gradle?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Test Principle: Every Python ITs class base on the IntegrationTestEnv, IntegrationTestEnv will automatic start and stop Gravitino server to support ITs, But when you run multiple ITs class at same time, The first test class that finishes running will shut down the Gravitino server, which will cause other test classes to fail if they can't connect to the Gravitino server.
  2. Run test in the IDE: Through IntegrationTestEnv class automatic start and stop Gravitino server to support ITs.
  3. Run test in the Github Action: Manual start and stop Gravitino server, and set EXTERNAL_START_GRAVITINO environment variable
  4. Run test in the Gradle command :client:client-python:test: Gradle automatic start and stop Gravitino server, and set EXTERNAL_START_GRAVITINO environment variable.

I will create a document to description this in the next PR.

web/pnpm-lock.yaml Outdated Show resolved Hide resolved
- name: Python Client Integration Test
id: integrationTest
env:
EXTERNAL_START_GRAVITINO: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Better change to “START_EXTERNAL_GRAVITINO”

Copy link
Member Author

Choose a reason for hiding this comment

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

DONE.

val skipPyClientITs = project.hasProperty("skipPyClientITs")
if (!skipPyClientITs) {
doFirst {
gravitinoServer("start")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to start Gravitino manually if it is started manually in CI?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, You are right, I removed this code.

doLast {
gravitinoServer("stop")
doLast {
gravitinoServer("stop")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this code.

web/pnpm-lock.yaml Outdated Show resolved Hide resolved
@xunliu
Copy link
Member Author

xunliu commented Apr 18, 2024

@jerryshao Please help me review this PR, Thanks.

Copy link
Contributor

@jerryshao jerryshao 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 @xunliu for your fix.

@jerryshao jerryshao merged commit 9e6e189 into apache:main Apr 18, 2024
22 checks passed
@jerryshao jerryshao changed the title [#2292] improvement(PyClient): Fix unstable Python client integration test [#2992] improvement(PyClient): Fix unstable Python client integration test Apr 18, 2024
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
…ration test (apache#2994)

### What changes were proposed in this pull request?

1. Add `skipPyClientITs` param in Gradle build script. Let's Python
client integration test not running in the backend ITs
2. Combined Gradle build command of Python client test and integration
test
3. improvement FilesetCatalog integration test codes.
4. Test mode

+ Test Principle: Every Python ITs class base on the
`IntegrationTestEnv`, `IntegrationTestEnv` will automatic start and stop
Gravitino server to support ITs, But when you run multiple ITs class at
same time, The first test class that finishes running will shut down the
Gravitino server, which will cause other test classes to fail if they
can't connect to the Gravitino server.
+ Run test in the IDE: Through `IntegrationTestEnv` class automatic
start and stop Gravitino server to support ITs.
+ Run test in the Github Action: Manual start and stop Gravitino server,
and set `EXTERNAL_START_GRAVITINO` environment variable
+ Run test in the Gradle command `:client:client-python:test`: Gradle
automatic start and stop Gravitino server, and set
`EXTERNAL_START_GRAVITINO` environment variable.

### Why are the changes needed?

Fix: apache#2292

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

Through CI check.
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.

[Improvement] Fix unstable Python client integration test in Github Action
3 participants