Skip to content

Add ckb test skills - #115

Open
Xcodes-chain wants to merge 2 commits into
mainfrom
ckb-test-skills
Open

Add ckb test skills#115
Xcodes-chain wants to merge 2 commits into
mainfrom
ckb-test-skills

Conversation

@Xcodes-chain

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Cursor “ckb-test” skill and accompanying reference documentation intended to describe the Python integration test framework in this repo and a Rust integration test framework (described as ckb/test/).

Changes:

  • Added .cursor/skills/ckb-test/SKILL.md to describe testing domains, repo layout, and common patterns.
  • Added Python framework architecture reference doc under .cursor/skills/ckb-test/references/.
  • Added Rust test framework reference doc under .cursor/skills/ckb-test/references/.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
.cursor/skills/ckb-test/SKILL.md New skill overview, directory map, and reference links for CKB testing.
.cursor/skills/ckb-test/references/framework-architecture.md New reference describing Python framework components (CkbNode, RPCClient, helpers).
.cursor/skills/ckb-test/references/rust-test-framework.md New reference describing a Rust-based integration test framework and runner model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

client.dry_run_transaction(tx)
client.get_live_cell(out_point, with_data=True)
client.get_consensus()
client.get_fee_rate_statistics(target=None)

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RPCClient method name here is listed as get_fee_rate_statistics, but the current implementation is get_fee_rate_statics (no matches for get_fee_rate_statistics in framework/). Update the documentation to the correct method name (or rename the implementation, but that’s outside this PR).

Suggested change
client.get_fee_rate_statistics(target=None)
client.get_fee_rate_statics(target=None)

Copilot uses AI. Check for mistakes.
3. Filter specs by name pattern
4. Spawn N worker threads
5. Each worker pulls specs from shared queue
6. Workers report results via channels (`Notify::Start/Done/Error/Panick`)

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in event name: Panick should be Panic (or whatever the actual enum variant is). As written, it reads like a misspelling and makes it harder to search/grep the code.

Suggested change
6. Workers report results via channels (`Notify::Start/Done/Error/Panick`)
6. Workers report results via channels (`Notify::Start/Done/Error/Panic`)

Copilot uses AI. Check for mistakes.

## Overview

Located at `ckb/test/`, the Rust test framework provides lower-level testing with P2P protocol simulation. Tests run against real CKB node processes with fine-grained control over block construction, network messages, and chain state.

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document describes a Rust test framework located at ckb/test/, but there is no ckb/ directory in this repository. Consider adding a pointer to where that framework actually lives (e.g., upstream CKB repo) or when/how it is obtained, to avoid implying it’s part of this codebase.

Suggested change
Located at `ckb/test/`, the Rust test framework provides lower-level testing with P2P protocol simulation. Tests run against real CKB node processes with fine-grained control over block construction, network messages, and chain state.
In the upstream CKB repository (https://github.com/nervosnetwork/ckb), the Rust test framework lives under the `test/` directory and provides lower-level testing with P2P protocol simulation. Tests run against real CKB node processes with fine-grained control over block construction, network messages, and chain state. This framework is referenced by, but not contained in, this repository.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
---
name: ckb-test
description: Comprehensive CKB blockchain integration test skill covering both Python (pytest) and Rust test frameworks. Use when writing, reviewing, debugging, or extending CKB integration tests, transaction pool tests, RPC tests, mining tests, P2P sync tests, DAO tests, hardfork tests, contract tests, or any CKB node behavior tests. Also use when asked about CKB testing patterns, framework architecture, or Bitcoin Core design parallels in the CKB context.
---

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title indicates updating CKB to 0.204.0 and macOS support to 15, but the diff only adds Cursor skill/reference markdown files. If the version/macOS changes are in another PR, consider retitling this PR; otherwise the actual upgrade changes appear to be missing from this PR.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +15
1. **Python integration tests** (`test_cases/`) -- high-level end-to-end tests using pytest
2. **Rust integration tests** (`ckb/test/`) -- lower-level node behavior tests with P2P simulation

Both mirror Bitcoin Core's functional test design: spawn real node processes, interact via RPC, verify blockchain state.

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skill doc claims the repo contains Rust integration tests under ckb/test/, but there is no ckb/ directory in this repository. Consider clarifying that the Rust framework lives in the upstream CKB repo (or is fetched/generated during make prepare) to avoid misleading readers.

Suggested change
1. **Python integration tests** (`test_cases/`) -- high-level end-to-end tests using pytest
2. **Rust integration tests** (`ckb/test/`) -- lower-level node behavior tests with P2P simulation
Both mirror Bitcoin Core's functional test design: spawn real node processes, interact via RPC, verify blockchain state.
1. **Python integration tests** (`test_cases/` in this repo) -- high-level end-to-end tests using pytest
2. **Rust integration tests** (in the upstream CKB repo, e.g. under `test/`, typically fetched/prepared via `make prepare`) -- lower-level node behavior tests with P2P simulation
Both test layers mirror Bitcoin Core's functional test design: spawn real node processes, interact via RPC, verify blockchain state.

Copilot uses AI. Check for mistakes.
Comment on lines +202 to +207
## Additional References

- **Framework architecture**: [references/framework-architecture.md](references/framework-architecture.md)
- **Common test patterns**: [references/test-patterns.md](references/test-patterns.md)
- **Rust test framework**: [references/rust-test-framework.md](references/rust-test-framework.md)
- **Bitcoin Core comparison**: [references/bitcoin-core-comparison.md](references/bitcoin-core-comparison.md)

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Additional References" section links to references/test-patterns.md and references/bitcoin-core-comparison.md, but those files are not present under .cursor/skills/ckb-test/references/. Add the missing reference files or remove/update the links so they don’t 404.

Copilot uses AI. Check for mistakes.
client = node.getClient()

# Chain RPCs
client.get_tip_block_number() # Returns hex string

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc says client.get_tip_block_number() returns a hex string, but in framework/rpc.py it returns an int (it converts from hex via int(..., 16)). Update this return type note to match actual behavior, otherwise test authors may double-convert or compare against the wrong type.

Suggested change
client.get_tip_block_number() # Returns hex string
client.get_tip_block_number() # Returns int block number

Copilot uses AI. Check for mistakes.
@Xcodes-chain Xcodes-chain changed the title Update ckb to version 0.204.0 and upgrade macOS support to version 15 Add ckb test skills Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants