Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-1094] Run unit tests under contrib in Travis #2234

Closed
wants to merge 1 commit into from

Conversation

hgrif
Copy link
Contributor

@hgrif hgrif commented Apr 11, 2017

Dear Airflow maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Run unit tests under contrib in Travis

Rename all unit tests under tests/contrib to start with test_* and fix
broken unit tests so that they run for the Python 2 and 3 builds.

General:

  • Rename all tests to start with test_*
  • Remove imports in tests/*/__init__.py's
  • Add missing packages to requirements.txt of CI

BigQueryHook:

  • Check for JSON and not json

DataDogSensor:

  • Add connection before starting unit tests

DataFlowPythonOperator:

  • Use GoogleCloudBucketHelper instead of GoogleCloudStorageHook
  • Fix broken assert

ECSOperator:

  • Replace sys.maxint by sys.maxsize for Python 3 support
  • Allow startedBy to be any argument as CI seems to run it as 'airflow' and not 'Airflow'
  • Fix checking of exceptions

SparkSubmitHook:

  • Skip tests if Python 3

SqoopHook:

  • Remove unneeded OSError (breaking in Python 3)

SSHExecuteOperator:

  • Add proper mocks

Zendesk:

  • Add under hooks import
  • Update import path of BaseHook
  • Rewrite pytest unit tests in unittest

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

No extra tests are added, some tests already present are fixed.

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@codecov-io
Copy link

codecov-io commented Apr 11, 2017

Codecov Report

Merging #2234 into master will increase coverage by 0.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2234      +/-   ##
==========================================
+ Coverage   68.21%   68.58%   +0.37%     
==========================================
  Files         142      142              
  Lines       10957    10957              
==========================================
+ Hits         7474     7515      +41     
+ Misses       3483     3442      -41
Impacted Files Coverage Δ
airflow/hooks/__init__.py 58.82% <ø> (ø) ⬆️
airflow/hooks/zendesk_hook.py 84.78% <100%> (+84.78%) ⬆️
airflow/models.py 87.22% <0%> (-0.06%) ⬇️
airflow/hooks/base_hook.py 92.15% <0%> (+1.96%) ⬆️
airflow/utils/__init__.py 100% <0%> (+33.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f9f508...4c42c49. Read the comment docs.

@hgrif
Copy link
Contributor Author

hgrif commented Apr 11, 2017

Hm, only now I see that this PR that was opened earlier.

Anyways, this PR is scoped only to contrib, making merging a bit less dangerous. Some of the improvements in that PR might be more Pythonic than mine, so let me know if I could adapt anything/merge the contrib parts of that PR.

@hgrif hgrif changed the title [AIRFLOW-1094] Run unit tests under contrib in Travis [AIRFLOW-1094] Run unit tests under contrib in Travis [WIP] Apr 13, 2017
@hgrif hgrif force-pushed the AIRFLOW-1094 branch 4 times, most recently from 6d86540 to 1acee19 Compare April 13, 2017 18:41
@hgrif hgrif changed the title [AIRFLOW-1094] Run unit tests under contrib in Travis [WIP] [AIRFLOW-1094] Run unit tests under contrib in Travis Apr 13, 2017
Rename all unit tests under tests/contrib to start with test_* and fix
broken unit tests so that they run for the Python 2 and 3 builds.
@hgrif
Copy link
Contributor Author

hgrif commented Apr 14, 2017

@bolkedebruin: checked PR 2078 for things to incorporate and limited the scope a bit (less making things look nice).

@asfgit asfgit closed this in 219c506 Apr 17, 2017
alekstorm pushed a commit to alekstorm/incubator-airflow that referenced this pull request Jun 1, 2017
Rename all unit tests under tests/contrib to start
with test_* and fix
broken unit tests so that they run for the Python
2 and 3 builds.

Closes apache#2234 from hgrif/AIRFLOW-1094
stverhae pushed a commit to stverhae/incubator-airflow that referenced this pull request Jun 6, 2017
Rename all unit tests under tests/contrib to start
with test_* and fix
broken unit tests so that they run for the Python
2 and 3 builds.

Closes apache#2234 from hgrif/AIRFLOW-1094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants