Skip to content

Commit 1880d8c

Browse files
committed
Run integration tests on docker image produced by the project
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
1 parent ce9ea23 commit 1880d8c

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959
- name: Download dependencies
6060
run: |
6161
mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -Pci,flink-1.19
62-
mvn -B -f flink-sql-runner/pom.xml org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources com.marvinformatics:docker-compose-maven-plugin:5.0.0:pull -Pci,flink-1.19
62+
mvn -B -f flink-sql-runner/pom.xml org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources -Pci,flink-1.19
63+
grep '^FROM' flink-sql-runner/target/Dockerfile | awk '{print $2}' | xargs -n1 docker pull
6364
6465
- name: Update version
6566
if: github.event_name == 'release' && github.event.action == 'created'

.github/workflows/uber-jar.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
- name: Download dependencies
6363
run: |
6464
mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.8.1:go-offline de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -P${{ matrix.FLINK_PROFILE }}
65-
mvn -B -f flink-sql-runner/pom.xml org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources com.marvinformatics:docker-compose-maven-plugin:5.0.0:pull -P${{ matrix.FLINK_PROFILE }}
65+
mvn -B -f flink-sql-runner/pom.xml org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources -P${{ matrix.FLINK_PROFILE }}
66+
grep '^FROM' flink-sql-runner/target/Dockerfile | awk '{print $2}' | xargs -n1 docker pull
6667
6768
- name: Update version
6869
if: github.event_name == 'release' && github.event.action == 'created'

flink-sql-runner/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,31 @@
258258
</executions>
259259
</plugin>
260260

261+
<plugin>
262+
<groupId>org.codehaus.mojo</groupId>
263+
<artifactId>exec-maven-plugin</artifactId>
264+
<version>${exec.plugin.version}</version>
265+
<executions>
266+
<execution>
267+
<id>build-docker-image</id>
268+
<goals>
269+
<goal>exec</goal>
270+
</goals>
271+
<phase>package</phase>
272+
<configuration>
273+
<workingDirectory>${project.basedir}/target/</workingDirectory>
274+
<executable>docker</executable>
275+
<skip>${skipTests}</skip>
276+
<arguments>
277+
<argument>build</argument>
278+
<argument>--tag</argument>
279+
<argument>flink-sql-runner</argument>
280+
<argument>.</argument>
281+
</arguments>
282+
</configuration>
283+
</execution>
284+
</executions>
285+
</plugin>
261286
<plugin>
262287
<groupId>com.marvinformatics</groupId>
263288
<artifactId>docker-compose-maven-plugin</artifactId>

flink-sql-runner/src/main/docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ FROM flink:${flink-base-image}
1818

1919
RUN mkdir -p /opt/flink/plugins/flink-jar-runner
2020
COPY flink-jar-runner.uber.jar /opt/flink/plugins/flink-jar-runner
21+
COPY system-functions-discovery-${project.version}.jar /opt/flink/lib/system-functions-discovery.jar

flink-sql-runner/src/main/docker/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
- datasqrl_network
4141

4242
jobmanager:
43-
image: flink:${flink-base-image}
43+
image: flink-sql-runner
4444
environment:
4545
- JDBC_URL=jdbc:postgresql://postgres:5432/datasqrl
4646
- JDBC_USERNAME=postgres
@@ -64,7 +64,6 @@ services:
6464
- ./test-classes/:/opt/flink/usrlib/
6565
- ./test-classes/datasources/:/datasources/
6666
- /tmp:/tmp
67-
- ./system-functions-discovery-${project.version}.jar:/opt/flink/lib/system-functions-discovery.jar
6867
- ./test-classes/systemfunction/system-functions-sample-${project.version}.jar:/opt/flink/lib/systemfunction.jar
6968
healthcheck:
7069
test: ["CMD-SHELL", "curl -f http://localhost:8081/ || exit 1"]
@@ -80,7 +79,7 @@ services:
8079
- datasqrl_network
8180

8281
taskmanager:
83-
image: flink:${flink-base-image}
82+
image: flink-sql-runner
8483
environment:
8584
- JDBC_URL=jdbc:postgresql://postgres:5432/datasqrl
8685
- JDBC_USERNAME=postgres
@@ -100,7 +99,6 @@ services:
10099
- ./test-classes/:/opt/flink/usrlib/
101100
- ./test-classes/datasources/:/datasources/
102101
- /tmp:/tmp
103-
- ./system-functions-discovery-${project.version}.jar:/opt/flink/lib/system-functions-discovery.jar
104102
- ./test-classes/systemfunction/system-functions-sample-${project.version}.jar:/opt/flink/lib/systemfunction.jar
105103
restart: always
106104
deploy:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@
420420
<excludeArtifact>system-functions-sample</excludeArtifact>
421421
<excludeArtifact>udf-sample</excludeArtifact>
422422
</excludeArtifacts>
423-
423+
424424
<autoPublish>true</autoPublish>
425425
</configuration>
426426
</plugin>

0 commit comments

Comments
 (0)