Skip to content

Commit 5627522

Browse files
authored
Add "all-testable" integration alias (#29520)
The "all" alias outgrew original meaning with adding statsd integration in #29449 which resulted in a problem fixed by #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
1 parent 6cb1d04 commit 5627522

12 files changed

+244
-204
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,8 +1058,8 @@ jobs:
10581058
breeze testing integration-tests --integration trino --integration kerberos
10591059
breeze stop
10601060
if: needs.build-info.outputs.runs-on != 'self-hosted'
1061-
- name: "Integration Tests Postgres: all"
1062-
run: breeze testing integration-tests --integration all
1061+
- name: "Integration Tests Postgres: all-testable"
1062+
run: breeze testing integration-tests --integration all-testable
10631063
if: needs.build-info.outputs.runs-on == 'self-hosted'
10641064
- name: "Post Tests: ${{matrix.python-version}}:${{needs.build-info.outputs.test-types}}"
10651065
uses: ./.github/actions/post_tests
@@ -1096,8 +1096,8 @@ jobs:
10961096
- name: "Prepare breeze & CI image: ${{env.PYTHON_MAJOR_MINOR_VERSION}}:${{env.IMAGE_TAG}}"
10971097
uses: ./.github/actions/prepare_breeze_and_image
10981098
if: needs.build-info.outputs.runs-on == 'self-hosted'
1099-
- name: "Integration Tests MySQL: all"
1100-
run: breeze testing integration-tests --integration all
1099+
- name: "Integration Tests MySQL: all-testable"
1100+
run: breeze testing integration-tests --integration all-testable
11011101
if: needs.build-info.outputs.runs-on == 'self-hosted'
11021102
- name: "Post Tests: ${{matrix.python-version}}:${{needs.build-info.outputs.test-types}}"
11031103
uses: ./.github/actions/post_tests

BREEZE.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,8 @@ By default Breeze starts only airflow container without any integration enabled.
18161816
that is selected). You can start the additional integrations by passing ``--integration`` flag
18171817
with appropriate integration name when starting Breeze. You can specify several ``--integration`` flags
18181818
to start more than one integration at a time.
1819-
Finally you can specify ``--integration all`` to start all integrations.
1819+
Finally you can specify ``--integration all-testable`` to start all testable integrations and
1820+
``--integration all`` to enable all integrations.
18201821

18211822
Once integration is started, it will continue to run until the environment is stopped with
18221823
``breeze stop`` command. or restarted via ``breeze restart`` command

TESTING.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ environment with enabled integrations and in the CI. See `CI <CI.rst>`_ for deta
461461
When you are in the Breeze environment, by default, all integrations are disabled. This enables only true unit tests
462462
to be executed in Breeze. You can enable the integration by passing the ``--integration <INTEGRATION>``
463463
switch when starting Breeze. You can specify multiple integrations by repeating the ``--integration`` switch
464-
or using the ``--integration all`` switch that enables all integrations.
464+
or using the ``--integration all-testable`` switch that enables all testable integrations and
465+
``--integration all`` switch that enables all integrations.
465466

466467
NOTE: Every integration requires a separate container with the corresponding integration image.
467468
These containers take precious resources on your PC, mainly the memory. The started integrations are not stopped
@@ -500,11 +501,17 @@ To start ``mongo`` and ``cassandra`` integrations, enter:
500501
501502
breeze --integration mongo --integration cassandra
502503
504+
To start all testable integrations, enter:
505+
506+
.. code-block:: bash
507+
508+
breeze --integration all-testable
509+
503510
To start all integrations, enter:
504511

505512
.. code-block:: bash
506513
507-
breeze --integration all
514+
breeze --integration all-testable
508515
509516
Note that Kerberos is a special kind of integration. Some tests run differently when
510517
Kerberos integration is enabled (they retrieve and use a Kerberos authentication token) and differently when the
@@ -569,7 +576,7 @@ Runs all integration tests:
569576

570577
.. code-block:: bash
571578
572-
breeze testing integration-tests --db-reset --integration all
579+
breeze testing integration-tests --db-reset --integration all-testable
573580
574581
Runs all mongo DB tests:
575582

dev/breeze/src/airflow_breeze/global_constants.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,31 @@
4242
ALLOWED_BACKENDS = ["sqlite", "mysql", "postgres", "mssql"]
4343
ALLOWED_PROD_BACKENDS = ["mysql", "postgres", "mssql"]
4444
DEFAULT_BACKEND = ALLOWED_BACKENDS[0]
45-
ALL_INTEGRATIONS = [
45+
TESTABLE_INTEGRATIONS = [
4646
"cassandra",
4747
"celery",
4848
"kerberos",
4949
"mongo",
5050
"pinot",
5151
"trino",
5252
]
53-
ALLOWED_INTEGRATIONS = sorted(
53+
OTHER_INTEGRATIONS = ["statsd"]
54+
ALL_INTEGRATIONS = sorted(
5455
[
55-
*ALL_INTEGRATIONS,
56+
*TESTABLE_INTEGRATIONS,
57+
*OTHER_INTEGRATIONS,
58+
]
59+
)
60+
AUTOCOMPLETE_INTEGRATIONS = sorted(
61+
[
62+
"all-testable",
5663
"all",
5764
"otel",
5865
"statsd",
66+
*ALL_INTEGRATIONS,
5967
]
6068
)
69+
6170
ALLOWED_KUBERNETES_VERSIONS = ["v1.23.13", "v1.24.7", "v1.25.3", "v1.26.0"]
6271
ALLOWED_EXECUTORS = ["KubernetesExecutor", "CeleryExecutor", "LocalExecutor", "CeleryKubernetesExecutor"]
6372
ALLOWED_KIND_OPERATIONS = ["start", "stop", "restart", "status", "deploy", "test", "shell", "k9s"]

dev/breeze/src/airflow_breeze/params/shell_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
MOUNT_REMOVE,
3838
MOUNT_SELECTED,
3939
MOUNT_SKIP,
40+
TESTABLE_INTEGRATIONS,
4041
get_airflow_version,
4142
)
4243
from airflow_breeze.utils.console import get_console
@@ -237,7 +238,9 @@ def compose_file(self) -> str:
237238
compose_file_list.append(DOCKER_COMPOSE_DIR / "remove-sources.yml")
238239
if self.include_mypy_volume:
239240
compose_file_list.append(DOCKER_COMPOSE_DIR / "mypy.yml")
240-
if "all" in self.integration:
241+
if "all-testable" in self.integration:
242+
integrations = TESTABLE_INTEGRATIONS
243+
elif "all" in self.integration:
241244
integrations = ALL_INTEGRATIONS
242245
else:
243246
integrations = self.integration

dev/breeze/src/airflow_breeze/utils/common_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
ALLOWED_CONSTRAINTS_MODES_CI,
2828
ALLOWED_CONSTRAINTS_MODES_PROD,
2929
ALLOWED_INSTALLATION_PACKAGE_FORMATS,
30-
ALLOWED_INTEGRATIONS,
3130
ALLOWED_MOUNT_OPTIONS,
3231
ALLOWED_MSSQL_VERSIONS,
3332
ALLOWED_MYSQL_VERSIONS,
@@ -37,6 +36,7 @@
3736
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS,
3837
ALLOWED_USE_AIRFLOW_VERSIONS,
3938
APACHE_AIRFLOW_GITHUB_REPOSITORY,
39+
AUTOCOMPLETE_INTEGRATIONS,
4040
SINGLE_PLATFORMS,
4141
get_available_documentation_packages,
4242
)
@@ -131,7 +131,7 @@ def _set_default_from_parent(ctx: click.core.Context, option: click.core.Option,
131131
option_integration = click.option(
132132
"--integration",
133133
help="Integration(s) to enable when running (can be more than one).",
134-
type=BetterChoice(ALLOWED_INTEGRATIONS),
134+
type=BetterChoice(AUTOCOMPLETE_INTEGRATIONS),
135135
multiple=True,
136136
)
137137
option_postgres_version = click.option(

images/breeze/output-commands-hash.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is automatically generated by pre-commit. If you have a conflict with this file
22
# Please do not solve it but run `breeze setup regenerate-command-images`.
33
# This command should fix the conflict and regenerate help images that you have conflict with.
4-
main:2e1b4e5838838f513750d1352798b006
4+
main:83de6a9bf2b1afecd1f9ce4cd0493733
55
build-docs:18235f12f85f8df82f3eb245e429f62d
66
ci:find-newer-dependencies:8fa2b57f5f0523c928743b235ee3ab5a
77
ci:fix-ownership:fee2c9ec9ef19686792002ae054fecdd
@@ -53,12 +53,12 @@ setup:regenerate-command-images:15215e52342dd2f2e27a85726f40a820
5353
setup:self-upgrade:d02f70c7a230eae3463ceec2056b63fa
5454
setup:version:123b462a421884dc2320ffc5e54b2478
5555
setup:56a2ef337c354362760d247df5d05365
56-
shell:e34d2512360503b70e6a05e5b8b59986
57-
start-airflow:e096fa493a810935c012ef3d95775aa2
56+
shell:ab07ac2d57253e25367a7200ce686703
57+
start-airflow:5e8460ac38f8e9ea2a0ac7e248fd7bc9
5858
static-checks:12e8fed2acbed0d823efc5121fd0eb58
5959
stop:e5aa686b4e53707ced4039d8414d5cd6
6060
testing:docker-compose-tests:b86c044b24138af0659a05ed6331576c
6161
testing:helm-tests:94a442e7f3f63b34c4831a84d165690a
62-
testing:integration-tests:fa4f9be38ee380f6f8feeb9dd8ba7669
63-
testing:tests:8dd0496fddb37b207fc2b74add201d43
64-
testing:1e4ea0f58b4814342911355d35efd966
62+
testing:integration-tests:225ddb6243cce5fc64f4824b87adfd98
63+
testing:tests:ce6d80b3073bafd1f10c50812432885a
64+
testing:0f292a29b2a97fbd95778a72249ee997

0 commit comments

Comments
 (0)