Граф коммитов

31 Коммитов

Автор SHA1 Сообщение Дата
jlowin 7662cd8ce4 [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
2016-08-12 10:34:50 -07:00
Ajay Yadav 3ffa656d97 [AIRFLOW-248] Add Apache license header to all files
- Added Apache license header for files with extension (.service, .in, .mako, .properties, .ini, .sh, .ldif, .coveragerc, .cfg, .yml, .conf, .sql, .css, .js, .html, .xml.
- Added/Replaced shebang on all .sh files with portable version - #!/usr/bin/env bash.
- Skipped third party css and js files. Skipped all minified js files as well.

Closes #1598 from ajayyadava/248
2016-06-21 08:15:42 -07:00
jlowin 851adc5547 [AIRFLOW-31] Use standard imports for hooks/operators 2016-06-16 14:55:07 -04:00
jlowin a296cca03b Add function to get configuration as dict, plus unit tests
There are many ways to set configuration options in Airflow
but no way to actually see all of them (the web UI only shows
airflow.cfg). This takes the current configuration object
and writes it to a dict.

The "source" of an option can be displayed (for example,
'airflow.cfg', 'default', 'env var', etc.).

Sensitive (confidential) configuration options can be included
Unless specified, they are censored as '< hidden >'.
2016-03-28 13:04:17 -04:00
Nicholas Travers 5d80dea09a Clean test database out in between unit test runs 2016-02-10 08:55:52 -08:00
Thoralf Gutierrez 732297b7f5 fix condition in run_unit_tests.sh + fix indent + remove duplicated loaded config 2015-12-04 12:00:43 +01:00
Maxime Beauchemin 8506b60351 Removing forced resetdb from ./run_unit_tests 2015-11-30 08:47:02 -08:00
Marcin Tustin abbd181889 Address review comments. Add -y option to resetdb. 2015-11-20 16:11:57 +00:00
Marcin Tustin 37b60213c7 Add tests around schedule_dag. Make run_unit_tests.sh idempotent. Fix a
bug with @once dags
2015-11-19 20:06:50 +00:00
Svend Vanderveken 8783a10fd3 fix missplaced comment in run_unit_tests.sh 2015-11-11 00:13:14 +01:00
Svend Vanderveken 197b4bbd13 more flexible UT execution
- we now can specify nose parameter on the command line of ./run_unit_test.sh.
- if unspecified, the script falls back to previous behaviour, i.e. run all UTs
2015-11-10 17:52:45 +01:00
Maxime Beauchemin a37a4bcf66 Adapting CONTRIBUTING.md 2015-10-26 20:39:36 -07:00
Maxime Beauchemin c7cc36ab8d Moving to hadoop tests to the side for now 2015-10-21 10:45:27 -07:00
Maxime Beauchemin 2bfcb81412 Removing doctests for the time being 2015-10-21 10:42:01 -07:00
Maxime Beauchemin be39b353e7 Tweaks 2015-10-21 10:42:01 -07:00
Maxime Beauchemin 1ca1776b3d Trying different strategies to get initdb to run 2015-10-21 10:42:01 -07:00
Jack Danger Canty cc2f3ecd72 Setting up necessary dependencies for tests 2015-08-12 14:16:08 -07:00
Maxime c770c415da Better logging for the scheduler 2015-08-04 19:42:50 +00:00
Arthur Wiedmer 49201eef25 adding option to remove previous run data instead of manual rm 2015-06-15 16:07:20 -07:00
e3 2574507de2 Random spelling updates. 2015-06-05 19:41:36 +02:00
Maxime Beauchemin 00be1d05e7 Prioritization and concurency limitation on executor queues 2015-05-11 03:48:59 +00:00
Maxime 472d3c1221 Support for dicts and list in operators template_fields 2015-04-06 21:38:45 +00:00
Maxime 5580d10292 Making master scheduler disregard subdags 2015-03-18 15:48:36 +00:00
Mike Kerzhner ec2fc4b3e6 Postgres operator unit tests 2015-03-11 16:48:15 -07:00
Maxime Beauchemin 77fcc80599 Adding TimeSensor (operator) 2015-02-16 22:10:27 +00:00
Maxime 55c268d421 Improving the unit tests 2015-02-16 21:10:58 +00:00
Maxime Beauchemin 926408a9bb Copying the dict to be safe 2015-02-10 09:46:18 -08:00
Maxime 9d7815804c More unit tests 2015-02-10 08:30:51 +00:00
Maxime 62d5a97224 Insuring we're using the unittest cnfig 2015-02-09 19:02:45 +00:00
Maxime Beauchemin 836772ffdb Breaking downt initdb into initdb and resetdb 2015-02-09 08:09:06 -08:00
Maxime Beauchemin bdb205aebc Unit tests! 2015-02-08 21:50:18 -08:00