Skip to content

Commit

Permalink
Use unique GCS object path (#30690)
Browse files Browse the repository at this point in the history
  • Loading branch information
damondouglas authored Mar 20, 2024
1 parent cdaae0a commit 4a3b6c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions release/src/main/groovy/MobileGamingCommands.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class MobileGamingCommands {

private TestScripts testScripts
private String testRunId

private static final INPUT_GAMING_DATA = "gs://dataflow-samples/game/5000_gaming_data.csv"

Expand Down Expand Up @@ -58,11 +59,11 @@ class MobileGamingCommands {
"BattleshipGrey"))

public String getUserScoreOutputName(String runner){
return "java-userscore-result-${RUNNERS[runner]}.txt"
return "java-userscore-result-${RUNNERS[runner]}/${testRunId}/output"
}

public String getHourlyTeamScoreOutputName(String runner){
return "java-hourlyteamscore-result-${RUNNERS[runner]}.txt"
return "java-hourlyteamscore-result-${RUNNERS[runner]}/${testRunId}/output"
}

public String createPipelineCommand(String exampleName, String runner, String jobName='', String className=null){
Expand Down
5 changes: 4 additions & 1 deletion release/src/main/groovy/mobilegaming-java-dataflow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

t = new TestScripts(args)
mobileGamingCommands = new MobileGamingCommands(testScripts: t)

/*
* Run the mobile game examples on Dataflow.
Expand All @@ -36,6 +35,8 @@ String command_output_text
* Run the UserScore example on DataflowRunner
* */

mobileGamingCommands = new MobileGamingCommands(testScripts: t, testRunId: UUID.randomUUID().toString())

t.intent("Running: UserScore example on DataflowRunner")
t.run(mobileGamingCommands.createPipelineCommand("UserScore", runner))
command_output_text = t.run "gsutil cat gs://${t.gcsBucket()}/${mobileGamingCommands.getUserScoreOutputName(runner)}* | grep user19_BananaWallaby"
Expand All @@ -48,6 +49,8 @@ t.run "gsutil rm gs://${t.gcsBucket()}/${mobileGamingCommands.getUserScoreOutput
* Run the HourlyTeamScore example on DataflowRunner
* */

mobileGamingCommands = new MobileGamingCommands(testScripts: t, testRunId: UUID.randomUUID().toString())

t.intent("Running: HourlyTeamScore example on DataflowRunner")
t.run(mobileGamingCommands.createPipelineCommand("HourlyTeamScore", runner))
command_output_text = t.run "gsutil cat gs://${t.gcsBucket()}/${mobileGamingCommands.getHourlyTeamScoreOutputName(runner)}* | grep AzureBilby "
Expand Down
5 changes: 4 additions & 1 deletion release/src/main/groovy/mobilegaming-java-direct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

t = new TestScripts(args)
mobileGamingCommands = new MobileGamingCommands(testScripts: t)

/*
* Run the mobile game examples on DirectRunner.
Expand All @@ -36,6 +35,8 @@ String command_output_text
* Run the UserScore example with DirectRunner
* */

mobileGamingCommands = new MobileGamingCommands(testScripts: t, testRunId: UUID.randomUUID().toString())

t.intent("Running: UserScore example on DirectRunner")
t.run(mobileGamingCommands.createPipelineCommand("UserScore", runner))
command_output_text = t.run "grep user19_BananaWallaby ${mobileGamingCommands.getUserScoreOutputName(runner)}* "
Expand All @@ -47,6 +48,8 @@ t.success("UserScore successfully run on DirectRunners.")
* Run the HourlyTeamScore example with DirectRunner
* */

mobileGamingCommands = new MobileGamingCommands(testScripts: t, testRunId: UUID.randomUUID().toString())

t.intent("Running: HourlyTeamScore example on DirectRunner")
t.run(mobileGamingCommands.createPipelineCommand("HourlyTeamScore", runner))
command_output_text = t.run "grep AzureBilby ${mobileGamingCommands.getHourlyTeamScoreOutputName(runner)}* "
Expand Down

0 comments on commit 4a3b6c5

Please sign in to comment.