Skip to content

Commit

Permalink
[CI] Adjust CI to test the corresponding Pulsar image version (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoran10 authored Sep 7, 2023
1 parent 57e0b95 commit 5659147
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 18 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/pr-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ jobs:
df -h
- name: Build with Maven skipTests
run: mvn clean install -DskipTests
run: |
mvn clean install -DskipTests
- name: build test image
run: |
cd tests
./build.sh
- name: tests module
run: mvn test -pl tests
Expand Down
5 changes: 0 additions & 5 deletions io-amqp1_0-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@

<artifactId>pulsar-io-amqp1_0</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<!-- connector dependencies -->
<jackson.version>2.12.6.1</jackson.version>
<lombok.version>1.18.22</lombok.version>
<pulsar.version>2.11.0.0-rc3</pulsar.version>
<pulsar.version>3.0.1.2</pulsar.version>
<qpid.version>1.8.0</qpid.version>
<log4j2.version>2.17.1</log4j2.version>
<slf4j.version>1.7.25</slf4j.version>
Expand Down
27 changes: 27 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# 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.
#

ARG PULSAR_IMAGE_TAG
FROM streamnative/pulsar:${PULSAR_IMAGE_TAG}

### Add connector
COPY ./src/test/resources/pulsar-io-amqp1_0.nar /pulsar/connectors/pulsar-io-amqp1_0.nar
COPY ./src/test/resources/amqp1_0-source-config.yaml /pulsar/amqp1_0-source-config.yaml
COPY ./src/test/resources/amqp1_0-sink-config.yaml /pulsar/amqp1_0-sink-config.yaml
COPY ./src/test/resources/amqp1_0-source-config-session-mode.yaml /pulsar/amqp1_0-source-config-session-mode.yaml
25 changes: 25 additions & 0 deletions tests/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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.
#

set -e

IMAGE_NAME=pulsar-io-amqp-1-0:test
PULSAR_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${pulsar.version}' --non-recursive exec:exec)
docker build --build-arg PULSAR_IMAGE_TAG="${PULSAR_VERSION}" -t "${IMAGE_NAME}" .
echo "build test image ${IMAGE_NAME} with pulsar version ${PULSAR_VERSION}"
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.awaitility.Awaitility;
import org.junit.Assert;
import org.junit.Test;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.Network;

Expand Down Expand Up @@ -77,14 +76,6 @@ private void test(String sourceConfigYaml) throws Exception {
+ "&& bin/pulsar standalone";
standaloneContainer.withExposedPorts(8080);
standaloneContainer.withCommand("sh", "-c", command);

standaloneContainer.withClasspathResourceMapping(
"pulsar-io-amqp1_0.nar", "/pulsar/connectors/pulsar-io-amqp1_0.nar", BindMode.READ_ONLY);
standaloneContainer.withClasspathResourceMapping(
sourceConfigYaml, "/pulsar/" + sourceConfigYaml, BindMode.READ_ONLY);
standaloneContainer.withClasspathResourceMapping(
"amqp1_0-sink-config.yaml", "/pulsar/amqp1_0-sink-config.yaml", BindMode.READ_ONLY);

standaloneContainer.start();
log.info("standalone container start.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class PulsarStandaloneContainer extends GenericContainer {

public static final String IMAGE = "apachepulsar/pulsar:latest";
public static final String IMAGE = "pulsar-io-amqp-1-0:test";

PulsarStandaloneContainer(String imageName) {
super(imageName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class SolaceContainer extends GenericContainer {

public static final String IMAGE = "solace/solace-pubsub-standard:latest";
public static final String IMAGE = "solace/solace-pubsub-standard:10.5";

SolaceContainer(String imageName) {
super(imageName);
Expand Down

0 comments on commit 5659147

Please sign in to comment.