[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 18:15:42 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
#
|
2018-04-14 10:13:23 +03:00
|
|
|
# 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
|
2018-08-08 09:07:08 +03:00
|
|
|
#
|
2018-04-14 10:13:23 +03:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2018-08-08 09:07:08 +03:00
|
|
|
#
|
2018-04-14 10:13:23 +03:00
|
|
|
# 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.
|
[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 18:15:42 +03:00
|
|
|
|
2017-01-19 05:11:01 +03:00
|
|
|
set -x
|
2015-11-10 19:52:45 +03:00
|
|
|
|
2016-03-24 03:03:06 +03:00
|
|
|
# environment
|
2018-08-22 11:26:54 +03:00
|
|
|
export AIRFLOW_HOME=${AIRFLOW_HOME:=~}
|
[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 20:34:50 +03:00
|
|
|
export AIRFLOW__CORE__UNIT_TEST_MODE=True
|
2015-08-12 19:17:23 +03:00
|
|
|
|
2017-12-12 03:47:47 +03:00
|
|
|
# add test/contrib to PYTHONPATH
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
export PYTHONPATH=$PYTHONPATH:${DIR}/tests/test_utils
|
|
|
|
|
2016-03-24 03:03:06 +03:00
|
|
|
# any argument received is overriding the default nose execution arguments:
|
2015-11-10 19:52:45 +03:00
|
|
|
nose_args=$@
|
|
|
|
|
2015-08-12 19:17:23 +03:00
|
|
|
# Generate the `airflow` executable if needed
|
|
|
|
which airflow > /dev/null || python setup.py develop
|
|
|
|
|
2015-10-18 00:04:56 +03:00
|
|
|
echo "Initializing the DB"
|
2018-08-22 11:26:54 +03:00
|
|
|
yes | airflow initdb
|
2016-02-07 09:42:21 +03:00
|
|
|
yes | airflow resetdb
|
2015-08-12 19:17:23 +03:00
|
|
|
|
2018-08-22 11:26:54 +03:00
|
|
|
if [ -z "$nose_args" ]; then
|
|
|
|
nose_args="--with-coverage \
|
|
|
|
--cover-erase \
|
|
|
|
--cover-html \
|
|
|
|
--cover-package=airflow \
|
|
|
|
--cover-html-dir=airflow/www/static/coverage \
|
|
|
|
--with-ignore-docstrings \
|
|
|
|
--rednose \
|
|
|
|
--with-timer \
|
|
|
|
-v \
|
|
|
|
--logging-level=DEBUG "
|
|
|
|
fi
|
|
|
|
|
|
|
|
# For impersonation tests running on SQLite on Travis, make the database world readable so other
|
|
|
|
# users can update it
|
|
|
|
AIRFLOW_DB="$HOME/airflow.db"
|
|
|
|
|
|
|
|
if [ -f "${AIRFLOW_DB}" ]; then
|
|
|
|
chmod a+rw "${AIRFLOW_DB}"
|
|
|
|
chmod g+rwx "${AIRFLOW_HOME}"
|
2017-01-19 05:11:01 +03:00
|
|
|
fi
|
|
|
|
|
2018-08-22 11:26:54 +03:00
|
|
|
# For impersonation tests on Travis, make airflow accessible to other users via the global PATH
|
|
|
|
# (which contains /usr/local/bin)
|
|
|
|
sudo ln -sf "${VIRTUAL_ENV}/bin/airflow" /usr/local/bin/
|
|
|
|
|
2015-11-10 19:52:45 +03:00
|
|
|
echo "Starting the unit tests with the following nose arguments: "$nose_args
|
|
|
|
nosetests $nose_args
|
|
|
|
|
2015-06-05 20:41:36 +03:00
|
|
|
# To run individual tests:
|
2015-05-10 01:30:40 +03:00
|
|
|
# nosetests tests.core:CoreTest.test_scheduler_job
|