Skip to content

Cleanup committed zip file in tests/dags#46604

Merged
Lee-W merged 4 commits intoapache:mainfrom
josix:refactor/cleanup-persistent-zip-file-in-test-env
Feb 10, 2025
Merged

Cleanup committed zip file in tests/dags#46604
Lee-W merged 4 commits intoapache:mainfrom
josix:refactor/cleanup-persistent-zip-file-in-test-env

Conversation

@josix
Copy link
Contributor

@josix josix commented Feb 9, 2025

  • Adds a new pre-commit check "check-zip-file-is-not-committed" that prevents zip files from being committed to
    the repository
  • Updates .gitignore to ignore *.zip files (referencing issue Get rid of *.zip in tests cases #46449)
  • Refactors tests to remove committed zip files and replace them with dynamically generated ones:
    • Removes test_zip.zip and test_dag_warnings.zip from tests/dags/
    • Adds the contents of those zip files as regular files under tests/dags/test_zip/
    • Adds a test_zip_path fixture that dynamically creates zip files for testing
    • Updates various tests to use the new fixture instead of committed zip files

closes #46449


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@josix josix changed the title Cleanup committed zip file in tests Cleanup committed zip file in tests/dags Feb 9, 2025
@josix josix force-pushed the refactor/cleanup-persistent-zip-file-in-test-env branch 3 times, most recently from 99e823f to c9b9d77 Compare February 10, 2025 04:18
@josix josix force-pushed the refactor/cleanup-persistent-zip-file-in-test-env branch from c9b9d77 to 20801d5 Compare February 10, 2025 04:23
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

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

LGTM!

@Lee-W
Copy link
Member

Lee-W commented Feb 10, 2025

Just a quick update for @amoghrajesh . This PR has resolved my previous zip file comment in your PR.

@Lee-W Lee-W merged commit f1f5212 into apache:main Feb 10, 2025
91 checks passed
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
* refactor: remove test_dag_warning.zip in test_dagbag.py

* refactor: add dynamic test_zip_path fixture for generating test zip files

* chore: Ignore zip files in .gitignore

* fixup! refactor: add dynamic test_zip_path fixture for generating test zip files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get rid of *.zip in tests cases

2 participants