nzw921rx opened a new issue, #11899:
URL: https://github.com/apache/seatunnel/issues/11899
## Description
`TransformErrorToMysqlIT` and `SinkErrorToMysqlIT` currently download MySQL
Connector/J from Maven Central by running `curl` inside the SeaTunnel test
container:
```java
container -> {
Container.ExecResult extraCommands =
container.execInContainer(
"bash",
"-c",
"mkdir -p /tmp/seatunnel/plugins/Jdbc/lib"
+ " && cd /tmp/seatunnel/plugins/Jdbc/lib"
+ " && (test -s mysql-connector-j-8.0.32.jar"
+ " || curl -fsSLO --retry 5 --retry-delay 2 "
+ DRIVER_JAR
+ ")");
Assertions.assertEquals(0, extraCommands.getExitCode(),
extraCommands.getStderr());
};
```
This duplicates dependency setup logic and makes the E2E tests depend on
network access from inside the running container. SeaTunnel E2E already
provides `DependencyJar` to locate a test dependency on the host classpath and
copy its JAR into the test container.
The affected module already declares `com.mysql:mysql-connector-j:8.0.32`
with test scope, so no new Maven dependency is required.
## Affected files
-
`seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/TransformErrorToMysqlIT.java`
-
`seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/SinkErrorToMysqlIT.java`
## Suggested change
Replace the container-side `curl` logic in both tests with the standard
helper, following existing E2E examples:
```java
import org.apache.seatunnel.e2e.common.util.DependencyJar;
import com.mysql.cj.jdbc.Driver;
@TestContainerExtension
private final ContainerExtendedFactory extendedFactory =
container ->
DependencyJar.of(Driver.class)
.copyTo(container,
"/tmp/seatunnel/plugins/Jdbc/lib");
```
Also remove the now-unused `DRIVER_JAR` constant and imports related only to
the shell download implementation.
## Acceptance criteria
- Both tests use `DependencyJar` to copy MySQL Connector/J into
`/tmp/seatunnel/plugins/Jdbc/lib`.
- Neither test downloads the driver with `curl` or otherwise requires
container-side Maven Central access.
- No new Maven dependency or dependency version change is introduced.
- Existing test behavior and coverage remain unchanged.
- Spotless and the focused `connector-seatunnel-e2e-base` validation pass.
Contributors are welcome to comment on this issue before starting so it can
be assigned and duplicate work can be avoided.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]