bito-code-review[bot] commented on code in PR #42219:
URL: https://github.com/apache/superset/pull/42219#discussion_r3610967065


##########
helm/superset/tests/httproute_test.yaml:
##########
@@ -0,0 +1,90 @@
+#
+# 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.
+#
+suite: HTTPRoute
+templates:
+  - httproute.yaml
+tests:
+  - it: routes the general Superset path
+    set:
+      httproute.enabled: true
+    asserts:
+      - lengthEqual:
+          path: spec.rules
+          count: 1
+      - equal:
+          path: spec.rules[0].backendRefs[0].name
+          value: RELEASE-NAME-superset
+      - equal:
+          path: spec.rules[0].backendRefs[0].port
+          value: 8088
+      - equal:
+          path: spec.rules[0].matches[0].path.value
+          value: /
+
+  - it: routes the WebSocket path when WebSockets are enabled
+    set:
+      httproute.enabled: true
+      supersetWebsockets.enabled: true
+    asserts:
+      - lengthEqual:
+          path: spec.rules
+          count: 2
+      - equal:
+          path: spec.rules[1].backendRefs[0].name
+          value: RELEASE-NAME-superset-ws
+      - equal:
+          path: spec.rules[1].backendRefs[0].port
+          value: 8080
+      - equal:
+          path: spec.rules[1].matches[0].path.value
+          value: /ws
+
+  - it: does not route the WebSocket path when WebSockets are disabled
+    set:
+      httproute.enabled: true
+      supersetWebsockets.enabled: false
+    asserts:
+      - lengthEqual:
+          path: spec.rules
+          count: 1
+
+  - it: routes the MCP path when MCP HTTPRoute is enabled
+    set:
+      httproute.enabled: true
+      supersetMcp.enabled: true
+      supersetMcp.httproute.enabled: true
+    asserts:
+      - equal:
+          path: spec.rules[1].backendRefs[0].name
+          value: RELEASE-NAME-superset-mcp
+      - equal:
+          path: spec.rules[1].backendRefs[0].port
+          value: 5008
+      - equal:
+          path: spec.rules[1].matches[0].path.value
+          value: /mcp

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing rule count assertion</b></div>
   <div id="fix">
   
   The MCP test lacks a rule count assertion. Without it, the test passes even 
if unexpected extra rules exist. This test should mirror the pattern used in 
the WebSocket test (lines 43-45) which explicitly asserts `count: 2`.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #fb94a9</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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