Skip to content

Commit

Permalink
destination-e2e: upgrade CDK
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-airbyte committed Sep 18, 2024
1 parent d4ac3e2 commit 11a40c5
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ abstract class DestinationAcceptanceTest(
*/
@Throws(Exception::class)
protected abstract fun retrieveRecords(
testEnv: TestDestinationEnv?,
testEnv: TestDestinationEnv,
streamName: String,
namespace: String,
streamSchema: JsonNode
Expand Down Expand Up @@ -236,7 +236,7 @@ abstract class DestinationAcceptanceTest(
}

private fun retrieveRecordsDataOnly(
testEnv: TestDestinationEnv?,
testEnv: TestDestinationEnv,
streamName: String,
namespace: String,
streamSchema: JsonNode
Expand Down Expand Up @@ -1040,7 +1040,7 @@ abstract class DestinationAcceptanceTest(
getProtocolVersion()
)
)
.lines()
.lines().filter { it.isNotEmpty() }
.map { Jsons.deserialize(it, AirbyteMessage::class.java) }
val config = getConfig()
runSyncAndVerifyStateOutput(
Expand Down Expand Up @@ -1486,7 +1486,7 @@ abstract class DestinationAcceptanceTest(
*/
@Test
@Throws(Exception::class)
fun testSyncNotFailsWithNewFields() {
open fun testSyncNotFailsWithNewFields() {
if (!implementsOverwrite()) {
LOGGER.info { "Destination's spec.json does not support overwrite sync mode." }
return
Expand Down Expand Up @@ -1724,7 +1724,7 @@ abstract class DestinationAcceptanceTest(
}

@Test
fun testAirbyteTimeTypes() {
open fun testAirbyteTimeTypes() {
val configuredCatalog =
Jsons.deserialize(
MoreResources.readResource("v0/every_time_type_configured_catalog.json"),
Expand Down Expand Up @@ -2171,7 +2171,7 @@ abstract class DestinationAcceptanceTest(
}

// ignores emitted at.
protected fun assertSameMessages(
open protected fun assertSameMessages(
expected: List<AirbyteMessage>,
actual: List<AirbyteRecordMessage>,
pruneAirbyteInternalFields: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ plugins {
}

airbyteJavaConnector {
cdkVersionRequired = '0.20.6'
cdkVersionRequired = '0.45.0'
features = ['db-destinations']
useLocalCdk = false
useLocalCdk = true
}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: file
connectorType: destination
definitionId: a7bcc9d8-13b3-4e49-b80d-d020b90045e3
dockerImageTag: 0.4.1
dockerImageTag: 0.5.0
dockerRepository: airbyte/destination-dev-null
githubIssueLabel: destination-dev-null
icon: airbyte.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

class DevNullDestinationAcceptanceTest : DestinationAcceptanceTest() {
override fun getImageName(): String {
return "airbyte/destination-dev-null:dev"
}
override val imageName = "airbyte/destination-dev-null:dev"

override fun getConfig(): JsonNode {
return Jsons.jsonNode(
Expand All @@ -36,12 +34,7 @@ class DevNullDestinationAcceptanceTest : DestinationAcceptanceTest() {
)
}

override fun retrieveRecords(
testEnv: TestDestinationEnv,
streamName: String,
namespace: String?,
streamSchema: JsonNode
): List<JsonNode> {
override fun retrieveRecords(testEnv: TestDestinationEnv, streamName: String, namespace: String, streamSchema: JsonNode): List<JsonNode> {
return emptyList()
}

Expand All @@ -64,12 +57,12 @@ class DevNullDestinationAcceptanceTest : DestinationAcceptanceTest() {
// Skip because `retrieveRecords` returns an empty list at all times.
@Disabled @Test override fun testSyncNotFailsWithNewFields() {}

// This test assumes that dedup support means normalization support.
// Override it to do nothing.
@Disabled
@Test
@Throws(Exception::class)
override fun testIncrementalDedupeSync() {
super.testIncrementalDedupeSync()
override fun testAirbyteTimeTypes() {
}

open override fun getDefaultSchema(config: JsonNode): String? {
return super.getDefaultSchema(config) ?: "default_schema"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ plugins {
}

airbyteJavaConnector {
cdkVersionRequired = '0.20.6'
cdkVersionRequired = '0.45.0'
features = ['db-destinations']
useLocalCdk = false
useLocalCdk = true
}

application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: unknown
connectorType: destination
definitionId: 2eb65e87-983a-4fd7-b3e3-9d9dc6eb8537
dockerImageTag: 0.4.1
dockerImageTag: 0.5.0
dockerRepository: airbyte/destination-e2e-test
githubIssueLabel: destination-e2e-test
icon: airbyte.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ constructor(
config: JsonNode,
catalog: ConfiguredAirbyteCatalog,
outputRecordCollector: Consumer<AirbyteMessage>
): AirbyteMessageConsumer {
): AirbyteMessageConsumer? {
return selectDestination(config)!!.getConsumer(config, catalog, outputRecordCollector)
}

@Throws(Exception::class)
override fun check(config: JsonNode): AirbyteConnectionStatus {
override fun check(config: JsonNode): AirbyteConnectionStatus? {
return try {
selectDestination(config)!!.check(config)
} catch (e: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ThrottledDestination : BaseConnector(), Destination {

override fun getConsumer(
config: JsonNode,
catalog: ConfiguredAirbyteCatalog?,
catalog: ConfiguredAirbyteCatalog,
outputRecordCollector: Consumer<AirbyteMessage>
): AirbyteMessageConsumer {
return ThrottledConsumer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test

class TestingSilentDestinationAcceptanceTest : DestinationAcceptanceTest() {
override fun getImageName(): String {
return "airbyte/destination-e2e-test:dev"
}
override val imageName = "airbyte/destination-e2e-test:dev"

override fun getConfig(): JsonNode {
return Jsons.jsonNode(
Expand All @@ -38,9 +36,9 @@ class TestingSilentDestinationAcceptanceTest : DestinationAcceptanceTest() {

override fun retrieveRecords(
testEnv: TestDestinationEnv?,
streamName: String?,
namespace: String?,
streamSchema: JsonNode?
streamName: String,
namespace: String,
streamSchema: JsonNode
): List<JsonNode> {
return emptyList()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import java.util.*
import java.util.function.Consumer
import org.junit.jupiter.api.Test
import org.mockito.Mockito
import org.mockito.Mockito.mock

/**
* This source is designed to be a switch statement for our suite of highly-specific test sources.
Expand All @@ -30,7 +31,7 @@ class ThrottledDestinationTest {
)
)

val consumer = ThrottledDestination().getConsumer(config, null, outputRecordCollector)
val consumer = ThrottledDestination().getConsumer(config, mock(), outputRecordCollector)

consumer.accept(anotherRecord)
consumer.accept(anotherRecord)
Expand Down
3 changes: 2 additions & 1 deletion docs/integrations/destinations/e2e-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ The OSS and Cloud variants have the same version number starting from version `0

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :-------------------------------------------------------- |
| 0.4.1 | 2024-09-18 | [45649](https://github.com/airbytehq/airbyte/pull/45649) | convert test code to kotlin |
| 0.5.0 | 2024-09-18 | [45650](https://github.com/airbytehq/airbyte/pull/45650) | upgrade cdk |
| 0.4.1 | 2024-09-18 | [45649](https://github.com/airbytehq/airbyte/pull/45649) | convert test code to kotlin |
| 0.4.0 | 2024-09-18 | [45648](https://github.com/airbytehq/airbyte/pull/45648) | convert production code to kotlin |
| 0.3.6 | 2024-05-09 | [38097](https://github.com/airbytehq/airbyte/pull/38097) | Support dedup |
| 0.3.5 | 2024-04-29 | [37366](https://github.com/airbytehq/airbyte/pull/37366) | Support refreshes |
Expand Down

0 comments on commit 11a40c5

Please sign in to comment.