blob: 8dac81f944957dd42eb53b36531e2e42a3e2e621 [file]
/*
* 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.
*/
apply plugin: org.apache.beam.gradle.BeamModulePlugin
applyPythonNature()
description = "Apache Beam :: SDKs :: Python :: Benchmarks :: TPC-DS"
def tpcdsArgsProperty = "tpcds.args"
def getTpcdsArgs = {
def tpcdsArgsStr = project.findProperty(tpcdsArgsProperty) ?: ""
def tpcdsArgsList = new ArrayList<String>()
if (tpcdsArgsStr.trim()) {
Collections.addAll(tpcdsArgsList, tpcdsArgsStr.trim().split("\\s+"))
}
return tpcdsArgsList
}
def copyTpcdsResources = tasks.register("copyTpcdsResources", Copy) {
from "${project.rootDir}/sdks/java/testing/tpcds/src/main/resources"
into "${project.buildDir}"
}
tasks.register("run", Exec) {
dependsOn installGcpTest
dependsOn copyTpcdsResources
dependsOn ":sdks:java:extensions:sql:expansion-service:shadowJar"
setWorkingDir "${project.rootDir}/sdks/python"
doFirst {
def argsList = getTpcdsArgs()
commandLine 'sh', '-c', ". ${envdir}/bin/activate && python -m apache_beam.testing.benchmarks.tpcds.tpcds_launcher " + String.join(" ", argsList)
}
}
tasks.register("checkAllQueries", Exec) {
description = "Runs the full 103-query TPC-DS suite on PrismRunner with 10MB dataset and verifies against KNOWN_FAILING_QUERIES."
dependsOn installGcpTest
dependsOn copyTpcdsResources
dependsOn ":sdks:java:extensions:sql:expansion-service:shadowJar"
setWorkingDir "${project.rootDir}/sdks/python"
doFirst {
def argsList = getTpcdsArgs()
if (!argsList.any { it.startsWith("--queries") }) {
argsList.add("--queries=all")
}
if (!argsList.any { it.startsWith("--check_regression") }) {
argsList.add("--check_regression")
}
commandLine 'sh', '-c', ". ${envdir}/bin/activate && python -m apache_beam.testing.benchmarks.tpcds.tpcds_launcher " + String.join(" ", argsList)
}
}
tasks.register("pytest", Exec) {
dependsOn installGcpTest
dependsOn copyTpcdsResources
dependsOn ":sdks:java:extensions:sql:expansion-service:shadowJar"
setWorkingDir "${project.rootDir}/sdks/python"
doFirst {
commandLine 'sh', '-c', ". ${envdir}/bin/activate && python -m pytest -v apache_beam/testing/benchmarks/tpcds/tpcds_test.py"
}
}
tasks.named("test") {
dependsOn "pytest"
}