Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airbyte-ci: GradleTask fixes #30252

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion airbyte-ci/connectors/pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ This command runs the Python tests for a airbyte-ci poetry package.

## Changelog
| Version | PR | Description |
| ------- | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|---------| --------------------------------------------------------- |-----------------------------------------------------------------------------------------------------------|
| 1.1.1 | [#30252](https://github.com/airbytehq/airbyte/pull/30252) | Fix redundancies and broken logic in GradleTask, to speed up the CI runs. |
| 1.1.0 | [#29509](https://github.com/airbytehq/airbyte/pull/29509) | Refactor the airbyte-ci test command to run tests on any poetry package. |
| 1.0.0 | [#28000](https://github.com/airbytehq/airbyte/pull/29232) | Remove release stages in favor of support level from airbyte-ci. |
| 0.5.0 | [#28000](https://github.com/airbytehq/airbyte/pull/28000) | Run connector acceptance tests with dagger-in-dagger. |
Expand Down
18 changes: 1 addition & 17 deletions airbyte-ci/connectors/pipelines/pipelines/gradle.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GradleTask(Step, ABC):
title (str): The step title.
"""

DEFAULT_TASKS_TO_EXCLUDE = ["airbyteDocker"]
DEFAULT_TASKS_TO_EXCLUDE = ["assemble", "airbyteDocker", "connectorAcceptanceTest"]
BIND_TO_DOCKER_HOST = True
gradle_task_name: ClassVar
gradle_task_options: Tuple[str, ...] = ()
Expand All @@ -50,21 +50,6 @@ def build_include(self) -> List[str]:
for dependency_directory in self.context.connector.get_local_dependency_paths(with_test_dependencies=True)
]

async def _get_patched_build_src_dir(self) -> Directory:
"""Patch some gradle plugins.

Returns:
Directory: The patched buildSrc directory
"""

build_src_dir = self.context.get_repo_dir("buildSrc")
cat_gradle_plugin_content = await build_src_dir.file("src/main/groovy/airbyte-connector-acceptance-test.gradle").contents()
# When running integrationTest in Dagger we don't want to run connectorAcceptanceTest
# connectorAcceptanceTest is run in the AcceptanceTest step
cat_gradle_plugin_content = cat_gradle_plugin_content.replace(
"project.integrationTest.dependsOn(project.connectorAcceptanceTest)", ""
)
return build_src_dir.with_new_file("src/main/groovy/airbyte-connector-acceptance-test.gradle", contents=cat_gradle_plugin_content)

def _get_gradle_command(self, extra_options: Tuple[str, ...] = ("--no-daemon", "--scan", "--build-cache")) -> List:
command = (
Expand All @@ -85,7 +70,6 @@ async def _run(self) -> StepResult:
connector_under_test = (
environments.with_gradle(self.context, includes, bind_to_docker_host=self.BIND_TO_DOCKER_HOST)
.with_mounted_directory(str(self.context.connector.code_directory), await self.context.get_connector_dir())
.with_mounted_directory("buildSrc", await self._get_patched_build_src_dir())
# Disable the Ryuk container because it needs privileged docker access that does not work:
.with_env_variable("TESTCONTAINERS_RYUK_DISABLED", "true")
.with_(environments.mounted_connector_secrets(self.context, f"{self.context.connector.code_directory}/secrets"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class IntegrationTests(GradleTask):
"""A step to run integrations tests for Java connectors using the integrationTestJava Gradle task."""

gradle_task_name = "integrationTest"
DEFAULT_TASKS_TO_EXCLUDE = ["airbyteDocker"]
title = "Java Connector Integration Tests"

async def _load_normalization_image(self, normalization_tar_file: File):
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/pipelines/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pipelines"
version = "1.1.0"
version = "1.1.1"
description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines"
authors = ["Airbyte <contact@airbyte.io>"]

Expand Down
Loading