Skip to content
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ repos:
^airflow/www/static/|
^airflow/providers/|
^tests/providers/apache/cassandra/hooks/test_cassandra.py$|
^tests/integration/providers/apache/cassandra/hooks/test_cassandra.py$|
^tests/system/providers/apache/spark/example_spark_dag.py$|
^docs/apache-airflow-providers-apache-cassandra/connections/cassandra.rst$|
^docs/apache-airflow-providers-apache-hive/commits.rst$|
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,13 @@ else
)
WWW_TESTS=("tests/www")
HELM_CHART_TESTS=("tests/charts")
INTEGRATION_TESTS=("tests/integration")
ALL_TESTS=("tests")
ALL_PRESELECTED_TESTS=(
"${CLI_TESTS[@]}"
"${API_TESTS[@]}"
"${HELM_CHART_TESTS[@]}"
"${INTEGRATION_TESTS[@]}"
"${PROVIDERS_TESTS[@]}"
"${CORE_TESTS[@]}"
"${ALWAYS_TESTS[@]}"
Expand All @@ -915,14 +917,15 @@ else
SELECTED_TESTS=("${WWW_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Helm" ]]; then
SELECTED_TESTS=("${HELM_CHART_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Integration" ]]; then
SELECTED_TESTS=("${INTEGRATION_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Other" ]]; then
find_all_other_tests
SELECTED_TESTS=("${ALL_OTHER_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "All" || ${TEST_TYPE} == "Quarantined" || \
${TEST_TYPE} == "Always" || \
${TEST_TYPE} == "Postgres" || ${TEST_TYPE} == "MySQL" || \
${TEST_TYPE} == "Long" || \
${TEST_TYPE} == "Integration" ]]; then
${TEST_TYPE} == "Long" ]]; then
SELECTED_TESTS=("${ALL_TESTS[@]}")
elif [[ ${TEST_TYPE} =~ Providers\[(.*)\] ]]; then
SELECTED_TESTS=()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _run_tests_in_pool(
progress_matcher=GenericRegexpProgressMatcher(
regexp=TEST_PROGRESS_REGEXP,
regexp_for_joined_line=PERCENT_TEST_PROGRESS_REGEXP,
lines_to_search=40,
lines_to_search=200,
),
) as (pool, outputs):
results = [
Expand Down
7 changes: 5 additions & 2 deletions scripts/docker/entrypoint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,13 @@ else
)
WWW_TESTS=("tests/www")
HELM_CHART_TESTS=("tests/charts")
INTEGRATION_TESTS=("tests/integration")
ALL_TESTS=("tests")
ALL_PRESELECTED_TESTS=(
"${CLI_TESTS[@]}"
"${API_TESTS[@]}"
"${HELM_CHART_TESTS[@]}"
"${INTEGRATION_TESTS[@]}"
"${PROVIDERS_TESTS[@]}"
"${CORE_TESTS[@]}"
"${ALWAYS_TESTS[@]}"
Expand All @@ -360,14 +362,15 @@ else
SELECTED_TESTS=("${WWW_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Helm" ]]; then
SELECTED_TESTS=("${HELM_CHART_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Integration" ]]; then
SELECTED_TESTS=("${INTEGRATION_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "Other" ]]; then
find_all_other_tests
SELECTED_TESTS=("${ALL_OTHER_TESTS[@]}")
elif [[ ${TEST_TYPE:=""} == "All" || ${TEST_TYPE} == "Quarantined" || \
${TEST_TYPE} == "Always" || \
${TEST_TYPE} == "Postgres" || ${TEST_TYPE} == "MySQL" || \
${TEST_TYPE} == "Long" || \
${TEST_TYPE} == "Integration" ]]; then
${TEST_TYPE} == "Long" ]]; then
SELECTED_TESTS=("${ALL_TESTS[@]}")
elif [[ ${TEST_TYPE} =~ Providers\[(.*)\] ]]; then
SELECTED_TESTS=()
Expand Down
31 changes: 0 additions & 31 deletions tests/cli/commands/test_celery_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,37 +61,6 @@ def test_validate_session_dbapi_exception(self, mock_session):
assert airflow.settings.validate_session() is False


@pytest.mark.integration("redis")
@pytest.mark.integration("rabbitmq")
@pytest.mark.backend("mysql", "postgres")
class TestWorkerServeLogs:
@classmethod
def setup_class(cls):
cls.parser = cli_parser.get_parser()

@mock.patch("airflow.cli.commands.celery_command.celery_app")
@conf_vars({("core", "executor"): "CeleryExecutor"})
def test_serve_logs_on_worker_start(self, mock_celery_app):
with mock.patch("airflow.cli.commands.celery_command.Process") as mock_process:
args = self.parser.parse_args(["celery", "worker", "--concurrency", "1"])

with mock.patch("celery.platforms.check_privileges") as mock_privil:
mock_privil.return_value = 0
celery_command.worker(args)
mock_process.assert_called()

@mock.patch("airflow.cli.commands.celery_command.celery_app")
@conf_vars({("core", "executor"): "CeleryExecutor"})
def test_skip_serve_logs_on_worker_start(self, mock_celery_app):
with mock.patch("airflow.cli.commands.celery_command.Process") as mock_popen:
args = self.parser.parse_args(["celery", "worker", "--concurrency", "1", "--skip-serve-logs"])

with mock.patch("celery.platforms.check_privileges") as mock_privil:
mock_privil.return_value = 0
celery_command.worker(args)
mock_popen.assert_not_called()


@pytest.mark.backend("mysql", "postgres")
class TestCeleryStopCommand:
@classmethod
Expand Down
Loading