gmsantos commented on code in PR #23711: URL: https://github.com/apache/airflow/pull/23711#discussion_r873084653
########## tests/charts/test_dag_processor.py: ########## @@ -0,0 +1,431 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import unittest + +import jmespath +from parameterized import parameterized + +from tests.charts.helm_template_generator import render_chart + + +class DagProcessorTest(unittest.TestCase): + @parameterized.expand( + [ + ("2.2.0", 0), + ("2.3.0", 1), + ] + ) + def test_only_exists_on_new_airflow_versions(self, airflow_version, num_docs): + """Standalone Dag Processor was only added from Airflow 2.3 onwards""" + docs = render_chart( + values={ + "airflowVersion": airflow_version, + "dagProcessor": {"enabled": True}, + }, + show_only=["templates/dagprocessor/dag-processor-deployment.yaml"], + ) + + assert num_docs == len(docs) + + def test_can_be_disabled(self): + """ + Standalone Dag Processor is disabled by default. + """ + docs = render_chart( + values={"dagProcessor": {"enabled": False}}, + show_only=["templates/dagprocessor/dag-processor-deployment.yaml"], + ) + + assert 0 == len(docs) + + def test_disable_wait_for_migration(self): + docs = render_chart( + values={ + "dagProcessor": { + "enabled": True, Review Comment: Same here, if we enable dagProcessor by default, we can remove it from the test values -- 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]
