Skip to content

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Jan 30, 2023

What changes were proposed in this pull request?

The main change of this pr as follows:

  • Move ClientE2ETestSuite into a new separate module, the new module named connect-jvm-e2e-tests, and add a new profile named connect-client-tests to activate this module. The new profile is added because the current test way of this module is cumbersome and it is not easy to build and test by default.

we need the follow steps for the new module test with maven

build/mvn clean -Pscala-2.12
build/mvn -DskipTests install -pl repl -am -Pscala-2.12
build/mvn -DskipTests install -pl connector/connect/common -Pscala-2.12
build/mvn -DskipTests install -pl connector/connect/server -Pscala-2.12
build/mvn -DskipTests install -pl connector/connect/client/jvm -Pscala-2.12
build/mvn clean test -pl connector/connect/client/jvm-e2e-tests -Pscala-2.12 -Pconnect-client-tests

or

build/mvn clean -Pscala-2.12
build/mvn -DskipTests clean install -Pscala-2.12
build/mvn clean test -pl connector/connect/client/jvm-e2e-tests -Pscala-2.12 -Pconnect-client-tests

It seems simpler to use sbt for test, but in the current dependency management way, using sbt to fetch the no-shaded connect-client jar cannot achieve the purpose of testing both the shaded client jar and the shaded server jar in the E2E tests.

build/sbt clean package -Pscala-2.12
build/sbt "connect-client-jvm-e2e-tests/test" -Pscala-2.12 -Pconnect-client-tests
  • Add a new GA task named connect-jvm-e2e-tests, this task use maven to test shaded connect-client-jvm. Under the current dependency management way, if we can find out how to fetch the assembly jar by sbt, we should change it to a more efficient sbt test mode.

  • Remove repl test dependency from connector/connect/client/jvm/pom.xml due to ClientE2ETestSuite move into separate module.

Why are the changes needed?

We should do E2E test with shaded client jar and shaded server jar. Before this pr, ClientE2ETestSuite is in connect-client-jvm module and the test will using shaded server jar and no-shaded client jar. After this pr, the test purpose can be achieved by using maven, but the test way using sbt needs to be further explored.

Does this PR introduce any user-facing change?

No

How was this patch tested?

  • Pass GitHub Actions
  • New GA Task passed
  • Manual check:

Scala 2.13 using maven

gh pr checkout 39807
dev/change-scala-version.sh 2.13
build/mvn clean -Pscala-2.13
build/mvn -DskipTests install -pl repl -am -Pscala-2.13
build/mvn -DskipTests install -pl connector/connect/common -Pscala-2.13
build/mvn -DskipTests install -pl connector/connect/server -Pscala-2.13
build/mvn -DskipTests install -pl connector/connect/client/jvm -Pscala-2.13
build/mvn  clean test -pl connector/connect/client/jvm-e2e-tests -Pscala-2.13 -Pconnect-client-tests

Scala 2.12 using sbt

gh pr checkout 39807
build/sbt clean package -Pscala-2.12
build/sbt "connect-client-jvm-e2e-tests/test" -Pscala-2.12 -Pconnect-client-tests

Scala 2.13 using sbt

gh pr checkout 39807
dev/change-scala-version.sh 2.13
build/sbt clean package -Pscala-2.13
build/sbt "connect-client-jvm-e2e-tests/test" -Pscala-2.13 -Pconnect-client-tests

@LuciferYang LuciferYang marked this pull request as draft January 30, 2023 15:52
@LuciferYang LuciferYang changed the title [SPARK-42240][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module to test shaded jvm client [WIP][SPARK-42240][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module to test shaded jvm client Jan 30, 2023
@LuciferYang LuciferYang changed the title [WIP][SPARK-42240][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module to test shaded jvm client [WIP][SPARK-42240][INFRA][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module to test shaded jvm client Jan 30, 2023
<version>${guava.version}</version>
<scope>compile</scope>
</dependency>
<!--
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move ClientE2ETestSuite out of client jvm, we can revert this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If necessary, I can do this change in a separate pr

<artifactSet>
<includes>
<include>com.google.guava:*</include>
<include>io.grpc:*:</include>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should revert this change after #39789 merged

with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Build and Test with Maven
Copy link
Contributor Author

@LuciferYang LuciferYang Jan 30, 2023

Choose a reason for hiding this comment

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

The reason for using maven for build and test is that in the current dependency configuration way, I don't know how SBT fetch assembly connect client jar

@LuciferYang
Copy link
Contributor Author

Test first, will update pr description later

sys.props.getOrElse("spark.test.home", sys.env("SPARK_HOME"))
}
private val isDebug = System.getProperty(DEBUG_SC_JVM_CLIENT, "false").toBoolean
private val isDebug = System.getProperty(DEBUG_SC_JVM_CLIENT, "true").toBoolean
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will revert this change after all test passed

@LuciferYang

This comment was marked as outdated.

@LuciferYang LuciferYang changed the title [WIP][SPARK-42240][INFRA][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module to test shaded jvm client [WIP][SPARK-42240][INFRA][CONNECT][TESTS] Move ClientE2ETestSuite into a separate module and add new GA task to test shaded jvm client with maven Jan 30, 2023
@LuciferYang
Copy link
Contributor Author

LuciferYang commented Jan 30, 2023

Because the ClientE2ETestSuite requires a shaded server jar, the direct execution of

build/mvn clean test -Pscala-2.12 -Pconnect-client-tests -Dtest=none -DwildcardSuites=org.apache.spark.sql.ClientE2ETestSuite

or

build/sbt clean "connect-client-jvm-e2e-tests/testOnly *ClientE2ETestSuite" -Pscala-2.12 -Pconnect-client-tests

will still fail, which is no different from without this pr

@LuciferYang
Copy link
Contributor Author

Need wait some days, because simple udf test cannot test successfully now

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.

1 participant