Skip to content

Commit

Permalink
[Improve][Connector-V2][DataHub] Refactor DataHub connector e2e test (#…
Browse files Browse the repository at this point in the history
…3866)

* [Improve][Connector-V2][DataHub] Refactor DataHub connector e2e test

* [Improve][Connector-V2][DataHub] change datahub e2e test
  • Loading branch information
TaoZex authored Jan 6, 2023
1 parent 1ea198f commit fa92904
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.seatunnel</groupId>
<artifactId>seatunnel-flink-connector-v2-e2e</artifactId>
<artifactId>seatunnel-connector-v2-e2e</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>connector-datahub-flink-e2e</artifactId>
<artifactId>connector-datahub-e2e</artifactId>

<dependencies>
<dependency>
<groupId>org.apache.seatunnel</groupId>
<artifactId>connector-flink-e2e-base</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<!-- SeaTunnel connectors -->
<dependency>
<groupId>org.apache.seatunnel</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,39 @@
* limitations under the License.
*/

package org.apache.seatunnel.e2e.spark.v2.datahub;
package org.apache.seatunnel.e2e.connector.datahub;

import org.apache.seatunnel.e2e.spark.SparkContainer;
import org.apache.seatunnel.e2e.common.TestResource;
import org.apache.seatunnel.e2e.common.TestSuiteBase;
import org.apache.seatunnel.e2e.common.container.TestContainer;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestTemplate;
import org.testcontainers.containers.Container;

import java.io.IOException;

@Disabled("Disabled because it needs user's personal datahub account to run this test")
public class FakeSourceToDatahubIT extends SparkContainer {
public class DatahubIT extends TestSuiteBase implements TestResource {

@Test
public void testFakeSourceToDatahub() throws IOException, InterruptedException {
Container.ExecResult execResult = executeSeaTunnelSparkJob("/datahub/fakesource_to_datahub.conf");
@BeforeEach
@Override
public void startUp() throws Exception {

}

@AfterEach
@Override
public void tearDown() throws Exception {

}

@TestTemplate
public void testDatahub(TestContainer container) throws IOException, InterruptedException {
Container.ExecResult execResult = container.executeJob("/fakesource_to_datahub.conf");
Assertions.assertEquals(0, execResult.getExitCode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
######
###### This config file is a demonstration of streaming processing in seatunnel config
######

env {
# You can set flink configuration here
execution.parallelism = 1
job.mode = "BATCH"
#execution.checkpoint.interval = 10000
#execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
}

source {
# This is a example source plugin **only for test and demonstrate the feature source plugin**
FakeSource {
result_table_name = "fake"
schema = {
Expand All @@ -37,13 +30,9 @@ source {
}
}
}
# If you would like to get more information about how to configure seatunnel and see full list of source plugins,
# please go to https://seatunnel.apache.org/docs/connector-v2/source/FakeSource
}

transform {
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
# please go to https://seatunnel.apache.org/docs/transform/sql
}

sink {
Expand All @@ -56,7 +45,4 @@ sink {
timeout=3000
retryTimes=3
}

# If you would like to get more information about how to configure seatunnel and see full list of sink plugins,
# please go to https://seatunnel.apache.org/docs/connector-v2/sink
}
1 change: 1 addition & 0 deletions seatunnel-e2e/seatunnel-connector-v2-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<module>connector-cdc-mysql-e2e</module>
<module>connector-iceberg-e2e</module>
<module>connector-iceberg-hadoop3-e2e</module>
<module>connector-datahub-e2e</module>
</modules>

<artifactId>seatunnel-connector-v2-e2e</artifactId>
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion seatunnel-e2e/seatunnel-flink-connector-v2-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<modules>
<module>connector-flink-e2e-base</module>
<module>connector-jdbc-flink-e2e</module>
<module>connector-datahub-flink-e2e</module>
<module>connector-mongodb-flink-e2e</module>
</modules>

Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion seatunnel-e2e/seatunnel-spark-connector-v2-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

<modules>
<module>connector-spark-e2e-base</module>
<module>connector-datahub-spark-e2e</module>
<module>connector-jdbc-spark-e2e</module>
<module>connector-mongodb-spark-e2e</module>
</modules>
Expand Down

0 comments on commit fa92904

Please sign in to comment.