[ 
https://issues.apache.org/jira/browse/BEAM-3339?focusedWorklogId=89183&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-89183
 ]

ASF GitHub Bot logged work on BEAM-3339:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Apr/18 23:19
            Start Date: 09/Apr/18 23:19
    Worklog Time Spent: 10m 
      Work Description: tgroh commented on a change in pull request #4788: 
[BEAM-3339] Mobile gaming automation for Java nightly snapshot on core runners
URL: https://github.com/apache/beam/pull/4788#discussion_r180257360
 
 

 ##########
 File path: release/src/main/groovy/mobilegaming-java-direct.groovy
 ##########
 @@ -0,0 +1,105 @@
+#!groovy
+/*
+ * 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 MobileGamingJavaUtils
+
+t = new TestScripts(args)
+
+/*
+ * Run the mobile game examples on DirectRunner.
+ * https://beam.apache.org/get-started/mobile-gaming-example/
+ */
+
+t.describe ('Run Apache Beam Java SDK Mobile Gaming Examples - Direct')
+
+QuickstartArchetype.generate(t)
+
+def runner = "DirectRunner"
+String command_output_text
+
+/**
+ * Run the UserScore example with DirectRunner
+ * */
+
+t.intent("Running: UserScore example on DirectRunner")
+t.run(MobileGamingJavaUtils.createExampleExecutionCommand("UserScore", runner, 
t))
+command_output_text = t.run "grep user19_BananaWallaby 
${MobileGamingJavaUtils.getUserScoreOutputName(runner)}* "
+t.see "total_score: 231, user: user19_BananaWallaby", command_output_text
+t.success("UserScore successfully run on DirectRunners.")
+
+
+/**
+ * Run the HourlyTeamScore example with DirectRunner
+ * */
+
+t.intent("Running: HourlyTeamScore example on DirectRunner")
+t.run(MobileGamingJavaUtils.createExampleExecutionCommand("HourlyTeamScore", 
runner, t))
+command_output_text = t.run "grep AzureBilby 
${MobileGamingJavaUtils.getHourlyTeamScoreOutputName(runner)}* "
+t.see "total_score: 2788, team: AzureBilby", command_output_text
+t.success("HourlyTeamScore successfully run on DirectRunners.")
+
+
+/**
+ * Run the LeaderBoard example with DirectRunner
+ * */
+
+t.intent("Running: LeaderBoard example on DirectRunner")
+t.run("bq rm -f -t ${t.bqDataset()}.leaderboard_DirectRunner_user")
+t.run("bq rm -f -t ${t.bqDataset()}.leaderboard_DirectRunner_team")
+// it will take couple seconds to clean up tables. This loop makes sure tables 
are completely deleted before running the pipeline
+String tables = ""
+while({
+  sleep(3000)
+  tables = t.run ("bq query SELECT table_id FROM 
${t.bqDataset()}.__TABLES_SUMMARY__")
+  tables.contains("leaderboard_${runner}_user") || 
tables.contains("leaderboard_${runner}_team")
+}());
+
+def InjectorThread = Thread.start() {
+  t.run(MobileGamingJavaUtils.createInjectorCommand(t))
+}
+
+def LeaderBoardThread = Thread.start() {
+  t.run(MobileGamingJavaUtils.createExampleExecutionCommand("LeaderBoard", 
runner, t))
+}
+
+// verify outputs in BQ tables
+def startTime = System.currentTimeMillis()
+def isSuccess = false
+String query_result = ""
+while((System.currentTimeMillis() - startTime)/60000 < 
MobileGamingJavaUtils.EXECUTION_TIMEOUT_IN_MINUTES) {
+  tables = t.run "bq query SELECT table_id FROM 
${t.bqDataset()}.__TABLES_SUMMARY__"
+  if(tables.contains("leaderboard_${runner}_user") && 
tables.contains("leaderboard_${runner}_team")){
+    query_result = t.run """bq query --batch "SELECT user FROM 
[${t.gcpProject()}:${t.bqDataset()}.leaderboard_${runner}_user] LIMIT 10\""""
+    if(t.seeAnyOf(MobileGamingJavaUtils.COLORS, query_result)){
+      isSuccess = true
+      break
+    }
+  }
+  println "Waiting for verifying results..."
 
 Review comment:
   Something more like "Waiting for pipeline to produce more results"?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 89183)

> Create post-release testing of the nightly snapshots
> ----------------------------------------------------
>
>                 Key: BEAM-3339
>                 URL: https://issues.apache.org/jira/browse/BEAM-3339
>             Project: Beam
>          Issue Type: Improvement
>          Components: testing
>            Reporter: Alan Myrvold
>            Assignee: Jason Kuster
>            Priority: Major
>          Time Spent: 81h
>  Remaining Estimate: 0h
>
> The nightly java snapshots in 
> https://repository.apache.org/content/groups/snapshots/org/apache/beam should 
> be verified by following the 
> https://beam.apache.org/get-started/quickstart-java/ instructions, to verify 
> that the release is usable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to