Skip to content

Conversation

@mik-laj
Copy link
Member

@mik-laj mik-laj commented Feb 2, 2020

During the introduction of AIP-21, I corrected the test file names. Very often the file name in the application did not match the test file name. Now I would like to prevent regression, so I add tests that detect typos in names. This will also force you to add tests.

This is an experiment that we can extend to other packages in the project in the future.

CC: @coopergillan


Issue link: AIRFLOW-6720

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@mik-laj mik-laj force-pushed the AIRFLOW-6723-missing-test branch from 4b0141f to 4c302d9 Compare February 2, 2020 23:47
@codecov-io
Copy link

codecov-io commented Feb 3, 2020

Codecov Report

Merging #7346 into master will decrease coverage by 0.23%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7346      +/-   ##
==========================================
- Coverage    86.1%   85.86%   -0.24%     
==========================================
  Files         871      871              
  Lines       40574    40574              
==========================================
- Hits        34935    34839      -96     
- Misses       5639     5735      +96
Impacted Files Coverage Δ
airflow/kubernetes/volume_mount.py 44.44% <0%> (-55.56%) ⬇️
airflow/kubernetes/volume.py 52.94% <0%> (-47.06%) ⬇️
airflow/kubernetes/pod_launcher.py 45.25% <0%> (-46.72%) ⬇️
airflow/executors/celery_executor.py 50.67% <0%> (-37.84%) ⬇️
airflow/kubernetes/refresh_config.py 50.98% <0%> (-23.53%) ⬇️
...viders/cncf/kubernetes/operators/kubernetes_pod.py 76.47% <0%> (-21.18%) ⬇️
airflow/executors/base_executor.py 93.58% <0%> (-2.57%) ⬇️
airflow/jobs/scheduler_job.py 89.34% <0%> (+0.14%) ⬆️
airflow/utils/dag_processing.py 88.5% <0%> (+0.38%) ⬆️
airflow/hooks/dbapi_hook.py 91.73% <0%> (+0.82%) ⬆️
... and 4 more

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 d9fc5be...04cc228. Read the comment docs.

@potiuk
Copy link
Member

potiuk commented Feb 3, 2020

Nice. I think it's a good step. I'd like others to chime in - but it looks like an interesting approach.

@mik-laj mik-laj requested review from BasPH, ashb, kaxil and turbaszek February 3, 2020 07:20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think missing_tests_files <= MISSING_TEST_FILES is the proper condition, as missing_tests_files can be subset of MISSING_TEST_FILES. In case someone added a missing test this test should pass and test_keep_missing_test_files_update should fail. Otherwise, we are testing the same thing two times.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good with equals. The goal is - similar as with pylint_todo.txt to go with this list to empty. So when someone adds test file, the test will fail and it will be the right time for the person who adds this file to remove it from the list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but we have two tests. One that checks missing files (this one) and second one that checks if someone adjusted the MISSING_TEST_FILES.

Copy link
Member Author

@mik-laj mik-laj Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you. Updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. that's nicer now!

@mik-laj mik-laj force-pushed the AIRFLOW-6723-missing-test branch from 4c302d9 to 53845c6 Compare February 3, 2020 08:03
@mik-laj mik-laj merged commit 92c72f4 into apache:master Feb 3, 2020
@coopergillan
Copy link
Contributor

Noted on the cc - picked up a couple of these over in #7468.

galuszkak pushed a commit to FlyrInc/apache-airflow that referenced this pull request Mar 5, 2020
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.

7 participants