Skip to content

Commit

Permalink
adjust integration test to test corresponding Pulsar image version
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoran10 committed Sep 7, 2023
1 parent e32946f commit 16bc6ca
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/pr-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ jobs:
df -h
- name: Build with Maven skipTests
run: mvn clean install -DskipTests
run: |
mvn clean install -DskipTests
cd tests/src/test/resources
readonly IMAGE_NAME=pulsar-io-amqp-1-0:test
readonly PULSAR_VERSION=$(cat ../PULSAR_VERSION)
docker build --build-arg PULSAR_IMAGE_TAG="${PULSAR_VERSION}" -t "${IMAGE_NAME}" .
- name: tests module
run: mvn test -pl tests
Expand Down
1 change: 1 addition & 0 deletions PULSAR_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.1.2
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
1 change: 1 addition & 0 deletions scripts/set-pulsar-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ NEW_VERSION=$1
pushd $(dirname "$0")/..

mvn versions:set-property -Dproperty=pulsar.version -DnewVersion=$NEW_VERSION
echo ${NEW_VERSION} > PULSAR_VERSION

popd
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,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
26 changes: 26 additions & 0 deletions tests/src/test/resources/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# 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 ./pulsar-io-amqp1_0.nar /pulsar/connectors/pulsar-io-amqp1_0.nar
COPY ./amqp1_0-source-config.yaml /pulsar/amqp1_0-source-config.yaml
COPY ./amqp1_0-sink-config.yaml /pulsar/amqp1_0-sink-config.yaml

0 comments on commit 16bc6ca

Please sign in to comment.