A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Pianificatore dei comandi di test
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
In Tradefed, ogni singola richiesta di test passa attraverso il
Command Scheduler
per essere eseguita. Di conseguenza, il programmatore dei comandi è un componente chiave dell'harness necessario per eseguire i test.
Ciclo di vita
Quando una richiesta di test viene presentata a Tradefed (ad esempio, input dalla console), prima di essere eseguita passa attraverso i seguenti eventi:
- La richiesta di test viene analizzata: una richiesta di test è in genere composta da un riferimento di configurazione XML TradeFed seguito da opzioni.
Ad esempio:
> run host --class com.android.tradefed.build.BuildInfoTest
- A Device Manager viene richiesta la disponibilità di dispositivi corrispondenti alla richiesta di test: Device Manager alloca un dispositivo corrispondente alle richieste di test. Ad esempio, se viene richiesto un dispositivo Pixel, Gestione dispositivi cercherà un dispositivo Pixel disponibile.
- Richiesta di test + dispositivi inizia come chiamata: il test è in fase di avvio.
- Rilascio del dispositivo: al termine dell'invocazione, il dispositivo allocato verrà rilasciato e potrà essere allocato per altri test.
Richiamo di TradeFed
Un'invocazione in Tradefed si riferisce al momento in cui è in corso l'esecuzione di un comando di test.
I dispositivi inclusi nell'invocazione sono contrassegnati come allocated
e non possono essere utilizzati
da altri test da eseguire.
TF eseguirà i seguenti passaggi in questo ordine:
- Eseguire il download di elementi di compilazione e test
- Preparazione del target
- Esecuzione del test
- Pulizia del target
- Report sui risultati
Ogni passaggio è descritto in modo più dettagliato nella
sezione Architettura.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)."]]