Skip to content

Commit

Permalink
Add "all-testable" integration alias (apache#29520)
Browse files Browse the repository at this point in the history
The "all" alias outgrew original meaning with adding statsd integration
in apache#29449 which resulted in a problem fixed by apache#29517. The "all" tests
as result was not "all" but "all that could be tested".

This PR adds "all-testable" alias which as opposed to "all" does not
contain "statsd" - it also renames some of the vars/arrays to reflect
it.7
  • Loading branch information
potiuk authored Feb 17, 2023
1 parent 6cb1d04 commit 5627522
Show file tree
Hide file tree
Showing 12 changed files with 244 additions and 204 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,8 @@ jobs:
breeze testing integration-tests --integration trino --integration kerberos
breeze stop
if: needs.build-info.outputs.runs-on != 'self-hosted'
- name: "Integration Tests Postgres: all"
run: breeze testing integration-tests --integration all
- name: "Integration Tests Postgres: all-testable"
run: breeze testing integration-tests --integration all-testable
if: needs.build-info.outputs.runs-on == 'self-hosted'
- name: "Post Tests: ${{matrix.python-version}}:${{needs.build-info.outputs.test-types}}"
uses: ./.github/actions/post_tests
Expand Down Expand Up @@ -1096,8 +1096,8 @@ jobs:
- name: "Prepare breeze & CI image: ${{env.PYTHON_MAJOR_MINOR_VERSION}}:${{env.IMAGE_TAG}}"
uses: ./.github/actions/prepare_breeze_and_image
if: needs.build-info.outputs.runs-on == 'self-hosted'
- name: "Integration Tests MySQL: all"
run: breeze testing integration-tests --integration all
- name: "Integration Tests MySQL: all-testable"
run: breeze testing integration-tests --integration all-testable
if: needs.build-info.outputs.runs-on == 'self-hosted'
- name: "Post Tests: ${{matrix.python-version}}:${{needs.build-info.outputs.test-types}}"
uses: ./.github/actions/post_tests
Expand Down
3 changes: 2 additions & 1 deletion BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,8 @@ By default Breeze starts only airflow container without any integration enabled.
that is selected). You can start the additional integrations by passing ``--integration`` flag
with appropriate integration name when starting Breeze. You can specify several ``--integration`` flags
to start more than one integration at a time.
Finally you can specify ``--integration all`` to start all integrations.
Finally you can specify ``--integration all-testable`` to start all testable integrations and
``--integration all`` to enable all integrations.

Once integration is started, it will continue to run until the environment is stopped with
``breeze stop`` command. or restarted via ``breeze restart`` command
Expand Down
13 changes: 10 additions & 3 deletions TESTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ environment with enabled integrations and in the CI. See `CI <CI.rst>`_ for deta
When you are in the Breeze environment, by default, all integrations are disabled. This enables only true unit tests
to be executed in Breeze. You can enable the integration by passing the ``--integration <INTEGRATION>``
switch when starting Breeze. You can specify multiple integrations by repeating the ``--integration`` switch
or using the ``--integration all`` switch that enables all integrations.
or using the ``--integration all-testable`` switch that enables all testable integrations and
``--integration all`` switch that enables all integrations.

NOTE: Every integration requires a separate container with the corresponding integration image.
These containers take precious resources on your PC, mainly the memory. The started integrations are not stopped
Expand Down Expand Up @@ -500,11 +501,17 @@ To start ``mongo`` and ``cassandra`` integrations, enter:
breeze --integration mongo --integration cassandra
To start all testable integrations, enter:

.. code-block:: bash
breeze --integration all-testable
To start all integrations, enter:

.. code-block:: bash
breeze --integration all
breeze --integration all-testable
Note that Kerberos is a special kind of integration. Some tests run differently when
Kerberos integration is enabled (they retrieve and use a Kerberos authentication token) and differently when the
Expand Down Expand Up @@ -569,7 +576,7 @@ Runs all integration tests:

.. code-block:: bash
breeze testing integration-tests --db-reset --integration all
breeze testing integration-tests --db-reset --integration all-testable
Runs all mongo DB tests:

Expand Down
15 changes: 12 additions & 3 deletions dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,31 @@
ALLOWED_BACKENDS = ["sqlite", "mysql", "postgres", "mssql"]
ALLOWED_PROD_BACKENDS = ["mysql", "postgres", "mssql"]
DEFAULT_BACKEND = ALLOWED_BACKENDS[0]
ALL_INTEGRATIONS = [
TESTABLE_INTEGRATIONS = [
"cassandra",
"celery",
"kerberos",
"mongo",
"pinot",
"trino",
]
ALLOWED_INTEGRATIONS = sorted(
OTHER_INTEGRATIONS = ["statsd"]
ALL_INTEGRATIONS = sorted(
[
*ALL_INTEGRATIONS,
*TESTABLE_INTEGRATIONS,
*OTHER_INTEGRATIONS,
]
)
AUTOCOMPLETE_INTEGRATIONS = sorted(
[
"all-testable",
"all",
"otel",
"statsd",
*ALL_INTEGRATIONS,
]
)

ALLOWED_KUBERNETES_VERSIONS = ["v1.23.13", "v1.24.7", "v1.25.3", "v1.26.0"]
ALLOWED_EXECUTORS = ["KubernetesExecutor", "CeleryExecutor", "LocalExecutor", "CeleryKubernetesExecutor"]
ALLOWED_KIND_OPERATIONS = ["start", "stop", "restart", "status", "deploy", "test", "shell", "k9s"]
Expand Down
5 changes: 4 additions & 1 deletion dev/breeze/src/airflow_breeze/params/shell_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
MOUNT_REMOVE,
MOUNT_SELECTED,
MOUNT_SKIP,
TESTABLE_INTEGRATIONS,
get_airflow_version,
)
from airflow_breeze.utils.console import get_console
Expand Down Expand Up @@ -237,7 +238,9 @@ def compose_file(self) -> str:
compose_file_list.append(DOCKER_COMPOSE_DIR / "remove-sources.yml")
if self.include_mypy_volume:
compose_file_list.append(DOCKER_COMPOSE_DIR / "mypy.yml")
if "all" in self.integration:
if "all-testable" in self.integration:
integrations = TESTABLE_INTEGRATIONS
elif "all" in self.integration:
integrations = ALL_INTEGRATIONS
else:
integrations = self.integration
Expand Down
4 changes: 2 additions & 2 deletions dev/breeze/src/airflow_breeze/utils/common_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
ALLOWED_CONSTRAINTS_MODES_CI,
ALLOWED_CONSTRAINTS_MODES_PROD,
ALLOWED_INSTALLATION_PACKAGE_FORMATS,
ALLOWED_INTEGRATIONS,
ALLOWED_MOUNT_OPTIONS,
ALLOWED_MSSQL_VERSIONS,
ALLOWED_MYSQL_VERSIONS,
Expand All @@ -37,6 +36,7 @@
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS,
ALLOWED_USE_AIRFLOW_VERSIONS,
APACHE_AIRFLOW_GITHUB_REPOSITORY,
AUTOCOMPLETE_INTEGRATIONS,
SINGLE_PLATFORMS,
get_available_documentation_packages,
)
Expand Down Expand Up @@ -131,7 +131,7 @@ def _set_default_from_parent(ctx: click.core.Context, option: click.core.Option,
option_integration = click.option(
"--integration",
help="Integration(s) to enable when running (can be more than one).",
type=BetterChoice(ALLOWED_INTEGRATIONS),
type=BetterChoice(AUTOCOMPLETE_INTEGRATIONS),
multiple=True,
)
option_postgres_version = click.option(
Expand Down
12 changes: 6 additions & 6 deletions images/breeze/output-commands-hash.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is automatically generated by pre-commit. If you have a conflict with this file
# Please do not solve it but run `breeze setup regenerate-command-images`.
# This command should fix the conflict and regenerate help images that you have conflict with.
main:2e1b4e5838838f513750d1352798b006
main:83de6a9bf2b1afecd1f9ce4cd0493733
build-docs:18235f12f85f8df82f3eb245e429f62d
ci:find-newer-dependencies:8fa2b57f5f0523c928743b235ee3ab5a
ci:fix-ownership:fee2c9ec9ef19686792002ae054fecdd
Expand Down Expand Up @@ -53,12 +53,12 @@ setup:regenerate-command-images:15215e52342dd2f2e27a85726f40a820
setup:self-upgrade:d02f70c7a230eae3463ceec2056b63fa
setup:version:123b462a421884dc2320ffc5e54b2478
setup:56a2ef337c354362760d247df5d05365
shell:e34d2512360503b70e6a05e5b8b59986
start-airflow:e096fa493a810935c012ef3d95775aa2
shell:ab07ac2d57253e25367a7200ce686703
start-airflow:5e8460ac38f8e9ea2a0ac7e248fd7bc9
static-checks:12e8fed2acbed0d823efc5121fd0eb58
stop:e5aa686b4e53707ced4039d8414d5cd6
testing:docker-compose-tests:b86c044b24138af0659a05ed6331576c
testing:helm-tests:94a442e7f3f63b34c4831a84d165690a
testing:integration-tests:fa4f9be38ee380f6f8feeb9dd8ba7669
testing:tests:8dd0496fddb37b207fc2b74add201d43
testing:1e4ea0f58b4814342911355d35efd966
testing:integration-tests:225ddb6243cce5fc64f4824b87adfd98
testing:tests:ce6d80b3073bafd1f10c50812432885a
testing:0f292a29b2a97fbd95778a72249ee997
Loading

0 comments on commit 5627522

Please sign in to comment.