Skip to content

Commit

Permalink
attempt to fix mssql (#42943)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohansong authored Aug 1, 2024
1 parent 2320f78 commit 7e9fbc5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv;
import io.airbyte.commons.features.FeatureFlags;
import io.airbyte.commons.features.FeatureFlagsWrapper;
import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage;

public class CloudDeploymentSslEnabledMssqlSourceAcceptanceTest extends MssqlSourceAcceptanceTest {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) {
final var container = new MsSQLContainerFactory().shared("mcr.microsoft.com/mssql/server:2022-latest");
final var container = new MsSQLContainerFactory().shared(BaseImage.MSSQL_2022.reference);
testdb = new MsSQLTestDatabase(container);
testdb = testdb
.withConnectionProperty("encrypt", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import io.airbyte.cdk.integrations.standardtest.source.TestDestinationEnv;
import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage;

public class SslEnabledMssqlSourceAcceptanceTest extends MssqlSourceAcceptanceTest {

Expand All @@ -18,7 +19,7 @@ protected JsonNode getConfig() {

@Override
protected void setupEnvironment(final TestDestinationEnv environment) {
final var container = new MsSQLContainerFactory().shared("mcr.microsoft.com/mssql/server:2022-latest");
final var container = new MsSQLContainerFactory().shared(BaseImage.MSSQL_2022.reference);
testdb = new MsSQLTestDatabase(container);
testdb = testdb
.withConnectionProperty("encrypt", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.airbyte.cdk.integrations.base.ssh.SshTunnel;
import io.airbyte.commons.features.EnvVariableFeatureFlags;
import io.airbyte.commons.features.FeatureFlagsWrapper;
import io.airbyte.integrations.source.mssql.MsSQLTestDatabase.BaseImage;
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
Expand All @@ -24,7 +25,7 @@ public class CloudDeploymentMssqlTest {

private MsSQLTestDatabase createTestDatabase(String... containerFactoryMethods) {
final var container = new MsSQLContainerFactory().shared(
"mcr.microsoft.com/mssql/server:2022-latest", containerFactoryMethods);
BaseImage.MSSQL_2022.reference, containerFactoryMethods);
final var testdb = new MsSQLTestDatabase(container);
return testdb
.withConnectionProperty("encrypt", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ public void dropDatabaseAndUser() {
}

public Stream<String> mssqlCmd(final Stream<String> sql) {
return Stream.of("/opt/mssql-tools/bin/sqlcmd",
return Stream.of("/opt/mssql-tools18/bin/sqlcmd",
"-U", getContainer().getUsername(),
"-P", getContainer().getPassword(),
"-Q", sql.collect(Collectors.joining("; ")),
"-b", "-e");
"-b", "-e", "-C");
}

@Override
Expand Down

0 comments on commit 7e9fbc5

Please sign in to comment.