Skip to content

Commit

Permalink
Re-use a constant for static temp location (#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
relud committed Jul 1, 2020
1 parent a5a3e85 commit 59e1dd9
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
*/
public class BigQueryIntegrationTest extends TestWithDeterministicJson {

private static final String STATIC_TEST_TEMP = //
"gs://gcp-ingestion-static-test-bucket/temp/bq-loads";

private BigQuery bigquery;
private String projectId;
private String dataset;
Expand Down Expand Up @@ -112,8 +115,8 @@ public void canWriteToBigQuery() throws Exception {

PipelineResult result = Sink.run(new String[] { "--inputFileFormat=json", "--inputType=file",
"--input=" + input, "--outputType=bigquery", "--bqWriteMethod=file_loads",
"--tempLocation=gs://gcp-ingestion-static-test-bucket/temp/bq-loads",
"--schemasLocation=schemas.tar.gz", "--output=" + output, "--errorOutputType=stderr" });
"--tempLocation=" + STATIC_TEST_TEMP, "--schemasLocation=schemas.tar.gz",
"--output=" + output, "--errorOutputType=stderr" });

result.waitUntilFinish();

Expand Down Expand Up @@ -179,9 +182,8 @@ public void canWriteViaFileLoads() throws Exception {
PipelineResult result = Sink.run(new String[] { "--inputFileFormat=json", "--inputType=file",
"--input=" + input, "--outputType=bigquery", "--output=" + output,
"--bqWriteMethod=file_loads", "--errorOutputType=file",
"--tempLocation=gs://gcp-ingestion-static-test-bucket/temp/bq-loads",
"--schemasLocation=schemas.tar.gz", "--errorOutputFileCompression=UNCOMPRESSED",
"--errorOutput=" + errorOutput });
"--tempLocation=" + STATIC_TEST_TEMP, "--schemasLocation=schemas.tar.gz",
"--errorOutputFileCompression=UNCOMPRESSED", "--errorOutput=" + errorOutput });

result.waitUntilFinish();

Expand Down Expand Up @@ -217,9 +219,8 @@ private void canWriteWithMixedMethod(String streamingDocTypes) throws Exception
PipelineResult result = Sink.run(new String[] { "--inputFileFormat=json", "--inputType=file",
"--input=" + input, "--outputType=bigquery", "--output=" + output, "--bqWriteMethod=mixed",
"--bqStreamingDocTypes=" + streamingDocTypes, "--errorOutputType=file",
"--tempLocation=gs://gcp-ingestion-static-test-bucket/temp/bq-loads",
"--schemasLocation=schemas.tar.gz", "--errorOutputFileCompression=UNCOMPRESSED",
"--errorOutput=" + errorOutput });
"--tempLocation=" + STATIC_TEST_TEMP, "--schemasLocation=schemas.tar.gz",
"--errorOutputFileCompression=UNCOMPRESSED", "--errorOutput=" + errorOutput });

result.waitUntilFinish();

Expand Down Expand Up @@ -414,9 +415,9 @@ public void canLoadAndReadDecodedFormat() throws Exception {

PipelineResult result = Sink.run(new String[] { "--inputFileFormat=json", "--inputType=file",
"--input=" + input, "--outputType=bigquery", "--bqWriteMethod=file_loads",
"--tempLocation=gs://gcp-ingestion-static-test-bucket/temp/bq-loads",
"--decompressInputPayloads=false", "--outputTableRowFormat=decoded",
"--output=" + fullyQualifiedTableSpec, "--errorOutputType=stderr" });
"--tempLocation=" + STATIC_TEST_TEMP, "--decompressInputPayloads=false",
"--outputTableRowFormat=decoded", "--output=" + fullyQualifiedTableSpec,
"--errorOutputType=stderr" });

result.waitUntilFinish();

Expand Down

0 comments on commit 59e1dd9

Please sign in to comment.