Skip to content

Commit

Permalink
Revert "Remove local cdk"
Browse files Browse the repository at this point in the history
This reverts commit 977125a.
  • Loading branch information
bnchrch committed Sep 15, 2023
1 parent 05b206a commit 70f897c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/legacy-test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ on:
description: "Set a specific connector acceptance test version to use. Enter 'dev' to test, build and use a local version of Connector Acceptance Test."
required: false
default: "latest"
local_cdk:
description: "Run Connector Acceptance Tests against the CDK version on the current branch."
required: false
jobs:
uuid:
name: "Custom UUID of workflow run"
Expand Down Expand Up @@ -127,7 +130,7 @@ jobs:
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
uses: Wandalen/wretry.action@v1.0.42
with:
command: ./tools/bin/ci_integration_test.sh ${{ github.event.inputs.connector }}
command: ./tools/bin/ci_integration_test.sh ${{ github.event.inputs.connector }} ${{ github.event.inputs.local_cdk }}
attempt_limit: 3
attempt_delay: 10000 # in ms
- name: Update Integration Test Credentials after test run for ${{ github.event.inputs.connector }}
Expand Down
20 changes: 20 additions & 0 deletions buildSrc/src/main/groovy/airbyte-docker.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ abstract class AirbyteDockerTask extends AirbyteDockerBaseTask {
}
}

abstract class AirbyteDockerWithLocalCDKLegacyTask extends AirbyteDockerBaseTask {

@InputFile
File buildScript = project.rootProject.file('airbyte-integrations/scripts/build-connector-image-with-local-cdk.sh')

@TaskAction
def dockerTask() {
project.exec {
environment "CONNECTOR_TAG", DockerHelpers.getDevTaggedImage(project.projectDir, dockerFile.name)
environment "CONNECTOR_NAME", project.findProperty('connectorAcceptanceTest.connectorName')
commandLine buildScript.absolutePath
}
}
}

/**
* AirbyteDockerTaskFactory is a convenience object to avoid passing the current project around.
*/
Expand Down Expand Up @@ -199,6 +214,11 @@ class AirbyteDockerTaskFactory {
}
}
Class<? extends AirbyteDockerBaseTask> taskClass = AirbyteDockerTask
if (project.hasProperty('connectorAcceptanceTest.useLocalCdk') && project.parent.project.name == "connectors") {
// This is only used by the legacy test slash command, for connectors for which
// airbyte-ci isn't supported yet.
taskClass = AirbyteDockerWithLocalCDKLegacyTask
}

// Tagged name of the image to be built by this task.
def taggedImage = DockerHelpers.getDevTaggedImage(project.projectDir, dockerFileName)
Expand Down
3 changes: 2 additions & 1 deletion tools/bin/ci_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -e
# runs integration tests for an integration name

connector="$1"
local_cdk="$2"
all_integration_tests=$(./gradlew integrationTest --dry-run | grep 'integrationTest SKIPPED' | cut -d: -f 4)
run() {
if [[ "$connector" == "all" ]] ; then
Expand Down Expand Up @@ -35,7 +36,7 @@ else
fi
if [ -n "$selected_integration_test" ] ; then
echo "Running: ./gradlew --no-daemon --scan $integrationTestCommand"
./gradlew --no-daemon --scan "$integrationTestCommand"
./gradlew --no-daemon --scan "$integrationTestCommand" -PconnectorAcceptanceTest.useLocalCdk=$local_cdk -PconnectorAcceptanceTest.connectorName=$connector_name
else
echo "Connector '$connector' not found..."
return 1
Expand Down

0 comments on commit 70f897c

Please sign in to comment.