ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
ตัวจัดตารางเวลาคําสั่งทดสอบ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใน Tradefed คําขอทดสอบแต่ละรายการจะผ่านตัวจัดตารางคําสั่งเพื่อเรียกใช้ ดังนั้นเครื่องมือกำหนดเวลาคําสั่งจึงเป็นองค์ประกอบสําคัญของสายจูงที่จําเป็นสําหรับการทดสอบ
วงจร
เมื่อมีการนำเสนอคำขอทดสอบไปยัง Tradefed (เช่น อินพุตจากคอนโซล) คำขอดังกล่าวจะผ่านเหตุการณ์ต่อไปนี้ก่อนที่จะทำงาน
- แยกวิเคราะห์คําขอทดสอบ - โดยปกติคําขอทดสอบจะประกอบด้วยข้อมูลอ้างอิงการกําหนดค่า XML ของ Tradefed ตามด้วยตัวเลือก
เช่น
> run host --class com.android.tradefed.build.BuildInfoTest
- ขออุปกรณ์จาก Device Manager ที่ตรงกับคําขอทดสอบ - Device Manager จัดสรรอุปกรณ์ที่ตรงกับคําขอทดสอบ เช่น หากมีการขออุปกรณ์ Pixel โปรแกรมจัดการอุปกรณ์จะค้นหาอุปกรณ์ Pixel ที่พร้อมใช้งาน
- คำขอทดสอบ + อุปกรณ์เริ่มต้นด้วยการเรียกใช้ - การทดสอบกำลังจะเริ่ม
- การปล่อยอุปกรณ์ - เมื่อการเรียกใช้เสร็จสิ้นแล้ว ระบบจะปล่อยอุปกรณ์ที่จัดสรรและจัดสรรอุปกรณ์สำหรับการทดสอบอื่นๆ ได้
การเรียกใช้ Tradefed
การเรียกใช้ใน Tradefed หมายถึงเวลาที่ระบบกำลังเรียกใช้คําสั่งทดสอบ
อุปกรณ์ที่รวมอยู่ในการเรียกใช้จะมีเครื่องหมายเป็น allocated
และทดสอบอื่นๆ ไม่สามารถเรียกใช้อุปกรณ์ดังกล่าวได้
TF จะดําเนินการตามขั้นตอนต่อไปนี้ตามลําดับ
- สร้างและทดสอบการดาวน์โหลดอาร์ติแฟกต์
- การเตรียมเป้าหมาย
- การเรียกใช้การทดสอบ
- ล้างข้อมูลเป้าหมาย
- การรายงานผลลัพธ์
แต่ละขั้นตอนจะอธิบายไว้อย่างละเอียดในส่วนสถาปัตยกรรม
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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)."]]