slfan1989 commented on code in PR #7016:
URL: https://github.com/apache/ozone/pull/7016#discussion_r1767948287


##########
hadoop-ozone/dist/src/main/smoketest/omha/om-roles.robot:
##########
@@ -28,6 +28,9 @@ Assert Leader Present in JSON
      [Arguments]                     ${output}
      ${leader} =                     Execute                        echo 
'${output}' | jq '.[] | select(.[] | .serverRole == "LEADER")'
                                      Should Not Be Equal            ${leader}  
     ${EMPTY}
+Assert Leader Present in TABLE
+     [Arguments]                     ${output}
+     Should Match Regexp             ${output}                     
\|\s+om\d+\s+\|\s+LEADER\s+\|

Review Comment:
   > om host is a user-defined string and does not necessarily start with om, 
right ?
   
   This regex matches strings containing "om" followed by digits, specifically 
formatted with "LEADER" surrounded by pipe delimiters. 
   
   
![image](https://github.com/user-attachments/assets/f9197b0f-7ee7-408c-af05-fc11411e3a8a)
   
   If we replace it with other characters (like "scm"), it should not match.
   
   
![image](https://github.com/user-attachments/assets/b89ef916-849a-499c-bd9f-907925f2e891)
   
   > NIT: string don't look aligned.
   
   This should be fixed, and I will modify the format issue.
   
   > I verified this RE, and it seems that any format will pass. So, this RE 
looks like it needs to be changed.
   You can install robot in python and execute it locally:
   
   Sorry, I don't think there's an issue with this regex. The test cases you 
provided cannot be reproduced. 
   
   > Test1 regex test
   
   The regex validation indicates that, based on the provided example, it 
cannot match the regex.
   
   
![image](https://github.com/user-attachments/assets/73dc9a49-a3b1-4952-9e8f-72b64dbcb064)
   
   > Test2 run robot
   
   I think we need to check the run logs to confirm the actual results. This 
`PASS` seems to only indicate that the commands were executed.
   
   ```
   <kw name="Assert Leader Present in TABLE">
   <kw name="Should Match Regexp" owner="BuiltIn">
   <arg>${output}</arg>
   <arg>\|\s+om\d+\s+\|\s+LEADER\s+\|</arg>
   <doc>Fails if ``string`` does not match ``pattern`` as a regular 
expression.</doc>
   <status status="PASS" start="2024-09-20T12:45:34.410032" elapsed="0.000097"/>
   </kw>
   
   ```
   
   
![image](https://github.com/user-attachments/assets/f6181c9a-70a0-40db-a33f-3f1350fc3091)
   
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to