fprime-component-integration-test
Skill này làm gì
Skill hướng dẫn AI viết kiểm thử tích hợp gửi lệnh và kiểm tra sự kiện, telemetry qua hệ thống mặt đất. Dành cho kỹ sư kiểm thử thành phần F Prime.
Khi nào nên dùng
- ✓Khi các kiểm thử đơn vị đã đạt và một thành phần F Prime cần kiểm thử tích hợp.
- ✓Khi bạn muốn có các bài kiểm thử gửi lệnh đến một triển khai F Prime đang chạy.
- ✓Khi bạn cần kiểm tra sự kiện và telemetry của một thành phần trong hệ thống đang hoạt động.
Liên kết skill
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-integration-test/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể viết các kiểm thử tích hợp pytest gửi lệnh và kiểm tra sự kiện cho thành phần F Prime này không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI tạo file kiểm thử trong thư mục thành phần, dùng API kiểm thử của hệ thống mặt đất để gửi lệnh và đọc sự kiện, telemetry, rồi chạy các bài kiểm thử.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Skill: F Prime Reusable Component Integration Testing
Reusable integration tests live in the component's own
test/int/ folder and verify that the component works correctly
in a running deployment. They exercise the component through the
Ground Data System (GDS) — sending commands, checking events, and
reading telemetry over the actual communication stack.
For the full implementation guide, see Reusable Integration Tests. For the complete API reference (send commands, assert events/telemetry, predicates, histories), see the GDS Integration Test API Guide.
Note: This skill covers component-level reusable integration tests. System-wide integration tests (testing cross-component workflows across an entire deployment) are a separate concern.
Prerequisites
The component must be added to a topology before integration tests
can run. If it has not been integrated yet, see
docs/user-manual/overview/development-practice.md § "Assemble
Topology".
The deployment must be running (via fprime-gds) for integration
tests to execute.
Process
Step 1 — Set Up Test Directory
Create test/int/test_<ComponentName>.py in the component folder.
See
Reusable Integration Tests
for the expected file layout and int_config.json configuration.
Step 2 — Write Reusable Tests
Tests use pytest with the fprime_test_api fixture. Use
fprime_test_api.get_mnemonic() to resolve instance names from a
configuration file, making tests portable across deployments. See the
GDS Test API Guide
for the full API (sending commands, asserting events/telemetry,
predicates, sequences).
Key patterns:
send_and_assert_command()— send + verify command success eventsassert_event()/assert_telemetry()— verify component outputget_mnemonic()— resolve qualified names for portability- Map each test to a requirement in the docstring (
Covers: REQ-*)
Step 3 — Draft Requirements Coverage
Draft which requirements should be covered by integration tests. Aim for reasonable coverage of the component's requirements, especially those that exercise inter-component behavior.
Step 4 — Run Integration Tests
# Start the deployment + GDS (in separate terminal)
fprime-gds --dictionary <path-to-dictionary>
# Run the component's reusable tests against a deployment
pytest <Component>/test/int/ \
--dictionary <path-to-dictionary> \
--deployment-config <path>/int_config.json
See Reusable Integration Tests § Running the tests
for CI integration using fprime-actions/run-integration-tests.
Anti-Patterns
- Hardcoding instance mnemonics — use
get_mnemonic()for portability - Writing tests that depend on test execution order
- Ignoring
max_delay/timeout(tests will hang or be flaky) - Not mapping tests to requirements
- Testing unit-level behavior in integration tests (use unit tests for that)
Câu hỏi thường gặp
Các bài kiểm thử có cần hệ thống đang chạy không?
Có. Triển khai phải đang chạy qua hệ thống dữ liệu mặt đất trước khi các bài kiểm thử được thực thi.
Các bài kiểm thử này có bao quát toàn bộ luồng hệ thống không?
Không. Chúng chỉ kiểm tra một thành phần, còn kiểm thử toàn hệ thống là một chủ đề riêng.
Các bài kiểm thử nằm ở đâu?
Chúng nằm trong thư mục test/int của thành phần, nên bất kỳ triển khai nào có chứa thành phần đều có thể chạy chúng.
Chi tiết
Mô tả gốc của tác giả
Integration testing phase of F Prime component development. Guides the agent through writing reusable pytest-based integration tests in the component's test/int/ folder using the GDS Integration Test API. These tests ship with the component and can be run against any deployment that includes it. Trigger when unit tests pass and the component is ready for integration testing. Keywords: F Prime, integration test, pytest, GDS, fprime_test_api, reusable test, component test.
repo: nasa/fprime
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11497
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
fprime-cmake-build-system
12kGiúp agent của bạn thêm module, build target và cài đặt nền tảng vào dự án phần mềm bay F Prime thông qua lớp CMake của nó.
fprime-component-design-fpp
12kGiúp agent của bạn chuyển các yêu cầu thành phần F Prime đã được duyệt thành mô hình FPP cho các port, lệnh, sự kiện và telemetry.
fprime-component-development
12kGiúp agent của bạn hướng dẫn một thành phần F Prime qua từng giai đoạn phát triển, từ yêu cầu đến kiểm thử tích hợp.
fprime-component-implementation
12kGiúp agent của bạn viết mã C++ phía sau các hàm xử lý được sinh tự động của một thành phần F Prime, theo đúng quy tắc của dự án.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.