Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Trình lập lịch lệnh kiểm thử
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trong Tradefed, mọi yêu cầu kiểm thử đều phải thông qua Trình lập lịch biểu lệnh để chạy. Vì vậy, Trình lập lịch biểu lệnh là một thành phần chính của bộ điều khiển cần thiết để chạy kiểm thử.
Vòng đời
Khi một yêu cầu kiểm thử được đưa ra cho Tradefed (ví dụ: dữ liệu đầu vào từ bảng điều khiển), yêu cầu đó sẽ trải qua các sự kiện sau trước khi chạy:
- Yêu cầu kiểm thử được phân tích cú pháp – Yêu cầu kiểm thử thường bao gồm một tham chiếu cấu hình Tradefed XML, theo sau là các tuỳ chọn.
Ví dụ:
> run host --class com.android.tradefed.build.BuildInfoTest
- Trình quản lý thiết bị được yêu cầu cho(các) thiết bị khớp với yêu cầu kiểm thử – Trình quản lý thiết bị phân bổ một thiết bị khớp với yêu cầu kiểm thử. Ví dụ: nếu bạn yêu cầu một thiết bị Pixel, thì Trình quản lý thiết bị sẽ tìm một thiết bị Pixel có sẵn.
- Yêu cầu kiểm thử +(các) thiết bị bắt đầu dưới dạng lệnh gọi – Quá trình kiểm thử đang bắt đầu.
- Phát hành thiết bị – Sau khi lệnh gọi hoàn tất, thiết bị được phân bổ sẽ được phát hành và có thể được phân bổ cho các chương trình kiểm thử khác.
Lệnh gọi Tradefed
Lệnh gọi trong Tradefed đề cập đến thời điểm một lệnh kiểm thử đang thực thi.
Các thiết bị có trong lệnh gọi được đánh dấu là allocated
và không thể được các kiểm thử khác sử dụng để chạy.
TF sẽ thực thi các bước sau theo thứ tự này:
- Tạo và kiểm thử tính năng tải cấu phần phần mềm xuống
- Chuẩn bị mục tiêu
- Thực thi kiểm thử
- Dọn dẹp mục tiêu
- Báo cáo kết quả
Mỗi bước được mô tả chi tiết hơn trong phần Cấu trúc.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Test Command Scheduler\n\nIn Tradefed, every single test request goes through the\n[Command Scheduler](https://android.googlesource.com/platform/tools/tradefederation/+/refs/heads/android16-release/src/com/android/tradefed/command/CommandScheduler.java)\nto be run. So the Command Scheduler is a key component of the harness needed to\nrun tests.\n\nLifecycle\n---------\n\nWhen a test request is presented to Tradefed (for example, input from the\nconsole), it will go through the following events before being run:\n\n1. *Test request is parsed* - A test request is usually composed of an XML Tradefed configuration reference followed by options. For example: `\u003e run host --class com.android.tradefed.build.BuildInfoTest`\n2. *Device Manager is requested for device(s) matching the test request* - Device Manager [allocates a device](/docs/core/tests/tradefed/architecture/device-manager/device-allocation) that matches the test requests. For example, if a Pixel device is requested then Device Manager will look for an available Pixel device.\n3. *Test request + device(s) starts as an invocation* - Testing is starting.\n4. *Device release* - Once the invocation is finished, the device allocated will be released and can be allocated for other tests.\n\nTradefed invocation\n-------------------\n\nAn invocation in Tradefed refers to when a test command is currently executing.\nDevices included in the invocation are marked as `allocated` and cannot be used\nby other tests to run.\n\nTF will execute the following steps in this order:\n\n1. [Build and test artifacts download](/docs/core/tests/tradefed/architecture/build-provider)\n2. [Target preparation](/docs/core/tests/tradefed/architecture/target-preparer)\n3. [Test execution](/docs/core/tests/tradefed/architecture/advanced/test-runner)\n4. [Target clean up](/docs/core/tests/tradefed/architecture/target-preparer)\n5. [Result reporting](/docs/core/tests/tradefed/architecture/result-reporter)\n\nEach step is described in more detail within the\n[Architecture section](/docs/core/tests/tradefed/architecture)."]]