From 3a9dd2feee9af716c9083acbece06dc24a7c6a70 Mon Sep 17 00:00:00 2001 From: Joe Bell Date: Tue, 3 Jan 2023 16:08:32 -0800 Subject: [PATCH] Randomize namespace to avoid false successes (#20775) * add randomization to namespace testing * formatting --- .../standardtest/destination/DestinationAcceptanceTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java index 23703a3d47dd..8cc4237f27a2 100644 --- a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java +++ b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java @@ -23,6 +23,7 @@ import io.airbyte.commons.json.Jsons; import io.airbyte.commons.lang.Exceptions; import io.airbyte.commons.resources.MoreResources; +import io.airbyte.commons.string.Strings; import io.airbyte.commons.util.MoreIterators; import io.airbyte.config.EnvConfigs; import io.airbyte.config.JobGetSpecConfig; @@ -986,7 +987,10 @@ void testSyncUsesAirbyteStreamNamespaceIfNotNull() throws Exception { Jsons.deserialize( MoreResources.readResource(DataArgumentsProvider.EXCHANGE_RATE_CONFIG.getCatalogFileVersion(getProtocolVersion())), AirbyteCatalog.class); - final String namespace = "sourcenamespace"; + // A randomized namespace is required otherwise you can generate a "false success" with data from a + // previous run. + final String namespace = Strings.addRandomSuffix("airbyte_source_namespace", "_", 8); + catalog.getStreams().forEach(stream -> stream.setNamespace(namespace)); final ConfiguredAirbyteCatalog configuredCatalog = CatalogHelpers.toDefaultConfiguredCatalog( catalog);