You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/12/01 18:42:11 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #12743: Create HostnameCallableRule to ease upgrade to Airflow 2.0

mik-laj commented on a change in pull request #12743:
URL: https://github.com/apache/airflow/pull/12743#discussion_r533638924



##########
File path: tests/upgrade/rules/test_hostname_callable_rule.py
##########
@@ -0,0 +1,36 @@
+# 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.
+from unittest import TestCase
+
+from airflow.upgrade.rules.hostname_callable_rule import HostnameCallable
+from tests.test_utils.config import conf_vars
+
+
+class TestFernetEnabledRule(TestCase):
+    @conf_vars({("core", "hostname_callable"): "dummyhostname:function"})
+    def test_incorrect_hostname(self):
+        result = HostnameCallable().check()
+        self.assertEqual(
+            result,
+            "Error: hostname_callable dummyhostname:function "
+            "contains a colon instead of a dot. please change to dummyhostname.function",
+        )
+
+    @conf_vars({("core", "hostname_callable"): "dummyhostname.function"})

Review comment:
       Is this the correct value for Airflow 1.10? I imagine that we are able to ensure compatibility between the new and the old value at the same time. This will facilitate migrations as users will not have to change everything in one step, but they will be able to fix and test each value step by step.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org