forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'datahub-project:master' into BigQuery-Owner-Label-to-Da…
…tahub-Ownership
- Loading branch information
Showing
128 changed files
with
2,539 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...hub-upgrade/src/test/java/com/linkedin/datahub/upgrade/DatahubUpgradeNonBlockingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.linkedin.datahub.upgrade; | ||
|
||
import static org.mockito.ArgumentMatchers.any; | ||
import static org.mockito.ArgumentMatchers.eq; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.times; | ||
import static org.mockito.Mockito.verify; | ||
import static org.testng.AssertJUnit.assertNotNull; | ||
|
||
import com.linkedin.datahub.upgrade.impl.DefaultUpgradeManager; | ||
import com.linkedin.datahub.upgrade.system.SystemUpdateNonBlocking; | ||
import com.linkedin.datahub.upgrade.system.vianodes.ReindexDataJobViaNodesCLL; | ||
import com.linkedin.metadata.entity.EntityService; | ||
import com.linkedin.metadata.entity.restoreindices.RestoreIndicesArgs; | ||
import java.util.List; | ||
import javax.inject.Named; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; | ||
import org.testng.annotations.Test; | ||
|
||
@ActiveProfiles("test") | ||
@SpringBootTest( | ||
classes = {UpgradeCliApplication.class, UpgradeCliApplicationTestConfiguration.class}, | ||
properties = { | ||
"BOOTSTRAP_SYSTEM_UPDATE_DATA_JOB_NODE_CLL_ENABLED=true", | ||
"kafka.schemaRegistry.type=INTERNAL", | ||
"DATAHUB_UPGRADE_HISTORY_TOPIC_NAME=test_due_topic", | ||
"METADATA_CHANGE_LOG_VERSIONED_TOPIC_NAME=test_mcl_versioned_topic" | ||
}, | ||
args = {"-u", "SystemUpdateNonBlocking"}) | ||
public class DatahubUpgradeNonBlockingTest extends AbstractTestNGSpringContextTests { | ||
|
||
@Autowired(required = false) | ||
@Named("systemUpdateNonBlocking") | ||
private SystemUpdateNonBlocking systemUpdateNonBlocking; | ||
|
||
@Autowired | ||
@Test | ||
public void testSystemUpdateNonBlockingInit() { | ||
assertNotNull(systemUpdateNonBlocking); | ||
} | ||
|
||
@Test | ||
public void testReindexDataJobViaNodesCLLPaging() { | ||
EntityService<?> mockService = mock(EntityService.class); | ||
ReindexDataJobViaNodesCLL cllUpgrade = new ReindexDataJobViaNodesCLL(mockService, true, 10); | ||
SystemUpdateNonBlocking upgrade = | ||
new SystemUpdateNonBlocking(List.of(), List.of(cllUpgrade), null); | ||
DefaultUpgradeManager manager = new DefaultUpgradeManager(); | ||
manager.register(upgrade); | ||
manager.execute("SystemUpdateNonBlocking", List.of()); | ||
verify(mockService, times(1)) | ||
.streamRestoreIndices( | ||
eq( | ||
new RestoreIndicesArgs() | ||
.batchSize(10) | ||
.limit(0) | ||
.aspectName("dataJobInputOutput") | ||
.urnLike("urn:li:dataJob:%")), | ||
any()); | ||
} | ||
} |
Oops, something went wrong.