Skip to content

Commit

Permalink
Add inital Kafka smoke product tests
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk authored and kokosing committed Jul 23, 2018
1 parent 339f10e commit 78cf150
Show file tree
Hide file tree
Showing 12 changed files with 384 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -84,7 +84,7 @@ script:
- |
if [[ -v PRODUCT_TESTS_BASIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode -x quarantine,big_query,storage_formats,profile_specific_tests,tpcds,cassandra,mysql_connector,postgresql_connector,mysql
multinode -x quarantine,big_query,storage_formats,profile_specific_tests,tpcds,cassandra,mysql_connector,postgresql_connector,mysql,kafka
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
Expand Down Expand Up @@ -148,6 +148,11 @@ script:
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-impersonation-with-wire-encryption -g storage_formats,cli,hdfs_impersonation,authorization
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT_2 ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kafka -g kafka
fi
- |
if [[ -v HIVE_TESTS ]]; then
presto-hive-hadoop2/bin/run_hive_tests.sh
Expand Down
18 changes: 17 additions & 1 deletion pom.xml
Expand Up @@ -886,7 +886,7 @@
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.1.7</version>
<version>1.1.2.6</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -955,6 +955,22 @@
</exclusions>
</dependency>

<dependency>
<groupId>io.prestodb.tempto</groupId>
<artifactId>tempto-kafka</artifactId>
<version>${dep.tempto.version}</version>
<exclusions>
<exclusion>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.prestodb.tempto</groupId>
<artifactId>tempto-runner</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions presto-product-tests/bin/run_on_docker.sh
Expand Up @@ -154,6 +154,8 @@ elif [[ "$ENVIRONMENT" == "singlenode-postgresql" ]]; then
EXTERNAL_SERVICES="hadoop-master postgres"
elif [[ "$ENVIRONMENT" == "singlenode-cassandra" ]]; then
EXTERNAL_SERVICES="hadoop-master cassandra"
elif [[ "$ENVIRONMENT" == "singlenode-kafka" ]]; then
EXTERNAL_SERVICES="hadoop-master kafka"
else
EXTERNAL_SERVICES="hadoop-master"
fi
Expand Down
10 changes: 10 additions & 0 deletions presto-product-tests/conf/docker/singlenode-kafka/compose.sh
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

source "${BASH_SOURCE%/*}/../common/compose-commons.sh"

docker-compose \
-f ${BASH_SOURCE%/*}/../common/standard.yml \
-f ${BASH_SOURCE%/*}/docker-compose.yml \
"$@"
@@ -0,0 +1,14 @@
version: '2'
services:

kafka:
hostname: kafka
image: spotify/kafka
ports:
- 9092:9092
- 2181:2181
command: |
bash -xeuo pipefail -c "
sed -i 's/#delete.topic.enable=true/delete.topic.enable=true/' /opt/kafka_2.11-0.10.1.0/config/server.properties
exec supervisord -n
"
5 changes: 5 additions & 0 deletions presto-product-tests/conf/presto/etc/catalog/kafka.properties
@@ -0,0 +1,5 @@
connector.name=kafka
kafka.table-names=product_tests.simple_key_and_value,\
product_tests.all_datatypes_raw
kafka.nodes=kafka:9092
kafka.table-description-dir=/docker/volumes/conf/presto/etc/catalog/kafka
@@ -0,0 +1,129 @@
{
"tableName": "all_datatypes_raw",
"schemaName": "product_tests",
"topicName": "all_datatypes_raw",
"message": {
"dataFormat": "raw",
"fields": [
{
"name": "c_varchar",
"type": "VARCHAR",
"mapping": "0:5"
},



{
"name": "c_byte_bigint",
"dataFormat": "BYTE",
"type": "BIGINT",
"mapping": "5"
},
{
"name": "c_short_bigint",
"dataFormat": "SHORT",
"type": "BIGINT",
"mapping": "6"
},
{
"name": "c_int_bigint",
"dataFormat": "INT",
"type": "BIGINT",
"mapping": "8"
},
{
"name": "c_long_bigint",
"dataFormat": "LONG",
"type": "BIGINT",
"mapping": "12"
},



{
"name": "c_byte_integer",
"dataFormat": "BYTE",
"type": "INTEGER",
"mapping": "20"
},
{
"name": "c_short_integer",
"dataFormat": "SHORT",
"type": "INTEGER",
"mapping": "21"
},
{
"name": "c_int_integer",
"dataFormat": "INT",
"type": "INTEGER",
"mapping": "23"
},



{
"name": "c_byte_smallint",
"dataFormat": "BYTE",
"type": "SMALLINT",
"mapping": "27"
},
{
"name": "c_short_smallint",
"dataFormat": "SHORT",
"type": "SMALLINT",
"mapping": "28"
},



{
"name": "c_byte_tinyint",
"dataFormat": "BYTE",
"type": "TINYINT",
"mapping": "30"
},



{
"name": "c_float_double",
"dataFormat": "FLOAT",
"type": "DOUBLE",
"mapping": "31"
},
{
"name": "c_double_double",
"dataFormat": "double",
"type": "DOUBLE",
"mapping": "35"
},



{
"name": "c_byte_boolean",
"dataFormat": "BYTE",
"type": "BOOLEAN",
"mapping": "43"
},
{
"name": "c_short_boolean",
"dataFormat": "SHORT",
"type": "BOOLEAN",
"mapping": "44"
},
{
"name": "c_int_boolean",
"dataFormat": "INT",
"type": "BOOLEAN",
"mapping": "46"
},
{
"name": "c_long_boolean",
"dataFormat": "LONG",
"type": "BOOLEAN",
"mapping": "50"
}
]
}
}
@@ -0,0 +1,35 @@
{
"tableName": "simple_key_and_value",
"schemaName": "product_tests",
"topicName": "simple_key_and_value",
"message": {
"dataFormat": "csv",
"fields": [
{
"name": "varchar_value",
"type": "VARCHAR",
"mapping": "0"
},
{
"name": "bigint_value",
"type": "BIGINT",
"mapping": "1"
}
]
},
"key": {
"dataFormat": "csv",
"fields": [
{
"name": "varchar_key",
"type": "VARCHAR",
"mapping": "0"
},
{
"name": "bigint_key",
"type": "BIGINT",
"mapping": "1"
}
]
}
}
10 changes: 10 additions & 0 deletions presto-product-tests/pom.xml
Expand Up @@ -24,6 +24,12 @@
<dependency>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-main</artifactId>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.prestodb.tempto</groupId>
Expand All @@ -33,6 +39,10 @@
<groupId>io.prestodb.tempto</groupId>
<artifactId>tempto-ldap</artifactId>
</dependency>
<dependency>
<groupId>io.prestodb.tempto</groupId>
<artifactId>tempto-kafka</artifactId>
</dependency>
<dependency>
<groupId>io.prestodb.tempto</groupId>
<artifactId>tempto-runner</artifactId>
Expand Down
Expand Up @@ -62,6 +62,7 @@ public final class TestGroups
public static final String CANCEL_QUERY = "cancel_query";
public static final String BIG_QUERY = "big_query";
public static final String HIVE_TABLE_STATISTICS = "hive_table_statistics";
public static final String KAFKA = "kafka";

private TestGroups() {}
}

0 comments on commit 78cf150

Please sign in to comment.