You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/08/12 17:35:20 UTC

[jira] [Commented] (AIRFLOW-371) Configuration test_mode() doesn't seem to do anything

    [ https://issues.apache.org/jira/browse/AIRFLOW-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15419172#comment-15419172 ] 

ASF subversion and git services commented on AIRFLOW-371:
---------------------------------------------------------

Commit 7662cd8ce487134320023ce7f8dce5067f14c0c9 in incubator-airflow's branch refs/heads/master from jlowin
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=7662cd8 ]

[AIRFLOW-328][AIRFLOW-371] Remove redundant default configuration & fix unit test configuration

AIRFLOW-328
https://issues.apache.org/jira/browse/AIRFLOW-328
Previously, Airflow had both a default template for airflow.cfg AND a
dictionary of default values. Frequently, these get out of sync (an
option in one has a different value than in the other, or isn’t present
in the other). This commit removes the default dict and uses the
airflow.cfg template to provide defaults. The ConfigParser first reads
the template, loading all the options it contains, and then reads the
user’s actual airflow.cfg to overwrite the default values with any new
ones.

AIRFLOW-371
https://issues.apache.org/jira/browse/AIRFLOW-371
Calling test_mode() didn't actually change Airflow's configuration! This actually wasn't an issue in unit tests because the unit test run script was hardcoded to point at the unittest.cfg file, but it needed to be fixed.

[AIRFLOW-328] Remove redundant default configuration

Previously, Airflow had both a default template
for airflow.cfg AND a dictionary of default
values. Frequently, these get out of sync (an
option in one has a different value than in the
other, or isn’t present in the other). This commit
removes the default dict and uses the airflow.cfg
template to provide defaults. The ConfigParser
first reads the template, loading all the options
it contains, and then reads the user’s actual
airflow.cfg to overwrite the default values with
any new ones.

[AIRFLOW-371] Make test_mode() functional

Previously, calling test_mode() didn’t actually
do anything.

This PR renames it to load_test_config() (to
avoid confusion, ht @r39132).

In addition, manually entering test_mode after
Airflow launches might be too late — some
options have already been loaded (DAGS_FOLDER,
etc.). This makes it so setting
tests/unit_test_mode OR the equivalent env var
(AIRFLOW__TESTS__UNIT_TEST_MODE) will load the
test config immediately, prior to loading the
rest of Airflow.

Closes #1677 from jlowin/Simplify-config


> Configuration test_mode() doesn't seem to do anything
> -----------------------------------------------------
>
>                 Key: AIRFLOW-371
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-371
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: tests, ts
>            Reporter: Jeremiah Lowin
>            Assignee: Jeremiah Lowin
>
> Calling {{airflow.conf.test_mode()}} loads a new configuration object with the TEST_CONFIG, but it doesn't actually return it -- it appears that the TEST_CONFIG is never actually loaded. In other words, calling {{test_mode()}} doesn't actually do anything!
> This doesn't affect Airflow's unit testing process because the {{run_unit_tests.sh}} script explicitly points at the hardcoded {{unittest.cfg}} file.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)