potiuk commented on code in PR #23445:
URL: https://github.com/apache/airflow/pull/23445#discussion_r865446443
##########
TESTING.rst:
##########
@@ -168,19 +168,19 @@ to breeze.
.. code-block:: bash
- ./breeze-legacy tests tests/providers/http/hooks/test_http.py
tests/core/test_core.py --db-reset -- --log-cli-level=DEBUG
+ breeze tests tests/providers/http/hooks/test_http.py
tests/core/test_core.py --db-reset -- --log-cli-level=DEBUG
Review Comment:
We should not use "--". We've already added commands (static-checks or
docker-compose-tests for example) where unknown flasgs are passed unmodified to
underlying command. And I see you did the same (UNPROCESSED)- this means that
'--' is not needed.
This is done by adding context_settings
```
name='docker-compose-tests',
context_settings=dict(
ignore_unknown_options=True,
allow_extra_args=True,
),
```
##########
dev/breeze/src/airflow_breeze/commands/testing.py:
##########
@@ -15,23 +15,32 @@
# specific language governing permissions and limitations
# under the License.
+import os
import sys
from typing import Tuple
import click
from airflow_breeze.build_image.prod.build_prod_params import BuildProdParams
from airflow_breeze.commands.common_options import (
+ option_db_reset,
option_dry_run,
option_github_repository,
option_image_name,
option_image_tag,
+ option_integration,
option_python,
option_verbose,
)
+from airflow_breeze.commands.custom_param_types import BetterChoice
from airflow_breeze.commands.main import main
+from airflow_breeze.global_constants import ALLOWED_TEST_TYPES
+from airflow_breeze.shell.enter_shell import check_docker_is_running,
check_docker_resources
+from airflow_breeze.shell.shell_params import ShellParams
from airflow_breeze.utils.console import get_console
+from airflow_breeze.utils.docker_command_utils import
construct_env_variables_docker_compose_command
from airflow_breeze.utils.run_tests import run_docker_compose_tests
+from airflow_breeze.utils.run_utils import run_command
TESTING_COMMANDS = {
"name": "Testing",
Review Comment:
You need to add "breeze test" command here so that it is displayed in
correct section in `breeze --help`, also "test-specific" options should have
it's own section (TESTING_PARAMETERS below). This makes the command --help
output better organized.
##########
dev/breeze/src/airflow_breeze/commands/testing.py:
##########
@@ -91,3 +100,60 @@ def docker_compose_tests(
extra_pytest_args=extra_pytest_args,
)
sys.exit(return_code)
+
+
[email protected](
+ name='tests',
+ help="""
+ Run the specified unit test target. There might be multiple
+ targets specified separated with comas. The <EXTRA_ARGS> passed after --
are treated
Review Comment:
Same here - no need for '--'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]