| /* |
| * 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( |
| automaticModuleName: 'org.apache.beam.sdk.io.gcp', |
| enableSpotbugs: false, |
| ) |
| |
| description = "Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform" |
| ext.summary = "IO library to read and write Google Cloud Platform systems from Beam." |
| |
| dependencies { |
| compile project(path: ":sdks:java:core", configuration: "shadow") |
| compile project(":sdks:java:extensions:google-cloud-platform-core") |
| compile project(":sdks:java:extensions:protobuf") |
| compile library.java.avro |
| compile library.java.bigdataoss_util |
| compile library.java.gax_grpc |
| compile library.java.google_api_client |
| compile library.java.google_api_services_bigquery |
| compile library.java.google_api_services_pubsub |
| compile library.java.google_auth_library_credentials |
| compile library.java.google_auth_library_oauth2_http |
| compile library.java.google_cloud_bigquery_storage |
| compile library.java.google_cloud_bigtable_client_core |
| compile library.java.google_cloud_core |
| compile library.java.google_cloud_core_grpc |
| compile library.java.google_cloud_datastore_v1_proto_client |
| compile library.java.google_cloud_spanner |
| compile library.java.google_http_client |
| compile library.java.google_http_client_jackson2 |
| compile library.java.grpc_all |
| compile library.java.grpc_auth |
| compile library.java.grpc_core |
| compile library.java.grpc_netty |
| compile library.java.grpc_stub |
| compile library.java.grpc_google_cloud_pubsub_v1 |
| compile library.java.guava |
| compile library.java.jackson_databind |
| compile library.java.joda_time |
| compile library.java.netty_handler |
| compile library.java.netty_tcnative_boringssl_static |
| compile library.java.proto_google_cloud_bigquery_storage_v1beta1 |
| compile library.java.proto_google_cloud_bigtable_v2 |
| compile library.java.proto_google_cloud_datastore_v1 |
| compile library.java.proto_google_cloud_pubsub_v1 |
| compile library.java.proto_google_cloud_spanner_admin_database_v1 |
| compile library.java.proto_google_common_protos |
| compile library.java.protobuf_java |
| compile library.java.slf4j_api |
| testCompile project(path: ":sdks:java:core", configuration: "shadowTest") |
| testCompile project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "testRuntime") |
| testCompile project(path: ":runners:direct-java", configuration: "shadow") |
| testCompile library.java.hamcrest_core |
| testCompile library.java.hamcrest_library |
| testCompile library.java.junit |
| testCompile library.java.mockito_core |
| testCompile library.java.powermock |
| testCompile library.java.powermock_mockito |
| 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' |
| maxParallelForks 4 |
| classpath = sourceSets.test.runtimeClasspath |
| testClassesDirs = sourceSets.test.output.classesDirs |
| useJUnit { |
| excludeCategories "org.apache.beam.sdk.testing.UsesKms" |
| } |
| } |
| |
| task integrationTestKms(type: Test) { |
| group = "Verification" |
| def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing' |
| def gcpTempRoot = project.findProperty('gcpTempRootKms') ?: 'gs://temp-storage-for-end-to-end-tests-cmek' |
| 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 '**/*IT.class' |
| maxParallelForks 4 |
| classpath = sourceSets.test.runtimeClasspath |
| testClassesDirs = sourceSets.test.output.classesDirs |
| useJUnit { |
| includeCategories "org.apache.beam.sdk.testing.UsesKms" |
| } |
| } |
| |
| task postCommit { |
| group = "Verification" |
| description = "Integration tests of GCP connectors using the DirectRunner." |
| dependsOn integrationTest |
| dependsOn integrationTestKms |
| } |