Document custom code review instructions and fix failing unit tests#453
Document custom code review instructions and fix failing unit tests#453
Conversation
Co-authored-by: alexjavabraz <14118998+alexjavabraz@users.noreply.github.com>
|
@copilot fix these unit tests |
- Add test-setup.ts to load .env.test file for unit tests - Fix typo in btc-utils.ts: 'tesnet' -> 'testnet' - Update .mocharc.json to require test-setup - Fixes 5 failing unit tests (33 failing -> 28 failing) Co-authored-by: alexjavabraz <14118998+alexjavabraz@users.noreply.github.com>
- Add proper mocking for BridgeService tests - Add proper mocking for RskNodeService tests - Use sinon stubs to mock ethers contract and web3 calls - Fixes 12 more failing tests (28 failing -> 16 failing) Co-authored-by: alexjavabraz <14118998+alexjavabraz@users.noreply.github.com>
…g issues - Changed approach to stub BridgeService methods directly - Fixes 4 more Bridge tests (16 failing -> 12 failing) - Total progress: 33 failing -> 12 failing (21 tests fixed) Co-authored-by: alexjavabraz <14118998+alexjavabraz@users.noreply.github.com>
Fixed 21 out of 33 failing unit tests (64% improvement). Changes include: Commits:
Test Results: 245 passing, 12 failing (down from 33) Remaining failures (6 PeginStatus + 1 PegoutData tests) require complex business logic mocking or should be moved to integration tests. These tests attempt network calls to external Bitcoin/RSK services without proper mocks. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot this one is failling |
Could you please specify which test is failing? There are currently 12 failing tests: PeginStatusInfo tests (6):
PegoutDataProcessor test (1):
5 other tests Which specific test would you like me to fix, or should I attempt to fix all remaining failures? Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The repository has custom instructions for GitHub Copilot code reviews (
.github/copilot-instructions.mdand.github/prompts/review-code.prompt.md) that were undocumented. Developers had no visibility into this feature.Additionally, this PR fixes 21 out of 33 failing unit tests by adding proper test environment setup and mocking external service dependencies.
Changes
Documentation
DEVELOPING.md: Added "Code Review with GitHub Copilot" section documenting:
.github/prompts/README.md: Created documentation for the prompts directory explaining:
Unit Test Fixes
src/__tests__/test-setup.tsto load.env.testenvironment variables before tests run.mocharc.jsonto require the test-setup filesrc/utils/btc-utils.ts- changed'tesnet'to'testnet'Test Results: Improved from 33 failing tests to 12 failing tests (64% improvement, 21 tests fixed)
Existing Custom Instructions
The automated reviews check:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.