-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Prism] Enable Java validatesRunner tests on Prism (#31075)
* Create :runners:prism:java:validatesRunner task * Configure minimal needed to run portability tests * Condence path resolutions in gradle configuration
- Loading branch information
1 parent
ee329ef
commit 6995666
Showing
3 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
plugins { id 'org.apache.beam.module' } | ||
applyGoNature() | ||
|
||
description = "Apache Beam :: Runners :: Prism" | ||
ext.summary = "Tasks related to executing the Prism Runner" | ||
|
||
// jobPort Property optionally configures the Prism job_port flag. | ||
def jobPort = findProperty("jobPort") | ||
|
||
// jobPortFlag is Prism service's job management service port flag name. | ||
def jobPortFlag = "job_port" | ||
|
||
// buildTarget is the go build output target path for the Prism service. | ||
def buildTarget = layout.buildDirectory.get().file("tmp/prism") | ||
|
||
// modDir is the path containing the go.mod file. | ||
def modDir = project.rootDir.toPath().resolve("sdks") | ||
|
||
// prismDir is the directory containing the prism executable. | ||
def prismDir = modDir.resolve("go/cmd/prism") | ||
|
||
// Overrides the gradle build task to build the prism executable. | ||
def buildTask = tasks.named("build") { | ||
// goPrepare is a task registered in applyGoNature. | ||
dependsOn("goPrepare") | ||
doLast { | ||
exec { | ||
workingDir = modDir | ||
executable = 'sh' | ||
args = ["-c", "${project.ext.goCmd} build -o $buildTarget $prismDir"] | ||
} | ||
} | ||
} | ||
|
||
tasks.register("runServer", Exec) { | ||
dependsOn(buildTask) | ||
group = "application" | ||
description = "Run the Prism server" | ||
|
||
List<String> command = new ArrayList<>() | ||
command.add(buildTarget.asFile.path) | ||
if (jobPort != null) { | ||
command.add("-$jobPortFlag=$jobPort" as String) | ||
} | ||
|
||
commandLine = command | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters