Sonins commented on a change in pull request #17428:
URL: https://github.com/apache/airflow/pull/17428#discussion_r685708706



##########
File path: chart/tests/test_elasticsearch_secret.py
##########
@@ -96,3 +96,24 @@ def 
test_should_correctly_handle_password_with_special_characters(self):
             
"http://username%21%40%23$%25%25%5E&%2A%28%29:password%21%40%23$%25%25%5E&%2A%28%29@";
             "elastichostname:80" == connection
         )
+
+    def test_should_generate_secret_with_specified_port(self):
+        connection = self._get_connection(
+            {
+                "elasticsearch": {
+                    "enabled": True,
+                    "connection": {
+                        "user": "username!@#$%%^&*()",
+                        "pass": "password!@#$%%^&*()",
+                        "host": "elastichostname",
+                        "port": 9200,
+                    },
+                }
+            }
+        )
+
+        assert (
+            
"http://username%21%40%23$%25%25%5E&%2A%28%29:password%21%40%23$%25%25%5E&%2A%28%29@";
+            "elastichostname:9200" == connection
+        )

Review comment:
       OK, It turns out there is a little problem.
   Without user and pass field, `<no+value>` is included in url string, like 
this.
   `http://<no+value>:<no+value>@elastichostname:2222`
   
   It makes test fail.
   
   
![image](https://user-images.githubusercontent.com/26663842/128814721-114465cc-92aa-4b02-9c58-195c33d3aeed.png)
   
   My mistake, I should've tested for this before i committed it, sorry.
   
   For now I can think 2 options.
   
   1. Insert simple username and pass into test function.
   2. Fix something that makes user and pass in url string <no+value>, use 
username something like 'root', instead.




-- 
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: commits-unsubscr...@airflow.apache.org

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


Reply via email to