Muawiya-contact opened a new pull request, #336:
URL: https://github.com/apache/hugegraph-ai/pull/336
<html>
<body>
<!--StartFragment--><html><head></head><body><h2>What this PR does</h2>
<p>Fixes the silent-skip anti-pattern in <code>test_gremlin.py</code> —
previously,
if the Gremlin endpoint was down, all 6 tests would silently show as
<strong>SKIPPED</strong> in CI instead of <strong>FAILED</strong>, hiding
real regressions.</p>
<p>Fixes #327 · Related: #325, #320</p>
<hr>
<h2>The problem</h2>
<pre><code class="language-python"># OLD — bad
except (ConnectionError, Timeout, HTTPError):
raise unittest.SkipTest("Gremlin endpoint unavailable") # hides
failures!
</code></pre>
<p>Any connectivity issue would silently swallow failures and mark tests
as skipped. A broken endpoint would look green in CI. Not good.</p>
<hr>
<h2>The fix</h2>
<ul>
<li>Removed the automatic connectivity probe from
<code>setUpClass</code></li>
<li>Failures now surface as <strong>FAILED</strong>, not SKIPPED</li>
<li>Added an explicit opt-in skip via env var for local dev:</li>
</ul>
<pre><code class="language-bash"># want to skip? opt in explicitly
export SKIP_GREMLIN_TESTS=true
</code></pre>
<hr>
<h2>Running locally</h2>
<pre><code class="language-bash"># start HugeGraph
docker run -d --name hugegraph -p 8080:8080 hugegraph/hugegraph:latest
# wait ~30s, then run
python -m pytest src/tests/api/test_gremlin.py -v
# cleanup
docker stop hugegraph && docker rm hugegraph
</code></pre>
<hr>
<h2>Test results</h2>
Scenario | Expected | ✓
-- | -- | --
No endpoint | FAILED | ✅
SKIP_GREMLIN_TESTS=true | SKIPPED | ✅
Env var unset | FAILED | ✅
TestGremlinSetupBehavior unit tests | PASSED | ✅
<hr>
<h2>Files changed</h2>
<p>Only one file touched:
<code>hugegraph-python-client/src/tests/api/test_gremlin.py</code></p></body></html><!--EndFragment-->
</body>
</html>
--
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]