Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
chore: refactered batch tests (#599)
Browse files Browse the repository at this point in the history
* chore: fix batch test

* chore: revert model IDs

* 馃 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

* chore: added /

* test: refactored batch tests

* 馃 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
munkhuushmgl and gcf-owl-bot[bot] committed Jun 28, 2021
1 parent 283a4b9 commit 225621b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
Expand Up @@ -27,6 +27,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.After;
Expand All @@ -44,8 +45,9 @@ public class BatchTranslateTextTests {

private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
private static final String INPUT_URI = "gs://cloud-samples-data/translation/text.txt";
private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/";
private static final String OUTPUT_URI = String.format("gs://%s/%s", PROJECT_ID, PREFIX);
private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT_";
private static final String OUTPUT_URI =
String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID());

private ByteArrayOutputStream bout;
private PrintStream out;
Expand Down
Expand Up @@ -27,6 +27,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.After;
Expand All @@ -47,8 +48,9 @@ public class BatchTranslateTextWithGlossaryAndModelTests {
"gs://cloud-samples-data/translation/text_with_custom_model_and_glossary.txt";
private static final String GLOSSARY_ID = "DO_NOT_DELETE_TEST_GLOSSARY";
private static final String MODEL_ID = "TRL3645318651705294848";
private static final String PREFIX = "BATCH_TRANSLATION_MODEL_GLOS_OUTPUT/";
private static final String OUTPUT_URI = String.format("gs://%s/%s", PROJECT_ID, PREFIX);
private static final String PREFIX = "BATCH_TRANSLATION_MODEL_GLOS_OUTPUT_";
private static final String OUTPUT_URI =
String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID());

private ByteArrayOutputStream bout;
private PrintStream out;
Expand Down
Expand Up @@ -27,6 +27,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.After;
Expand All @@ -46,8 +47,9 @@ public class BatchTranslateTextWithGlossaryTests {
private static final String INPUT_URI =
"gs://cloud-samples-data/translation/text_with_glossary.txt";
private static final String GLOSSARY_ID = "DO_NOT_DELETE_TEST_GLOSSARY";
private static final String PREFIX = "BATCH_TRANSLATION_GLOSSARY_OUTPUT/";
private static final String OUTPUT_URI = String.format("gs://%s/%s", PROJECT_ID, PREFIX);
private static final String PREFIX = "BATCH_TRANSLATION_GLOSSARY_OUTPUT_";
private static final String OUTPUT_URI =
String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID());

private ByteArrayOutputStream bout;
private PrintStream out;
Expand Down
Expand Up @@ -27,6 +27,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.After;
Expand All @@ -46,8 +47,9 @@ public class BatchTranslateTextWithModelTests {
private static final String INPUT_URI =
"gs://cloud-samples-data/translation/custom_model_text.txt";
private static final String MODEL_ID = "TRL3645318651705294848";
private static final String PREFIX = "BATCH_TRANSLATION_WITH_MODEL_OUTPUT/";
private static final String OUTPUT_URI = String.format("gs://%s/%s", PROJECT_ID, PREFIX);
private static final String PREFIX = "BATCH_TRANSLATION_WITH_MODEL_OUTPUT_";
private static final String OUTPUT_URI =
String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID());

private ByteArrayOutputStream bout;
private PrintStream out;
Expand Down

0 comments on commit 225621b

Please sign in to comment.