Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
chikamura committed Apr 1, 2024
1 parent 7b85649 commit 13f04ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ public class TestDatabricksOutputPlugin {

@Before
public void setup() {
if (ConfigUtil.disableOnlineTest()) {
return;
}
ConnectionUtil.dropAllTemporaryTables();
}

@After
public void cleanup() {
if (ConfigUtil.disableOnlineTest()) {
return;
}
ConnectionUtil.dropAllTemporaryTables();
}

Expand Down
10 changes: 9 additions & 1 deletion src/test/java/org/embulk/output/databricks/util/ConfigUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.embulk.output.databricks.util;

import static com.google.common.base.Strings.isNullOrEmpty;

import org.embulk.config.ConfigSource;
import org.embulk.output.DatabricksOutputPlugin;
import org.embulk.output.jdbc.AbstractJdbcOutputPlugin;
Expand All @@ -18,8 +20,14 @@ public class ConfigUtil {
.build();
private static final ConfigMapper CONFIG_MAPPER = CONFIG_MAPPER_FACTORY.createConfigMapper();

private static final String configEnvName = "EMBULK_OUTPUT_DATABRICKS_TEST_CONFIG";

public static Boolean disableOnlineTest() {
return isNullOrEmpty(System.getenv(configEnvName));
}

public static ConfigSource baseConfigSource() {
return EmbulkTests.config("EMBULK_OUTPUT_DATABRICKS_TEST_CONFIG");
return EmbulkTests.config(configEnvName);
}

public interface TestTask extends Task {
Expand Down
22 changes: 0 additions & 22 deletions src/test/java/org/embulk/output/snowflake/TestingEmbulkHack.java

This file was deleted.

0 comments on commit 13f04ba

Please sign in to comment.