Skip to content

Commit

Permalink
Merge pull request #432 from atlanhq/DVX-119
Browse files Browse the repository at this point in the history
Fix class used for enrichment migrator
  • Loading branch information
cmgrote authored Jan 16, 2024
2 parents 92a239e + 4e23262 commit c3464ec
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ object PackageConfig : CustomPackage(
),
),
containerImage = "ghcr.io/atlanhq/csa-enrichment-migrator:${Atlan.VERSION}",
classToRun = Exporter::class.java,
classToRun = EnrichmentMigrator::class.java,
outputs = WorkflowOutputs(
mapOf(
"debug-logs" to "/tmp/debug.log",
"assets-csv" to "/tmp/asset-export.csv",
"transformed-csv" to "/tmp/transformed.csv",
),
),
keywords = listOf("kotlin", "utility"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* SPDX-License-Identifier: Apache-2.0
Copyright 2023 Atlan Pte. Ltd. */
import com.atlan.model.assets.Connection
import com.atlan.model.enums.AtlanConnectorType
import com.atlan.pkg.PackageTest
import org.testng.ITestContext
import org.testng.annotations.AfterClass
import org.testng.annotations.BeforeClass
import kotlin.test.Test

/**
* Test migration of asset metadata.
*/
class EnrichmentMigratorTest : PackageTest() {

private val files = listOf(
"asset-export.csv",
"debug.log",
)

@BeforeClass
fun beforeClass() {
setup(
EnrichmentMigratorCfg(
sourceConnection = Connection.findByName("development", AtlanConnectorType.MSSQL)?.get(0)?.qualifiedName,
targetConnection = Connection.findByName("development", AtlanConnectorType.SNOWFLAKE)?.get(0)?.qualifiedName,
failOnErrors = false,
),
)
EnrichmentMigrator.main(arrayOf(testDirectory))
}

@Test
fun filesCreated() {
validateFilesExist(files)
}

@Test
fun errorFreeLog() {
validateErrorFreeLog()
}

@AfterClass(alwaysRun = true)
fun afterClass(context: ITestContext) {
teardown(context.failedTests.size() > 0)
}
}

0 comments on commit c3464ec

Please sign in to comment.