Chuyển đến nội dung
Skillpedia
Kiểm thử12k · #11497

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-component-integration-test/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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 events
  • assert_event() / assert_telemetry() — verify component output
  • get_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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự