Fiber test skill#22
Conversation
Merge pull request #15 from gpBlockchain/oneway_channel
There was a problem hiding this comment.
Pull request overview
Expands the Fiber devnet Python integration test suite around trampoline routing and one-way channel behavior, and adds a .cursor “fiber-test” skill/reference pack to document testing patterns and APIs.
Changes:
- Refactors and significantly extends
trampoline_routingtests to cover invoice/keysend trampoline flows plus several failure cases. - Enhances
one_waychannel tests with stricter negative assertions, restart behavior coverage, and shutdown scenarios. - Removes an obsolete/placeholder accept-channel test file and adds
.cursor/skills/fiber-test/*reference documentation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
test_cases/fiber/devnet/trampoline_routing/test_allowTramponlieRouting.py |
Adds topology helpers and multiple trampoline routing success/failure tests (invoice + keysend). |
test_cases/fiber/devnet/one_way/test_oneway_channel.py |
Improves one-way channel test coverage (directionality, middle-hop failure, shutdown, restart). |
test_cases/fiber/devnet/accept_channel/test_accept_channel.py |
Deletes unused commented-out placeholder content. |
.cursor/skills/fiber-test/references/test-patterns.md |
Adds a test pattern reference for common integration-test flows. |
.cursor/skills/fiber-test/references/lightning-concepts.md |
Adds Fiber↔Lightning conceptual mapping reference. |
.cursor/skills/fiber-test/references/gap-analysis.md |
Adds a detailed test coverage gap analysis document. |
.cursor/skills/fiber-test/references/api-reference.md |
Adds a summarized Fiber RPC API reference for tests. |
.cursor/skills/fiber-test/SKILL.md |
Adds the Cursor “fiber-test” skill definition and quick-start guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try: | ||
| self.wait_payment_state(self.fiber1, payment["payment_hash"], "Success") | ||
| except Exception as e: | ||
| pytest.xfail( | ||
| "pending fix: receiver should validate preimage using invoice hash_algorithm " | ||
| f"(sha256), error={str(e)}" | ||
| ) | ||
|
|
There was a problem hiding this comment.
The xfail here triggers on any exception from wait_payment_state, which can mask unrelated failures (infra flakiness, routing bugs, RPC timeouts) as an expected failure. Consider marking the test with @pytest.mark.xfail (optionally strict=True) for the known bug, or only calling pytest.xfail when the exception matches the specific known error; otherwise re-raise so unexpected failures still fail the test.
| def test_trampoline_multi_hops_keysend_success(self): | ||
| self._wait_indexer_synced() | ||
| self.fiber3 = self.start_new_fiber(self._generate_account_with_retry(1000)) | ||
| self.fiber3.connect_peer(self.fiber2) | ||
| self.fiber4 = self.start_new_fiber(self._generate_account_with_retry(1000)) | ||
| self.fiber4.connect_peer(self.fiber3) | ||
|
|
There was a problem hiding this comment.
The topology setup in this test (starting fiber3/fiber4, connecting peers, opening 3 channels, waiting for graph sync) is duplicated again in test_trampoline_max_fee_amount_too_low_should_fail. Extracting a shared helper (similar to _build_tr001_topology) would reduce maintenance cost and make future topology tweaks less error-prone.
| time.sleep(interval) | ||
| continue | ||
| raise | ||
| raise last_error |
There was a problem hiding this comment.
Illegal class 'NoneType' raised; will result in a TypeError being raised instead.
| raise last_error | |
| if last_error is not None: | |
| raise last_error | |
| raise TimeoutError(f"failed to generate account after {retries} retries") |
No description provided.