Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

# Helm Chart
/chart/ @jedcunningham @hussein-awala @jscheffl @bugraoz93
/helm-tests/ @jedcunningham @hussein-awala @jscheffl @bugraoz93

# Docs
/docs/*.py @potiuk @ashb @gopidesupavan @amoghrajesh @jscheffl @bugraoz93 @jason810496
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ updates:
- /dev/breeze
- /docker-tests
- /kubernetes-tests
- /helm-tests
- /chart
- /task-sdk
- /
schedule:
Expand Down Expand Up @@ -211,7 +211,7 @@ updates:
- /dev/breeze
- /docker-tests
- /kubernetes-tests
- /helm-tests
- /chart
- /task-sdk
- /
schedule:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/helm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ jobs:
- name: "Helm release package"
run: >
breeze release-management prepare-helm-chart-package --sign-email dev@airflow.apache.org
- name: "Verify packaged chart contents and lint"
run: >
uv run scripts/ci/verify_helm_chart_package.py dist/airflow-*.tgz
- name: "Sign artifacts for ASF distribution"
run: ./dev/sign.sh dist/airflow-*.tgz dist/airflow-*-source.tar.gz
env:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ repos:
^.*airflow\.template\.yaml$|
^.*init_git_sync\.template\.yaml$|
^chart/(?:templates|files)/.*\.yaml$|
^helm-tests/tests/chart_utils/keda.sh_scaledobjects\.yaml$|
^chart/tests/chart_utils/keda.sh_scaledobjects\.yaml$|
.*/v1.*\.yaml$|
^.*openapi.*\.yaml$|
^\.pre-commit-config\.yaml$|
Expand Down Expand Up @@ -678,7 +678,7 @@ repos:
.*/dist/.*|
^docs/apache-airflow-providers-amazon/secrets-backends/aws-ssm-parameter-store\.rst$|
git|
^helm-tests/tests/chart_utils/helm_template_generator\.py$|
^chart/tests/chart_utils/helm_template_generator\.py$|
package-lock\.json$|
^.*\.(png|gif|jp[e]?g|svg|tgz|lock|woff2?)$|
^\.pre-commit-config\.yaml$|
Expand Down
13 changes: 13 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,16 @@ bin

# We do not want to include our Python Helm Chart Unit test files
tests
# Workspace-member metadata for the chart's pytest / mypy config — irrelevant
# to chart consumers.
pyproject.toml
# Local dev/CI hook config — irrelevant to chart consumers.
.pre-commit-config.yaml
# Chart documentation source (rendered to airflow.apache.org/docs/helm-chart/);
# chart consumers do not need the rst sources shipped inside the .tgz.
docs/
# towncrier source fragments used to build RELEASE_NOTES.rst at release time.
newsfragments/
# Reference Kustomize overlays — published in the source tree, explicitly NOT
# distributed inside the chart .tgz (see kustomize-overlays/README.rst).
kustomize-overlays/
7 changes: 7 additions & 0 deletions chart/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ repos:
files: ^\.pre-commit-config\.yaml$|^../scripts/ci/prek/update_build_dependencies\.py$
pass_filenames: false
require_serial: true
- id: mypy-helm-tests
name: Run mypy for helm-tests
language: python
entry: ../scripts/ci/prek/run_mypy_full_dist_local_venv_or_breeze_in_ci.py chart/tests
pass_filenames: false
files: ^tests/.*\.py$
require_serial: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
Expand Down
28 changes: 28 additions & 0 deletions chart/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,33 @@ version = "0.0.1"

dependencies = [
"apache-airflow-core",
"apache-airflow-devel-common",
"apache-airflow-providers-cncf-kubernetes",
]

[tool.pytest]
addopts = [
"-rasl",
"--verbosity=2",
"-p", "no:flaky",
"-p", "no:nose",
"-p", "no:legacypath",
]
norecursedirs = [
".eggs",
]
log_level = "INFO"
filterwarnings = [
"error::pytest.PytestCollectionWarning",
]
python_files = [
"*.py",
]

# Keep temporary directories (created by `tmp_path`) for 2 recent runs only failed tests.
tmp_path_retention_count = "2"
tmp_path_retention_policy = "failed"

[tool.hatch.build.targets.sdist]
exclude = ["*"]

Expand All @@ -81,5 +106,8 @@ bypass-selection = true
docs = [
"apache-airflow-devel-common[docs]"
]
mypy = [
"apache-airflow-devel-common[mypy]",
]

packages = []
File renamed without changes.
12 changes: 6 additions & 6 deletions contributing-docs/testing/helm_unit_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Helm Unit Tests

On the Apache Airflow Project, we have decided to stick with pythonic testing for our Helm chart. This makes our chart
easier to test, easier to modify, and able to run with the same testing infrastructure. To add Helm unit tests
add them under ``helm-tests/tests/helm_tests`` directory.
add them under ``chart/tests/helm_tests`` directory.

.. code-block:: python

Expand Down Expand Up @@ -56,14 +56,14 @@ following command (it takes quite a long time even on a multi-processor machine)

breeze testing helm-tests

You can also execute tests from a selected package only. Tests in ``helm-tests/tests/helm_tests`` are grouped
You can also execute tests from a selected package only. Tests in ``chart/tests/helm_tests`` are grouped
by packages so rather than running all tests, you can run only tests from a selected package. For example:

.. code-block:: bash

breeze testing helm-tests --test-type airflow_aux

Will run all tests from ``helm-tests/tests/helm_tests/airflow_aux`` package.
Will run all tests from ``chart/tests/helm_tests/airflow_aux`` package.


You can also run Helm tests individually via the usual ``breeze`` command. Just enter breeze and run the
Expand All @@ -80,19 +80,19 @@ This enters breeze container.

.. code-block:: bash

pytest helm-tests -n auto
pytest chart/tests -n auto

This runs all chart tests using all processors you have available.

.. code-block:: bash

pytest helm-tests/tests/helm_tests/airflow_aux/test_airflow_common.py -n auto
pytest chart/tests/helm_tests/airflow_aux/test_airflow_common.py -n auto

This will run all tests from ``tests_airflow_common.py`` file using all processors you have available.

.. code-block:: bash

pytest helm-tests/tests/helm_tests/airflow_aux/test_airflow_common.py
pytest chart/tests/helm_tests/airflow_aux/test_airflow_common.py

This will run all tests from ``tests_airflow_common.py`` file sequentially.

Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/doc/ci/04_selective_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ We have the following Groups of files for CI that determine which tests are run:
* `Always test files` - Files that belong to "Always" run tests.
* `API tests files` and `Codegen test files` - those are OpenAPI definition files that impact
Open API specification and determine that we should run dedicated API tests.
* `Helm files` - change in those files impacts helm "rendering" tests - `chart` folder and `helm-tests` folder.
* `Helm files` - change in those files impacts helm "rendering" tests - `chart` folder (which contains the chart sources and tests under `chart/tests/`).
* `Build files` - change in the files indicates that we should run `upgrade to newer dependencies` -
build dependencies in `pyproject.toml` and generated dependencies files in `generated` folder.
The dependencies are automatically generated from the `provider.yaml` files in provider by
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def all_helm_test_packages() -> list[str]:
return sorted(
[
candidate.name
for candidate in (AIRFLOW_ROOT_PATH / "helm-tests" / "tests" / "helm_tests").iterdir()
for candidate in (AIRFLOW_ROOT_PATH / "chart" / "tests" / "helm_tests").iterdir()
if candidate.is_dir() and candidate.name != "__pycache__"
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
("docs", "/opt/airflow/docs"),
("generated", "/opt/airflow/generated"),
("go-sdk", "/opt/airflow/go-sdk"),
("helm-tests", "/opt/airflow/helm-tests"),
("kubernetes-tests", "/opt/airflow/kubernetes-tests"),
("logs", "/root/airflow/logs"),
("providers", "/opt/airflow/providers"),
Expand Down
4 changes: 2 additions & 2 deletions dev/breeze/src/airflow_breeze/utils/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def are_all_test_paths_excluded(
GroupOfTests.PROVIDERS: ALL_PROVIDER_TEST_FOLDERS,
GroupOfTests.TASK_SDK: ["task-sdk/tests"],
GroupOfTests.CTL: ["airflow-ctl/tests"],
GroupOfTests.HELM: ["helm-tests"],
GroupOfTests.HELM: ["chart/tests"],
GroupOfTests.INTEGRATION_CORE: ["airflow-core/tests/integration"],
GroupOfTests.INTEGRATION_PROVIDERS: ALL_PROVIDER_INTEGRATION_TEST_FOLDERS,
GroupOfTests.PYTHON_API_CLIENT: ["clients/python"],
Expand Down Expand Up @@ -398,7 +398,7 @@ def convert_test_type_to_pytest_args(
sys.exit(1)
helm_folder = TEST_GROUP_TO_TEST_FOLDERS[test_group][0]
if test_type and test_type != ALL_TEST_TYPE:
return [f"{helm_folder}/tests/helm_tests/{test_type}"]
return [f"{helm_folder}/helm_tests/{test_type}"]
return [helm_folder]
if test_type == SelectiveCoreTestType.OTHER.value and test_group == GroupOfTests.CORE:
return find_all_other_tests()
Expand Down
5 changes: 2 additions & 3 deletions dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def __hash__(self):
r"^chart",
r"^airflow-core/src/airflow/kubernetes",
r"^airflow-core/tests/unit/kubernetes",
r"^helm-tests",
],
FileGroupForCi.DOC_FILES: [
r"^docs",
Expand Down Expand Up @@ -303,7 +302,7 @@ def __hash__(self):
r"^scripts/.*\.py$",
],
FileGroupForCi.ALL_HELM_TESTS_PYTHON_FILES: [
r"^helm-tests/.*\.py$",
r"^chart/tests/.*\.py$",
],
FileGroupForCi.ALL_AIRFLOW_E2E_TESTS_PYTHON_FILES: [
r"^airflow-e2e-tests/.*\.py$",
Expand All @@ -328,7 +327,7 @@ def __hash__(self):
r"^task-sdk/tests/.*",
r"^devel-common/src/.*",
r"^devel-common/tests/.*",
r"^helm-tests/tests/.*",
r"^chart/tests/.*",
r"^kubernetes-tests/tests/.*",
r"^docker-tests/tests/.*",
],
Expand Down
6 changes: 3 additions & 3 deletions dev/breeze/tests/test_pytest_args_for_test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ def _find_all_integration_folders() -> list[str]:
(
GroupOfTests.HELM,
"All",
["helm-tests"],
["chart/tests"],
),
(
GroupOfTests.HELM,
"airflow_aux",
["helm-tests/tests/helm_tests/airflow_aux"],
["chart/tests/helm_tests/airflow_aux"],
),
],
)
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_pytest_args_for_missing_provider():
GroupOfTests.HELM,
"All",
[
"helm-tests",
"chart/tests",
],
),
(
Expand Down
6 changes: 3 additions & 3 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2623,7 +2623,7 @@ def test_docs_filter(files: tuple[str, ...], expected_outputs: dict[str, str]):
("files", "expected_outputs"),
[
pytest.param(
("helm-tests/tests/helm_tests/random_helm_test.py",),
("chart/tests/helm_tests/random_helm_test.py",),
{
"ci-image-build": "true",
"prod-image-build": "true",
Expand Down Expand Up @@ -3700,15 +3700,15 @@ def side_effect(*args, **kwargs):
("files", "pr_labels", "expected_outputs"),
[
pytest.param(
("helm-tests/tests/helm_tests/random_helm_test.py",),
("chart/tests/helm_tests/random_helm_test.py",),
(),
{
"helm-test-kubernetes-versions": DEFAULT_HELM_K8S_VERSIONS_JSON,
},
id="Default K8s version when no all-versions label",
),
pytest.param(
("helm-tests/tests/helm_tests/random_helm_test.py",),
("chart/tests/helm_tests/random_helm_test.py",),
("all versions",),
{
"helm-test-kubernetes-versions": ALL_HELM_K8S_VERSIONS_JSON,
Expand Down
2 changes: 1 addition & 1 deletion dev/ide_setup/setup_idea.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"dev/breeze",
"docker-tests",
"kubernetes-tests",
"helm-tests",
"chart/tests",
"scripts",
"task-sdk-integration-tests",
]
Expand Down
2 changes: 1 addition & 1 deletion dev/update_github_branch_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def update_dependabot(new_branch: str, prev_branch: str, new_dash: str) -> None:
- /dev/breeze
- /docker-tests
- /kubernetes-tests
- /helm-tests
- /chart
- /task-sdk
- /
schedule:
Expand Down
1 change: 0 additions & 1 deletion helm-tests/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions helm-tests/.pre-commit-config.yaml

This file was deleted.

Loading
Loading