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

[#3940] improvement(gradle): skip Docker dependent tests by default #3974

Merged
merged 7 commits into from
Jun 28, 2024

Conversation

mchades
Copy link
Contributor

@mchades mchades commented Jun 26, 2024

What changes were proposed in this pull request?

  • skip Docker dependent tests by default when run build and test task
  • don't skip Docker dependent tests in CI

Why are the changes needed?

Fix: #3940

Does this PR introduce any user-facing change?

no

How was this patch tested?

verified locally

@mchades mchades self-assigned this Jun 26, 2024
+ Make sure you have installed Docker in your environment if you plan to run integration texts. Without it, some Docker-related tests may not run.
+ Gravitino excludes all Docker-related tests by default. To run integration tests, make sure you have installed
Docker in your environment and set `skipDockerDependentTests=false` in the `gradle.properties` file(or
use `-PskipDockerDependentTests=false` in the command). Otherwise, some Docker-related tests may not execute.
Copy link
Contributor

Choose a reason for hiding this comment

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

What do we do with the configuration skipITs? Do we need to remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to do anything with skipITs. Because both UT and IT may use Docker, parameter skipITs is used to control IT, while the new configuration skipDockerDependentTests is used to control Docker.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand what you mean. Do other people have any suggestions about it?

Copy link
Contributor

@FANNG1 FANNG1 Jun 26, 2024

Choose a reason for hiding this comment

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

I prefer to combine skipITs and skipDockerDependentTests, because it's too complicated. maybe we could use skipTestsWithDocker and skipTestsWithoutDocker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to combine skipITs and skipDockerDependentTests, because it's too complicated. maybe we could use skipTestsWithDocker and skipTestsWithoutDocker

This is the same with removing skipITs , right?

gradle.properties Outdated Show resolved Hide resolved
build.gradle.kts Outdated
@@ -676,7 +674,9 @@ fun printDockerCheckInfo() {
val macDockerConnector = project.extra["macDockerConnector"] as? Boolean ?: false
val isOrbStack = project.extra["isOrbStack"] as? Boolean ?: false

if (OperatingSystem.current().isMacOsX() &&
if (extra["skipDockerDependentTests"].toString().toBoolean()) {
project.extra["docker_it_test"] = false
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename the "docker_it_test" to "docker_test"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also for the tag name "gravitino-docker-it", can you please change to "gravitino-docker-test"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@yuqi1129
Copy link
Contributor

I'm okay with the current changes.

@@ -26,7 +26,9 @@ This software is licensed under the Apache License version 2."
You don't have to preinstall the specified JDK environment, as Gradle detects the JDK version needed and downloads it automatically.
+ Gravitino uses the Gradle Java Toolchain to detect and manage JDK versions, it checks the
installed JDK by running the `./gradlew javaToolchains` command. See [Gradle Java Toolchain](https://docs.gradle.org/current/userguide/toolchains.html#sec:java_toolchain).
+ Make sure you have installed Docker in your environment if you plan to run integration texts. Without it, some Docker-related tests may not run.
+ Gravitino excludes all Docker-related tests by default. To run integration tests, make sure you have installed
Copy link
Contributor

Choose a reason for hiding this comment

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

To run integration tests and docker related unit test, or you can use 'to run docker related test'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -66,7 +66,7 @@ jobs:
cache: 'gradle'

- name: Build with Gradle
run: ./gradlew build -x test -PjdkVersion=8
run: ./gradlew build -x test -PjdkVersion=8 -PskipDockerTests=false
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused, -x test is used here to skip tests, so why do we need to set skipDockerTests=false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it's redundant, I will remove it

@@ -83,7 +83,7 @@ jobs:
- name: Package Gravitino
if : ${{ matrix.test-mode == 'deploy' }}
run: |
./gradlew compileDistribution -x test -PjdkVersion=${{ matrix.java-version }}
./gradlew compileDistribution -x test -PjdkVersion=${{ matrix.java-version }} -PskipDockerTests=false
Copy link
Contributor

@jerryshao jerryshao Jun 27, 2024

Choose a reason for hiding this comment

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

Also here, it is meaningless to add -PskipDockerTests=false here. Please recheck all the changes, don't blindly add the property.

@@ -26,7 +26,9 @@ This software is licensed under the Apache License version 2."
You don't have to preinstall the specified JDK environment, as Gradle detects the JDK version needed and downloads it automatically.
+ Gravitino uses the Gradle Java Toolchain to detect and manage JDK versions, it checks the
installed JDK by running the `./gradlew javaToolchains` command. See [Gradle Java Toolchain](https://docs.gradle.org/current/userguide/toolchains.html#sec:java_toolchain).
+ Make sure you have installed Docker in your environment if you plan to run integration texts. Without it, some Docker-related tests may not run.
+ Gravitino excludes all Docker-related tests by default. To run Docker related tests, make sure you have installed
Docker in your environment and set `skipDockerTests=false` in the `gradle.properties` file(or
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the whitespace after file.

+ Make sure you have installed Docker in your environment if you plan to run integration texts. Without it, some Docker-related tests may not run.
+ Gravitino excludes all Docker-related tests by default. To run Docker related tests, make sure you have installed
Docker in your environment and set `skipDockerTests=false` in the `gradle.properties` file(or
use `-PskipDockerTests=false` in the command). Otherwise, some Docker-related tests may not execute.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Otherwise, all Docker required tests will skip."

@@ -96,7 +96,7 @@ jobs:
dev/ci/util_free_space.sh

- name: Build with Gradle
run: ./gradlew build -PskipITs -PjdkVersion=${{ matrix.java-version }} -x :clients:client-python:build
run: ./gradlew build -PskipITs -PjdkVersion=${{ matrix.java-version }} -PskipDockerTests=false -x :clients:client-python:build
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we enable docker tests for build task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

build task needs to run UTs, some UTs include docker tests(such as Doris catalog)

@jerryshao jerryshao merged commit 1565e19 into apache:main Jun 28, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants