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

[FLINK-9020][E2E Tests] Use separate modules per testcase #5717

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
107 changes: 107 additions & 0 deletions flink-end-to-end-tests/parent-child-classloading-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<artifactId>flink-end-to-end-tests</artifactId>
<groupId>org.apache.flink</groupId>
<version>1.6-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>parent-child-classloading-test</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

  • add flink prefix
  • add _${scala.binary.version} suffix
  • add <name>flink-parent-child-classloading-test</name> (this is what allows us to omit the scala stuff when listing child modules)

<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>

<executions>
<!-- ClassLoaderTestProgram -->
<execution>
<id>ClassLoaderTestProgram</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>ClassLoaderTestProgram</classifier>

<archive>
<manifestEntries>
<program-class>org.apache.flink.streaming.tests.ClassLoaderTestProgram</program-class>
</manifestEntries>
</archive>

<includes>
<include>org/apache/flink/streaming/tests/ClassLoaderTestProgram.class</include>
<include>org/apache/flink/runtime/taskmanager/TaskManager.class</include>
<include>.version.properties</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

<!--simplify the name of the testing JARs for referring to them in the end-to-end test scripts-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>rename</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="${project.basedir}/target/parent-child-classloading-test-${project.version}-ClassLoaderTestProgram.jar" tofile="${project.basedir}/target/ClassLoaderTestProgram.jar" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

78 changes: 6 additions & 72 deletions flink-end-to-end-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,79 +29,13 @@ under the License.
<relativePath>..</relativePath>
</parent>

<artifactId>flink-end-to-end-tests_${scala.binary.version}</artifactId>
<name>flink-end-to-end-tests</name>

<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<packaging>pom</packaging>

<executions>
<!-- ClassLoaderTestProgram -->
<execution>
<id>ClassLoaderTestProgram</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>ClassLoaderTestProgram</classifier>

<archive>
<manifestEntries>
<program-class>org.apache.flink.streaming.tests.ClassLoaderTestProgram</program-class>
</manifestEntries>
</archive>

<includes>
<include>org/apache/flink/streaming/tests/ClassLoaderTestProgram.class</include>
<include>org/apache/flink/runtime/taskmanager/TaskManager.class</include>
<include>.version.properties</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<artifactId>flink-end-to-end-tests</artifactId>
<name>flink-end-to-end-tests</name>

<!--simplify the name of the testing JARs for referring to them in the end-to-end test scripts-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>rename</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="${project.basedir}/target/flink-end-to-end-tests_${scala.binary.version}-${project.version}-ClassLoaderTestProgram.jar" tofile="${project.basedir}/target/ClassLoaderTestProgram.jar" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<modules>
<module>parent-child-classloading-test</module>
</modules>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

source "$(dirname "$0")"/common.sh

TEST_PROGRAM_JAR=$TEST_INFRA_DIR/../../flink-end-to-end-tests/target/ClassLoaderTestProgram.jar
TEST_PROGRAM_JAR=$TEST_INFRA_DIR/../../flink-end-to-end-tests/parent-child-classloading-test/target/ClassLoaderTestProgram.jar

echo "Testing parent-first class loading"

Expand Down Expand Up @@ -111,4 +111,4 @@ if [[ "$OUTPUT" != "$EXPECTED" ]]; then
echo -e "EXPECTED: $EXPECTED"
echo -e "ACTUAL: $OUTPUT"
PASS=""
fi
fi