RyukR1 opened a new pull request, #77083: URL: https://github.com/apache/airflow/pull/77083
Add unit test coverage for three `cncf.kubernetes` provider modules that were listed in the `OVERLOOKED_TESTS` allowlist in `test_project_structure.py`. Removes all three entries from the allowlist now that the test modules exist. ### `test_exceptions.py` Covers all four exception classes (`PodMutationHookException`, `PodReconciliationError`, `KubernetesApiError`, `KubernetesApiPermissionError`): - Each is a subclass of `AirflowException` and can be caught as such - Messages are preserved on raise - Each class is a distinct type ### `test_kube_config.py` Covers `KubeConfig.__init__` configuration loading: - Basic attribute initialisation (image, namespace, parallelism) - `kube_image` is `None` when `worker_container_repository` or `worker_container_tag` is absent - `worker_pod_pending_fatal_container_state_reasons` parsing and whitespace stripping - `multi_namespace_mode` with and without an explicit namespace list - `kube_client_request_args`: valid dict accepted; `list`→`tuple` coercion for `_request_timeout`; non-dict raises `AirflowConfigException` - `delete_option_kwargs`: valid dict accepted; non-dict raises `AirflowConfigException` - `executor_conf` forwarding vs. global-conf fallback - `executor_namespace` defaults to `"default"` when the config value is empty - `async_pod_creation` and `pod_creation_max_concurrency` flags ### `test_kubernetes_executor_utils.py` Covers utility functions and the watcher's event-processing logic: - `ResourceVersion` singleton identity and shared dict state - `KubernetesJobWatcher.process_error`: HTTP 410 returns `"0"`; other codes raise `AirflowException` - `KubernetesJobWatcher.process_status`: revoked pods ignored; deleted-without-timestamp → `ADOPTED`; `Succeeded` → `None` state; `Failed` → `FAILED`; running pod deleted with timestamp → `FAILED`; `ProviderFailed` → `FAILED`; pending with fatal container reason → `FAILED`; `ErrImagePull` with "pull QPS exceeded" message is explicitly skipped - `collect_pod_failure_details`: non-failed pod returns `None`; init-container failure takes priority over main; waiting state captured; completed container (exit 0) not flagged as failure - `_analyze_containers`: `None`/empty list → `None`; nonzero exit code returned; zero exit not flagged; waiting state returned when no terminated container; terminated takes priority over waiting - `get_base_pod_from_template`: uses provided template file path; falls back to `kube_config.pod_template_file` when `None` or empty string is given --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Antigravity (Google DeepMind) Generated-by: Antigravity (Google DeepMind) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
