Muawiya-contact opened a new issue, #326:
URL: https://github.com/apache/hugegraph-ai/issues/326

   ### Bug Type (问题类型)
   
   None
   
   ### Before submit
   
   - [x] I had searched in the 
[issues](https://github.com/apache/hugegraph-ai/issues) and found no similar 
issues.
   
   ### Environment (环境信息)
   
   
   
   ## Environment
   
   | Item | Detail |
   |---|---|
   | HugeGraph Server | 1.7.0 |
   | Module | `python-client` |
   | File | `hugegraph-python-client/src/tests/test_metric.py` |
   
   
   
   
   ### Expected & Actual behavior (期望与实际表现)
   
   ---
   
   ## Expected & Actual Behavior
   
   ### Problem
   
   `test_metrics_operations` (L78–79) contains an `if "hugegraph" in 
backend_metrics:` guard that effectively **no-ops** the backend metrics 
assertion when running against HugeGraph 1.7.0.
   
   This means shape drift in the API response goes completely undetected — the 
test passes silently even if the backend metrics structure changes.
   
   ### Expected
   The test should pin the **actual 1.7.0 response shape** and assert against 
it deterministically. Any deviation from the known shape should surface as a 
test failure.
   
   ### Actual
   The guard short-circuits the assertion. On HugeGraph 1.7.0, the block inside 
the `if` is never entered, so the backend metrics structure is never validated.
   
   ---
   ## Suggested Fix
   
   1. Document the actual `backend_metrics` response shape returned by 
HugeGraph 1.7.0.
   2. Replace the open-ended guard with a **version-gated deterministic 
assertion** — e.g.:
   
   ```python
   # Before (no-op guard)
   if "hugegraph" in backend_metrics:
       assert ...
   
   # After (strict, version-aware assertion)
   assert "hugegraph" in backend_metrics, (
       f"Expected 'hugegraph' key in backend_metrics, got: 
{list(backend_metrics.keys())}"
   )
   assert backend_metrics["hugegraph"] == EXPECTED_SHAPE_1_7_0
   ```
   
   ### Vertex/Edge example (问题点 / 边数据举例)
   
   ```javascript
   
   ```
   
   ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
   
   ```javascript
   
   ```


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

Reply via email to