-
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.
Twitter redesign to move the component to it's separate project. (#14902
) * Twitter redesign to move the component to it's separate project. * Removing unneeded and duplicate tests * GoPortable PreCommit and Java PreCommit correction. * GoPortable PreCommit and Java PreCommit correction. * Fix execute task * Fix execute task * Fix execute task * re ordering the code. * Spark Runner Pre commit failing * Spark Runner removal
- Loading branch information
Showing
13 changed files
with
117 additions
and
9 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
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,105 @@ | ||
/* | ||
* 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 'java' | ||
id 'org.apache.beam.module' | ||
id 'com.github.johnrengelman.shadow' | ||
} | ||
|
||
applyJavaNature( | ||
exportJavadoc: false, | ||
automaticModuleName: 'org.apache.beam.examples.twitterstreamgenerator', | ||
) | ||
provideIntegrationTestingDependencies() | ||
enableJavaPerformanceTesting() | ||
|
||
description = "Apache Beam :: Examples :: Java :: Twitter " | ||
ext.summary = """Apache Beam SDK provides a simple, Java-based | ||
interface for processing virtually any size data. This | ||
artifact includes all Apache Beam Java SDK examples.""" | ||
|
||
/** Define the list of runners which execute a precommit test. | ||
* Some runners are run from separate projects, see the preCommit task below | ||
* for details. | ||
*/ | ||
def preCommitRunners = ["directRunner", "flinkRunner"] | ||
for (String runner : preCommitRunners) { | ||
configurations.create(runner + "PreCommit") | ||
} | ||
|
||
dependencies { | ||
compile enforcedPlatform(library.java.google_cloud_platform_libraries_bom) | ||
compile project(path: ":sdks:java:core", configuration: "shadow") | ||
compile library.java.joda_time | ||
compile library.java.slf4j_api | ||
provided library.java.commons_io | ||
provided library.java.commons_csv | ||
runtime project(path: ":runners:direct-java", configuration: "shadow") | ||
compile ("org.twitter4j:twitter4j-stream:4.0.7") | ||
compile ("org.twitter4j:twitter4j-core:4.0.7") | ||
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.testcontainers_gcloud | ||
|
||
// Add dependencies for the PreCommit configurations | ||
// For each runner a project level dependency on the examples project. | ||
for (String runner : preCommitRunners) { | ||
delegate.add(runner + "PreCommit", project(":examples:java:twitter")) | ||
delegate.add(runner + "PreCommit", project(path: ":examples:java:twitter", configuration: "testRuntime")) | ||
} | ||
directRunnerPreCommit project(path: ":runners:direct-java", configuration: "shadow") | ||
flinkRunnerPreCommit project(":runners:flink:${project.ext.latestFlinkVersion}") | ||
} | ||
|
||
/* | ||
* Create a ${runner}PreCommit task for each runner which runs a set | ||
* of integration tests for WordCount and WindowedWordCount. | ||
*/ | ||
def preCommitRunnerClass = [ | ||
directRunner: "org.apache.beam.runners.direct.DirectRunner", | ||
flinkRunner: "org.apache.beam.runners.flink.TestFlinkRunner", | ||
] | ||
|
||
for (String runner : preCommitRunners) { | ||
tasks.create(name: runner + "PreCommit", type: Test) { | ||
def preCommitBeamTestPipelineOptions = [ | ||
"--runner=" + preCommitRunnerClass[runner], | ||
] | ||
classpath = configurations."${runner}PreCommit" | ||
forkEvery 1 | ||
maxParallelForks 4 | ||
systemProperty "beamTestPipelineOptions", JsonOutput.toJson(preCommitBeamTestPipelineOptions) | ||
} | ||
} | ||
|
||
/* Define a common precommit task which depends on all the individual precommits. */ | ||
task preCommit() { | ||
for (String runner : preCommitRunners) { | ||
dependsOn runner + "PreCommit" | ||
} | ||
} | ||
|
||
task execute (type:JavaExec) { | ||
main = "org.apache.beam.examples.twitterstreamgenerator.TwitterStream" | ||
} |
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
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
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
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
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