# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

# NOTE FOR CONTRIBUTORS:
#
# Values specified in this file are automatically used in our unit tests
# run by pytest and override default airflow configuration values provided by config.yml.
#
# These configuration settings should provide consistent environment to run tests -
# no matter if you are in Breeze env or use local venv or even run tests in the CI environment.
#
# If you want to have all unit tests to get some default configuration value, you should set it here.
#
# You can instead use ``conf_vars`` context manager or override the ``AIRFLOW__<SECTION>__<KEY>`` environment
# variable to set the configuration value for a specific test or a group of tests.
#
# The test configuration is loaded via setting AIRFLOW__CORE__UNIT_TEST_MODE=True
# in a pytest fixture in tests/conftest.py. This in turn triggers reloading of the configuration
# from this file after cleaning the respective configuration retrieved during initialization
# of configuration. See ``load_test_config`` function in ``airflow/config.py`` for details.
#


[core]
# We want to read dags from the test dags folder
dags_folder = {TEST_DAGS_FOLDER}
# we want to read plugins from example_dags/plugins folder
plugins_folder = {TEST_PLUGINS_FOLDER}
# we want to read fernet key generated dynamically in load_test_config
fernet_key = {FERNET_KEY}
# for tests we use local executor by default
executor = LocalExecutor
# We do not want dags to be paused at creation
dags_are_paused_at_creation = False
# We want to load examples
load_examples = True
# No default impersonation in tests - tests that run impersonation should set this explicitly
default_impersonation =
# We want to use unit test mode (though technically it is not needed as we set it in pytest fixture
# via AIRFLOW__CORE__UNIT_TEST_MODE environment variable)
unit_test_mode = True
# We want to use a shorter timeout for task cleanup
killed_task_cleanup_time = 5
# We only allow our own classes to be deserialized in tests
allowed_deserialization_classes = airflow.* tests.*

[database]

[logging]
# celery tests rely on it being set
celery_logging_level = INFO

[smtp]
# Used as default values for SMTP unit tests
smtp_mail_from = airflow@example.com

[api]


[fab]
auth_backends = airflow.providers.fab.auth_manager.api.auth.backend.session

[hive]
# Hive uses the configuration below to run the tests
default_hive_mapred_queue: airflow

[celery]
# used to test that we can load celery config from airflow.cfg
broker_url = amqp://guest:guest@rabbitmq:5672/
# and same for result backend
result_backend = db+mysql://airflow:airflow@localhost:3306/airflow

[scheduler]
# Those values are set so that during unit tests things run faster than usual
job_heartbeat_sec = 1
scheduler_heartbeat_sec = 5
# Defaults are changed in 3.0, but there are too many tests on data interval to fix.
create_cron_data_intervals = true
create_delta_data_intervals = true

[dag_processor]
parsing_processes = 2
bundle_refresh_check_interval = 0

[triggerer]
# Those values are set so that during unit tests things run faster than usual.
# Triggerer heartbeat intentionally different from scheduler to catch bad assumptions in code
# that they are the same which by default they are in production but they can be configured differently
# by users.
job_heartbeat_sec = 2

[opensearch]
host =
port =
username =
password =
log_id_template =
end_of_log_mark = end_of_log
write_stdout = False
json_format = False
json_fields = asctime, filename, lineno, levelname, message
host_field = host
offset_field = offset
index_patterns = _all
index_patterns_callable =

[opensearch_configs]
http_compress = False
use_ssl = False
verify_certs = False
ssl_assert_hostname = False
ssl_show_warn = False
ca_certs =

[elasticsearch_configs]
verify_certs = True
http_compress = False


[example_section]
# This section is used to test coercions of configuration values retrieval
string_value = 21600
only_bool_value = true
only_float_value = 12.0
only_integer_value = 21600
only_string_value = this is a test

[api_auth]
jwt_secret = {JWT_SECRET_KEY}
