unit_tests.cfg 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. # NOTE FOR CONTRIBUTORS:
  18. #
  19. # Values specified in this file are automatically used in our unit tests
  20. # run by pytest and override default airflow configuration values provided by config.yml.
  21. #
  22. # These configuration settings should provide consistent environment to run tests -
  23. # no matter if you are in Breeze env or use local venv or even run tests in the CI environment.
  24. #
  25. # If you want to have all unit tests to get some default configuration value, you should set it here.
  26. #
  27. # You can instead use ``conf_vars`` context manager or override the ``AIRFLOW__<SECTION>__<KEY>`` environment
  28. # variable to set the configuration value for a specific test or a group of tests.
  29. #
  30. # The test configuration is loaded via setting AIRFLOW__CORE__UNIT_TEST_MODE=True
  31. # in a pytest fixture in tests/conftest.py. This in turn triggers reloading of the configuration
  32. # from this file after cleaning the respective configuration retrieved during initialization
  33. # of configuration. See ``load_test_config`` function in ``airflow/config.py`` for details.
  34. #
  35. [core]
  36. # We want to read dags from the test dags folder
  37. dags_folder = {TEST_DAGS_FOLDER}
  38. # we want to read plugins from example_dags/plugins folder
  39. plugins_folder = {TEST_PLUGINS_FOLDER}
  40. # we want to read fernet key generated dynamically in load_test_config
  41. fernet_key = {FERNET_KEY}
  42. # for tests we use local executor by default
  43. executor = LocalExecutor
  44. # We do not want dags to be paused at creation
  45. dags_are_paused_at_creation = False
  46. # We want to load examples
  47. load_examples = True
  48. # We want pickling to be enabled in tests
  49. donot_pickle = False
  50. # No default impersonation in tests - tests that run impersonation should set this explicitly
  51. default_impersonation =
  52. # We want to use unit test mode (though technically it is not needed as we set it in pytest fixture
  53. # via AIRFLOW__CORE__UNIT_TEST_MODE environment variable)
  54. unit_test_mode = True
  55. # We want to use a shorter timeout for task cleanup
  56. killed_task_cleanup_time = 5
  57. # We only allow our own classes to be deserialized in tests
  58. allowed_deserialization_classes = airflow.* tests.*
  59. [database]
  60. [logging]
  61. # celery tests rely on it being set
  62. celery_logging_level = INFO
  63. [smtp]
  64. # Used as default values for SMTP unit tests
  65. smtp_user = airflow
  66. smtp_password = airflow
  67. smtp_mail_from = airflow@example.com
  68. [api]
  69. auth_backends = airflow.api.auth.backend.default
  70. [hive]
  71. # Hive uses the configuration below to run the tests
  72. default_hive_mapred_queue: airflow
  73. [celery]
  74. # used to test that we can load celery config from airflow.cfg
  75. broker_url = amqp://guest:guest@rabbitmq:5672/
  76. # and same for result backend
  77. result_backend = db+mysql://airflow:airflow@localhost:3306/airflow
  78. [scheduler]
  79. # Those values are set so that during unit tests things run faster than usual
  80. job_heartbeat_sec = 1
  81. scheduler_heartbeat_sec = 5
  82. parsing_processes = 2
  83. dag_dir_list_interval = 0
  84. [triggerer]
  85. # Those values are set so that during unit tests things run faster than usual.
  86. # Triggerer heartbeat intentionally different from scheduler to catch bad assumptions in code
  87. # that they are the same which by default they are in production but they can be configured differently
  88. # by users.
  89. job_heartbeat_sec = 2
  90. [example_section]
  91. # This section is used to test coercions of configuration values retrieval
  92. string_value = 21600
  93. only_bool_value = true
  94. only_float_value = 12.0
  95. only_integer_value = 21600
  96. only_string_value = this is a test