blob: 57ffe214c2078d6cfcf88fdf7290410b44bae03e [file] [log] [blame]
/*
* 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.
*/
import groovy.json.JsonOutput
plugins { id 'org.apache.beam.module' }
applyJavaNature(
enableSpotbugs: false,
// Override the default shading configuration to exclude everything since
// Bigtable needs to expose Guava types.
shadowClosure: {
dependencies {
exclude(dependency(".*:.*"))
}
})
description = "Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform"
ext.summary = "IO library to read and write Google Cloud Platform systems from Beam."
dependencies {
shadow project(path: ":sdks:java:core", configuration: "shadow")
shadow project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "shadow")
shadow project(path: ":sdks:java:extensions:protobuf", configuration: "shadow")
shadow library.java.guava
shadow library.java.jackson_databind
shadow library.java.grpc_core
shadow library.java.google_api_services_bigquery
shadow library.java.gax_grpc
shadow library.java.google_cloud_core_grpc
shadow library.java.google_api_services_pubsub
shadow library.java.grpc_google_cloud_pubsub_v1
shadow library.java.proto_google_cloud_pubsub_v1
shadow library.java.bigdataoss_util
shadow library.java.datastore_v1_proto_client
shadow library.java.datastore_v1_protos
shadow library.java.grpc_auth
shadow library.java.grpc_netty
shadow library.java.netty_handler
shadow library.java.grpc_stub
shadow library.java.joda_time
shadow library.java.google_cloud_bigquery_storage
shadow library.java.google_cloud_bigquery_storage_proto
shadow library.java.google_cloud_core
shadow library.java.google_cloud_spanner
shadow library.java.bigtable_protos
shadow library.java.bigtable_client_core
shadow library.java.google_api_client
shadow library.java.google_http_client
shadow library.java.google_http_client_jackson2
shadow library.java.google_auth_library_credentials
shadow library.java.google_auth_library_oauth2_http
shadow library.java.slf4j_api
shadow library.java.protobuf_java
shadow library.java.avro
shadow library.java.proto_google_cloud_spanner_admin_database_v1
shadow library.java.proto_google_common_protos
shadow library.java.grpc_all
shadow library.java.netty_tcnative_boringssl_static
shadowTest project(path: ":sdks:java:core", configuration: "shadowTest")
shadowTest project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "shadowTest")
shadowTest project(path: ":runners:direct-java", configuration: "shadow")
shadowTest library.java.hamcrest_core
shadowTest library.java.hamcrest_library
shadowTest library.java.mockito_core
shadowTest library.java.junit
shadowTest library.java.powermock
testRuntimeOnly library.java.slf4j_jdk14
}
/**
* These are integration tests with the real Pubsub service and the DirectRunner.
*/
task integrationTest(type: Test) {
group = "Verification"
def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing'
def gcpTempRoot = project.findProperty('gcpTempRoot') ?: 'gs://temp-storage-for-end-to-end-tests'
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=DirectRunner",
"--project=${gcpProject}",
"--tempRoot=${gcpTempRoot}",
])
// Disable Gradle cache: these ITs interact with live service that should always be considered "out of date"
outputs.upToDateWhen { false }
include '**/*IT.class'
exclude '**/BigQueryIOReadIT.class'
exclude '**/BigQueryIOStorageQueryIT.class'
exclude '**/BigQueryIOStorageReadIT.class'
exclude '**/BigQueryIOStorageReadTableRowIT.class'
exclude '**/BigQueryToTableIT.class'
exclude '**/*KmsKeyIT.class'
maxParallelForks 4
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
useJUnit { }
}
task integrationTestKms(type: Test) {
group = "Verification"
def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing'
def gcpTempRoot = project.findProperty('gcpTempRoot') ?: 'gs://temp-storage-for-end-to-end-tests'
def dataflowKmsKey = project.findProperty('dataflowKmsKey') ?: "projects/apache-beam-testing/locations/global/keyRings/beam-it/cryptoKeys/test"
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=DirectRunner",
"--project=${gcpProject}",
"--tempRoot=${gcpTempRoot}",
"--dataflowKmsKey=${dataflowKmsKey}",
])
// Disable Gradle cache: these ITs interact with live service that should always be considered "out of date"
outputs.upToDateWhen { false }
include '**/*KmsKeyIT.class'
maxParallelForks 4
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
useJUnit { }
}
task postCommit {
group = "Verification"
description = "Integration tests of GCP connectors using the DirectRunner."
dependsOn integrationTest
dependsOn integrationTestKms
}