flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #6083: [FLINK-8983] End-to-end test: Confluent schema reg...
Date Thu, 14 Jun 2018 15:56:41 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6083#discussion_r195477424
  
    --- Diff: flink-end-to-end-tests/test-scripts/test-confluent-schema-registry.sh ---
    @@ -0,0 +1,106 @@
    +#!/usr/bin/env bash
    +################################################################################
    +# 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.
    +################################################################################
    +
    +source "$(dirname "$0")"/common.sh
    +source "$(dirname "$0")"/kafka-common.sh
    +
    +function verify_output {
    +  local expected=$(printf $1)
    +
    +  if [[ "$2" != "$expected" ]]; then
    +    echo "Output from Flink program does not match expected output."
    +    echo -e "EXPECTED FOR KEY: --$expected--"
    +    echo -e "ACTUAL: --$2--"
    +    PASS=""
    +    exit 1
    +  fi
    +}
    +
    +function test_cleanup {
    +  # don't call ourselves again for another signal interruption
    +  trap "exit -1" INT
    +  # don't call ourselves again for normal exit
    +  trap "" EXIT
    +
    +  stop_kafka_cluster
    +  stop_confluent_schema_registry
    +
    +  # revert our modifications to the Flink distribution
    +  mv -f $FLINK_DIR/conf/flink-conf.yaml.bak $FLINK_DIR/conf/flink-conf.yaml
    +
    +  # make sure to run regular cleanup as well
    +  cleanup
    +}
    +
    +trap test_cleanup INT
    +trap test_cleanup EXIT
    +
    +setup_kafka_dist
    +setup_confluent_dist
    +
    +cd flink-end-to-end-tests/flink-confluent-schema-registry
    +mvn clean package -Pbuild-jar -nsu
    +
    +start_kafka_cluster
    +start_confluent_schema_registry
    +sleep 5
    +
    +# modify configuration to use port 8082 for Flink
    +cp $FLINK_DIR/conf/flink-conf.yaml $FLINK_DIR/conf/flink-conf.yaml.bak
    +sed -i -e "s/web.port: 8081/web.port: 8082/" $FLINK_DIR/conf/flink-conf.yaml
    +
    +TEST_PROGRAM_JAR=target/flink-confluent-schema-registry-1.6-SNAPSHOT.jar
    +
    +INPUT_MESSAGE_1='{"name":"Alyssa","favoriteNumber":"250","favoriteColor":"green","eventType":"meeting"}'
    +INPUT_MESSAGE_2='{"name":"Charlie","favoriteNumber":"10","favoriteColor":"blue","eventType":"meeting"}'
    +INPUT_MESSAGE_3='{"name":"Ben","favoriteNumber":"7","favoriteColor":"red","eventType":"meeting"}'
    +USER_SCHEMA='{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string","default":""},{"name":"favoriteNumber","type":"string","default":""},{"name":"favoriteColor","type":"string","default":""},{"name":"eventType","type":{"name":"EventType","type":"enum","symbols":["meeting"]}}]}'
    +
    +curl -X POST \
    +  http://localhost:8081/subjects/users-value/versions \
    +  -H 'cache-control: no-cache' \
    +  -H 'content-type: application/vnd.schemaregistry.v1+json' \
    +  -d '{"schema": "{\"namespace\": \"example.avro\",\"type\": \"record\",\"name\": \"User\",\"fields\":
[{\"name\": \"name\", \"type\": \"string\", \"default\": \"\"},{\"name\": \"favoriteNumber\",
 \"type\": \"string\", \"default\": \"\"},{\"name\": \"favoriteColor\", \"type\": \"string\",
\"default\": \"\"},{\"name\": \"eventType\",\"type\": {\"name\": \"EventType\",\"type\": \"enum\",
\"symbols\": [\"meeting\"] }}]}"}'
    --- End diff --
    
    Do we have to manually register the schema or does it also work with sending the first
record to the input topic?


---

Mime
View raw message