Skip to content

Commit

Permalink
add gradle command
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-kulak committed Apr 19, 2021
1 parent 0247670 commit eae41d8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/bases/standard-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

airbytePython {
moduleDirectory 'base_python_test'
moduleDirectory 'standard_test'
}


Expand Down
20 changes: 1 addition & 19 deletions airbyte-integrations/connectors/source-hubspot/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
plugins {
id 'airbyte-python'
id 'airbyte-docker'
id 'airbyte-standard-source-test-file'
id 'airbyte-standard-test'
}

airbytePython {
moduleDirectory 'source_hubspot'
}

airbyteStandardSourceTestFile {
// For more information on standard source tests, see https://docs.airbyte.io/contributing-to-airbyte/building-new-connector/testing-connectors

// All these input paths must live inside this connector's directory (or subdirectories)
// TODO update the spec JSON file
specPath = "source_hubspot/spec.json"

// configPath points to a config file which matches the spec.json supplied above. secrets/ is gitignored by default, so place your config file
// there (in case it contains any credentials)
// TODO update the config file to contain actual credentials
configPath = "secrets/config.json"
// TODO update the sample configured_catalog JSON for use in testing
// Note: If your source supports incremental syncing, then make sure that the catalog that is returned in the get_catalog method is configured
// for incremental syncing (e.g. include cursor fields, etc).
configuredCatalogPath = "sample_files/configured_catalog.json"
}

dependencies {
implementation files(project(':airbyte-integrations:bases:base-standard-source-test-file').airbyteDocker.outputs)
implementation files(project(':airbyte-integrations:bases:base-python').airbyteDocker.outputs)
}

Expand Down
44 changes: 44 additions & 0 deletions buildSrc/src/main/groovy/airbyte-standard-test.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import org.gradle.api.Plugin
import org.gradle.api.Project

class AirbyteStandardTestPlugin implements Plugin<Project> {
void apply(Project project) {
project.task('standardTest') {
doFirst {
project.exec {
def targetMountDirectory = "/test_input"
def args = [
'docker', 'run', '--rm', '-i',
// provide access to the docker daemon
'-v', "/var/run/docker.sock:/var/run/docker.sock",
// A container within a container mounts from the host filesystem, not the parent container.
// this forces /tmp to be the same directory for host, parent container, and child container.
'-v', "/tmp:/tmp",
// mount the project dir. all provided input paths must be relative to that dir.
'-v', "${project.projectDir.absolutePath}:${targetMountDirectory}",
'airbyte/standard-test:dev',
'--standard_test_config', "$targetMountDirectory",
]
commandLine args
}
}

outputs.upToDateWhen { false }
}

project.standardTest.dependsOn(':airbyte-integrations:bases:standard-test:airbyteDocker')
project.standardTest.dependsOn(project.build)
project.standardTest.dependsOn(project.airbyteDocker)
if (project.hasProperty('airbyteDockerTest')){
project.standardTest.dependsOn(project.airbyteDockerTest)
}

// make sure we create the integrationTest task once in case a java integration test was already initialized
if (!project.hasProperty('integrationTest')) {
project.task('integrationTest')
}

project.integrationTest.dependsOn(project.standardTest)
}
}

1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include ':airbyte-integrations:bases:base-singer'
include ':airbyte-integrations:bases:base-standard-source-test-file'
include ':airbyte-integrations:bases:standard-destination-test'
include ':airbyte-integrations:bases:standard-source-test'
include ':airbyte-integrations:bases:standard-test'
include ':airbyte-integrations:connector-templates:generator'
include ':airbyte-json-validation'
include ':airbyte-migration'
Expand Down

0 comments on commit eae41d8

Please sign in to comment.