Skip to content

Missing unit tests for some modules in providers package #8278

Closed

Description

@mik-laj

Description

We have a rule that every file in the providers directory should have tests. This is true in many cases, but there are minor exceptions.
https://github.com/apache/airflow/blob/master/tests/test_project_structure.py#L29-L50

  • tests/providers/amazon/aws/hooks/test_athena.py
  • tests/providers/apache/cassandra/sensors/test_record.py
  • tests/providers/apache/cassandra/sensors/test_table.py
  • tests/providers/apache/hdfs/sensors/test_web_hdfs.py
  • tests/providers/apache/hive/operators/test_vertica_to_hive.py
  • tests/providers/apache/pig/operators/test_pig.py
  • tests/providers/apache/spark/hooks/test_spark_jdbc_script.py
  • tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py
  • tests/providers/google/cloud/operators/test_datastore.py
  • tests/providers/google/cloud/operators/test_sql_to_gcs.py
  • tests/providers/google/cloud/sensors/test_bigquery.py
  • tests/providers/google/cloud/utils/test_field_sanitizer.py
  • tests/providers/google/cloud/utils/test_field_validator.py
  • tests/providers/google/cloud/utils/test_mlengine_operator_utils.py
  • tests/providers/google/cloud/utils/test_mlengine_prediction_summary.py
  • tests/providers/jenkins/hooks/test_jenkins.py
  • tests/providers/microsoft/azure/sensors/test_azure_cosmos.py
  • tests/providers/microsoft/mssql/hooks/test_mssql.py
  • tests/providers/oracle/operators/test_oracle.py
  • tests/providers/qubole/hooks/test_qubole.py
  • tests/providers/samba/hooks/test_samba.py
  • tests/providers/sqlite/operators/test_sqlite.py
  • tests/providers/yandex/hooks/test_yandex.py

I would be happy if someone would complete the missing tests.

If you decide to finish this ticket you don't have to do all the work yourself. One PR can only deal with a single file and it's ok.

Are you wondering how to start contributing to this project? Start by reading our contributor guide

Use case / motivation

Raising test coverage facilitates refactoring and prevents regression.

For the contributor, this is an opportunity to learn more about the structure of the project and to learn better good practices in writing tests in Python.

Related Issues

N/A

Activity

  1. changed the title [-]Missing tests for some modules in providers package[/-] [+]Missing unit tests for some modules in providers package[/+] on Apr 13, 2020
  2. samuelkhtu commented on Jun 11, 2020

    @samuelkhtu
    Contributor

    If no one is working on the test_mssql.py, I can take work it.

    tests/providers/microsoft/mssql/hooks/test_mssql.py

  3. subkanthi commented on Jul 5, 2020

    @subkanthi
    Contributor

    Added tests for Yandex hook

    • tests/providers/yandex/hooks/test_yandex.py

    https://github.com/apache/airflow/pull/9665/files

  4. subkanthi commented on Jul 12, 2020

    @subkanthi
    Contributor

    Added unit test for jenkins hook
    #9767

  5. rootcss commented on Jul 18, 2020

    @rootcss
    Contributor

    I've picked Cassandra table and record sensors hook. (primarily because, I ❤️ Cassandra)

     tests/providers/apache/cassandra/sensors/test_record.py
     tests/providers/apache/cassandra/sensors/test_table.py
    
  6. rootcss commented on Jul 18, 2020

    @rootcss
    Contributor

    Picked tests/providers/apache/hdfs/sensors/test_web_hdfs.py

  7. mik-laj commented on Jul 18, 2020

    @mik-laj
    MemberAuthor

    @rootcss Wouldn't you be willing to give some love for this ticket?
    #8189

  8. rootcss commented on Jul 18, 2020

    @rootcss
    Contributor

    @rootcss Wouldn't you be willing to give some love for this ticket?
    #8189

    @mik-laj Here's some more ❤️ for Cassandra - #9877

  9. ari-hacks commented on Jul 19, 2020

    @ari-hacks

    I'd like to tackle tests/providers/microsoft/azure/sensors/test_azure_cosmos.py

  10. rootcss commented on Jul 22, 2020

    @rootcss
    Contributor

    I'm picking the following tests:

    • tests/providers/google/cloud/utils/test_field_sanitizer.py
    • tests/providers/google/cloud/utils/test_field_validator.py
    • tests/providers/microsoft/mssql/hooks/test_mssql.py
    • tests/providers/samba/hooks/test_samba.py
      cc: @mik-laj
  11. rootcss commented on Jul 23, 2020

    @rootcss
    Contributor

    @mik-laj MsSqlHook in airflow/providers/microsoft/mssql/hooks/mssql.py is deprecated. Do we still need to add tests for it?

  12. mik-laj commented on Jul 25, 2020

    @mik-laj
    MemberAuthor

    @rootcss If someone is willing, they can add tests, but it is not necessary. I will be happy without tests for this module.

  13. mik-laj commented on Jul 25, 2020

    @mik-laj
    MemberAuthor

    @rootcss As far as I know, Tomek is working on tests for Datastore.

    @turbaszek Can you confirm that?

  14. mik-laj commented on Jul 25, 2020

    @mik-laj
    MemberAuthor
  15. rootcss commented on Jul 26, 2020

    @rootcss
    Contributor

    @rootcss As far as I know, Tomek is working on tests for Datastore.

    @turbaszek Can you confirm that?

    Sure. I've removed it from my list.

  16. rootcss commented on Jul 26, 2020

    @rootcss
    Contributor

    @mik-laj I think, rest of the tests have been picked already. We're close to close this issue :)

  17. rootcss commented on Jul 27, 2020

    @rootcss
    Contributor

    I've picked tests/providers/google/cloud/utils/test_mlengine_prediction_summary.py

  18. mik-laj commented on Sep 8, 2020

    @mik-laj
    MemberAuthor

    The ticket has been completed :-D

    Thanks to everyone who participated in this task.
    More info: #10799

  19. potiuk commented on Sep 8, 2020

    @potiuk
    Member

    🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

  20. rootcss commented on Sep 8, 2020

    @rootcss
    Contributor

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions