You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "George Sakkis (JIRA)" <ji...@apache.org> on 2017/02/12 11:04:41 UTC

[jira] [Created] (AIRFLOW-867) Tons of unit tests are ignored

George Sakkis created AIRFLOW-867:
-------------------------------------

             Summary: Tons of unit tests are ignored
                 Key: AIRFLOW-867
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-867
             Project: Apache Airflow
          Issue Type: Bug
          Components: tests
            Reporter: George Sakkis
            Priority: Critical


I was poking around in tests and found out that lots of tests are not discovered by nosetests:
{noformat}
$ nosetests -q --collect-only 
----------------------------------------------------------------------
Ran 254 tests in 0.948s

$ grep -R 'def test' tests/ | wc -l
360
{noformat}
Initially I thought it might be related to not having installed all extra dependencies but it turns out it's because apparently nosetests expects explicit import of the related modules instead of discovering them automatically (like py.test). For example, when adding an {{from .ti_deps.deps.runnable_exec_date_dep import *}} in {{tests/__init__.py}} it finds 260 tests, while when commenting out all imports in this module it finds only 15!

h4. Possible options
* Quick fix: Add the necessary missing "import *" to discover all current tests.
* Better fix: Move from nosetests to py.tests and get rid of the ugly error-prone 'import *' hack.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)