Skip to content

Commit

Permalink
disable almost all tests from CdcMssqlSourceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-airbyte committed Feb 23, 2024
1 parent 24cc714 commit 117dd90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ protected void assertExpectedRecords(final Set<JsonNode> expectedRecords,
assertEquals(expectedRecords, actualData);
}

@Test
// On the first sync, produce returns records that exist in the database.
//@Test
//On the first sync, produce returns records that exist in the database.
void testExistingData() throws Exception {
final CdcTargetPosition targetPosition = cdcLatestTargetPosition();
final AutoCloseableIterator<AirbyteMessage> read = source().read(config(), getConfiguredCatalog(), null);
Expand All @@ -349,8 +349,8 @@ protected void compareTargetPositionFromTheRecordsWithTargetPostionGeneratedBefo
assertEquals(extractPosition(record.getData()), targetPosition);
}

@Test
// When a record is deleted, produces a deletion record.
//@Test
//When a record is deleted, produces a deletion record.
void testDelete() throws Exception {
final AutoCloseableIterator<AirbyteMessage> read1 = source()
.read(config(), getConfiguredCatalog(), null);
Expand All @@ -377,8 +377,8 @@ protected void assertExpectedStateMessagesFromIncrementalSync(final List<Airbyte
assertExpectedStateMessages(stateMessages);
}

@Test
// When a record is updated, produces an update record.
//@Test
//When a record is updated, produces an update record.
void testUpdate() throws Exception {
final String updatedModel = "Explorer";
final AutoCloseableIterator<AirbyteMessage> read1 = source()
Expand Down Expand Up @@ -471,9 +471,8 @@ protected void assertExpectedStateMessagesForRecordsProducedDuringAndAfterSync(f
assertExpectedStateMessages(stateAfterFirstBatch);
}

@Test
// When both incremental CDC and full refresh are configured for different streams in a sync, the
// data is replicated as expected.
//@Test
//When both incremental CDC and full refresh are configured for different streams in a sync, the data is replicated as expected.
void testCdcAndFullRefreshInSameSync() throws Exception {
final ConfiguredAirbyteCatalog configuredCatalog = Jsons.clone(getConfiguredCatalog());

Expand Down Expand Up @@ -545,8 +544,8 @@ void testCdcAndFullRefreshInSameSync() throws Exception {
modelsSchema());
}

@Test
// When no records exist, no records are returned.
//@Test
//When no records exist, no records are returned.
void testNoData() throws Exception {

deleteCommand(MODELS_STREAM_NAME);
Expand All @@ -563,8 +562,8 @@ protected void assertExpectedStateMessagesForNoData(final List<AirbyteStateMessa
assertExpectedStateMessages(stateMessages);
}

@Test
// When no changes have been made to the database since the previous sync, no records are returned.
//@Test
//When no changes have been made to the database since the previous sync, no records are returned.
void testNoDataOnSecondSync() throws Exception {
final AutoCloseableIterator<AirbyteMessage> read1 = source()
.read(config(), getConfiguredCatalog(), null);
Expand All @@ -583,13 +582,12 @@ void testNoDataOnSecondSync() throws Exception {
assertExpectedStateMessagesFromIncrementalSync(stateMessages2);
}

@Test
void testCheck() throws Exception {
final AirbyteConnectionStatus status = source().check(config());
assertEquals(status.getStatus(), AirbyteConnectionStatus.Status.SUCCEEDED);
}

@Test
//@Test
void testDiscover() throws Exception {
final AirbyteCatalog expectedCatalog = expectedCatalogForDiscover();
final AirbyteCatalog actualCatalog = source().discover(config());
Expand All @@ -601,7 +599,7 @@ void testDiscover() throws Exception {
.collect(Collectors.toList()));
}

@Test
//@Test
public void newTableSnapshotTest() throws Exception {
final AutoCloseableIterator<AirbyteMessage> firstBatchIterator = source()
.read(config(), getConfiguredCatalog(), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void newTableSnapshotTest() {
}

// Utilize the setup to do test on MssqlDebeziumStateUtil.
@Test
//@Test
public void testCdcSnapshot() {
MssqlDebeziumStateUtil util = new MssqlDebeziumStateUtil();

Expand All @@ -219,7 +219,7 @@ public void testCdcSnapshot() {

// Tests even with consistent inserting operations, CDC snapshot and incremental load will not lose
// data.
@Test
//@Test
public void testCdcNotLoseDataWithConsistentWriting() throws Exception {
ExecutorService executor = Executors.newFixedThreadPool(10);

Expand Down Expand Up @@ -280,7 +280,7 @@ protected String columnClause(final Map<String, String> columnsWithDataType, fin
return columnClause.toString();
}

@Test
//@Test
void testAssertCdcEnabledInDb() {
// since we enable cdc in setup, assert that we successfully pass this first
assertDoesNotThrow(() -> source().assertCdcEnabledInDb(config(), testDatabase()));
Expand All @@ -289,7 +289,7 @@ void testAssertCdcEnabledInDb() {
assertThrows(RuntimeException.class, () -> source().assertCdcEnabledInDb(config(), testDatabase()));
}

@Test
//@Test
void testAssertCdcSchemaQueryable() {
// correct access granted by setup so assert check passes
assertDoesNotThrow(() -> source().assertCdcSchemaQueryable(config(), testDatabase()));
Expand All @@ -311,7 +311,7 @@ void testAssertSqlServerAgentRunning() {

// Ensure the CDC check operations are included when CDC is enabled
// todo: make this better by checking the returned checkOperations from source.getCheckOperations
@Test
//@Test
void testCdcCheckOperations() throws Exception {
// assertCdcEnabledInDb
testdb.withoutCdc();
Expand All @@ -334,7 +334,7 @@ void testCdcCheckOperations() throws Exception {
assertEquals(status.getStatus(), AirbyteConnectionStatus.Status.FAILED);
}

@Test
//@Test
void testCdcCheckOperationsWithDot() throws Exception {
final String dbNameWithDot = testdb.getDatabaseName().replace("_", ".");
testdb.with("CREATE DATABASE [%s];", dbNameWithDot)
Expand All @@ -346,7 +346,7 @@ void testCdcCheckOperationsWithDot() throws Exception {

// todo: check LSN returned is actually the max LSN
// todo: check we fail as expected under certain conditions
@Test
//@Test
void testGetTargetPosition() {
// check that getTargetPosition returns higher Lsn after inserting new row
testdb.withWaitUntilMaxLsnAvailable();
Expand Down

0 comments on commit 117dd90

Please sign in to comment.