Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Testowanie harmonogramu poleceń
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
W Tradefed każde żądanie testu jest wysyłane do harmonogramu poleceń w celu wykonania. Harmonogram komend jest więc kluczowym elementem zestawu potrzebnego do przeprowadzania testów.
Cykl życia
Gdy Tradefed otrzyma żądanie testowe (np. dane z konsoli), przed uruchomieniem przeprowadzi te czynności:
- Parsowanie żądania testowego – żądanie testowe zwykle składa się z odwołania do konfiguracji Tradefed w formacie XML, po którym następują opcje.
Na przykład:
> run host --class com.android.tradefed.build.BuildInfoTest
- Menedżer urządzeń jest proszony o urządzenia pasujące do żądania testowego – Menedżer urządzeń przydziela urządzenie, które pasuje do żądań testowych. Jeśli na przykład użytkownik poprosi o urządzenie Pixel, Menedżer urządzeń będzie szukać dostępnego urządzenia Pixel.
- Żądanie testu + urządzenie(a) uruchamia się jako wywołanie – rozpoczyna się testowanie.
- Zwolnienie urządzenia – po zakończeniu wywołania przydzielone urządzenie zostanie zwolnione i można je przydzielić do innych testów.
wywołanie w ramach usługi Tradefed.
Wywołanie w Tradefed odnosi się do sytuacji, gdy polecenie testowe jest obecnie wykonywane.
Urządzenia uwzględnione w wywołaniu są oznaczone jako allocated
i nie mogą być używane przez inne testy.
TF wykona te czynności w podanej kolejności:
- Budowanie i testowanie pobierania artefaktów
- Przygotowanie listy odbiorców
- Wykonanie testu
- Czyszczenie docelowych
- Raportowanie wyników
Każdy krok jest opisany bardziej szczegółowo w sekcji Architektura.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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)."]]