LaunchControlProvider

public class LaunchControlProvider
extends Object implements IBuildProvider, IConfigurationReceiver, IDiscoverDependencies, IInvocationContextReceiver, ITestLoggerReceiver

java.lang.Object
   ↳ com.google.android.tradefed.build.LaunchControlProvider


テストするビルドについて Google のリリース管理サーバーにクエリを行う IBuildProvider 実装。

サブクラス化は推奨されません。extra-target-downloads と --additional-files-filter を使用して、ダウンロードするアーティファクトを指定します。

TODO: 起動制御クライアントとダウンロード ロジックをリファクタリングして、将来の「One Common Device Flasher Library To Rule Them All」(商標)と統合する

概要

ネストされたクラス

class LaunchControlProvider.DownloadFileDescriptor

 

定数

String BUILD_ID_PARAM

String BUILD_NAME_PARAM

String LC_BASE_URL

String MIN_BUILD_ID_PARAM

String QUERY_TYPE_PARAM

String QUERY_WINDOW_PARAM

String TEST_TAG_PARAM

フィールド

protected boolean mEnableResolveSymlinks

パブリック コンストラクタ

LaunchControlProvider()

パブリック メソッド

void addFileFilter(String filter)
void addOptionalFileFilter(String optionalFilter)
void addRemoteZipFilter(String fileFilter)

部分的にダウンロードできるリモート ZIP ファイルのフィルタを追加します。

void cleanUp(IBuildInfo info)

一時ビルドファイルをクリーンアップします。

void clearExtraDownloads()
IFileDownloader createLaunchControlDownloader(RemoteBuildInfo remoteBuild)

起動制御ファイルに使用するダウンローダーを作成するためのファクトリ メソッド。

void decrementTestBuild(String buildId)
IBuildInfo fetchRemoteBuild(RemoteBuildInfo remoteBuild)

起動制御レスポンスを、必要なすべてのファイルを含むローカル IBuildInfo に変換します。

void forceUseCas(boolean useCas)
Collection<String> getAdditionalFilesFilters()
String getBranch()

クエリの対象として現在指定されているブランチを取得します。

IBuildInfo getBuild()

テスト対象のビルドのデータを取得します。

String getBuildArchivePath()

ビルド アーティファクト アーカイブのパスを取得します。

String getBuildFlavor()

クエリするビルドフレーバーを取得します。

String getBuildId()

クエリするビルド ID を取得します。

String getBuildOs()
IConfiguration getConfiguration()

使用中の挿入された IConfiguration を返します。

Set<String> getContentBasedReportingDefault()
IInvocationContext getInvocationContext()
String getLcHostname()

クエリで使用する Launch Control ホスト名を取得する

String getLcProtocol()

クエリで使用する Launch Control プロトコルを取得します。

QueryType getQueryType()

使用するクエリタイプを取得します。

RemoteBuildInfo getRemoteBuild()

すべてのファイルをダウンロードせずに、起動制御のレスポンスを取得します。

Set<String> getRemoteZipFilters()

部分的にダウンロードできる zip ファイルのフィルタのセットを取得します。

boolean getReportContentBasedRollout()
boolean getReportContentInformation()
String getTestConfigOnlyZip()

テスト専用の構成 zip を取得します。

ITestLogger getTestLogger()
String getTestTag()

クエリで使用するテストタグを取得します。

boolean getUseSsoClient()

SSO クライアントを使用する必要があるかどうかを取得します。

static void handleExtraTargetDownloads(IBuildInfo build, List<Entry<String, File>> entries)

メタデータをバックフィルするために、ハンドル ファイルを動的にダウンロードします。

boolean isChunkingUncompressedDisabled()
boolean isSecondaryParallelDownload()

並列ダウンロードが有効かどうか。

Set<String> reportTestZipFileFilter()
void resetTestBuild()

QueryType.RESET_TEST_BUILD クエリを実行して、起動制御にリクエストを送信し、構成されたビルドを「テスト済みビルド」セットから削除します。

void resetTestBuild(String buildId)

QueryType.RESET_TEST_BUILD クエリを実行して、起動管理にリクエストを送信し、指定されたビルドを「テスト済みビルド」セットから削除します。

void setAdditionalFilesFilters(Collection<String> additionalFilesFilters)
void setBranch(String branch)

クエリするブランチを設定します。

void setBuildArchivePath(String buildArchivePath)

ビルド アーティファクト アーカイブのパスを設定します。

void setBuildFlavor(String flavor)

クエリするビルドフレーバーを設定します。

void setBuildId(String buildId)

クエリするビルド ID を設定します。

void setBuildOs(String os)
void setConfiguration(IConfiguration configuration)

使用中の IConfiguration を挿入します。

void setContentBasedReportingDefault(Set<String> contentBasedReportingDefault)
void setEnableResolveSymlinks(boolean enableResolveSymlinks)
void setFetchSigned(boolean fetchSigned)
void setInvocationContext(IInvocationContext invocationContext)

void setLcHostname(String lcHostname)

クエリで使用する Launch Control ホスト名を設定します。

void setLcProtocol(String lcProtocol)

クエリで使用する Launch Control プロトコルを設定する

void setMinBuildId(int minBuildId)

使用する最小ビルド ID を設定します。

void setParallelSecondaryDownload(boolean parallel)
void setPartialDownloadForZip(boolean enableZipPartialDownload)
void setQueryType(QueryType queryType)

使用するクエリタイプを設定します。

void setReportContentBasedRollout(boolean reportContentBasedRollout)
void setReportContentInformation(boolean reportContentInfo)
void setSkipCloudContent(boolean skipCloudContent)
void setTestLogger(ITestLogger testLogger)

ITestLogger インスタンスを挿入します。

void setTestTag(String tag)

使用するテストタグを設定します。

void setUseBuildApi(boolean useBuildApi)

ビルド プロバイダが Android Build API を使用するかどうかを制御する値を設定します。

void setUseSsoClient(boolean useSsoClient)

sso クライアントを使用するかどうかを設定します。

boolean shouldFetchSigned()
boolean shouldReportContentInformation()
boolean shouldUseBuildApi()

ビルド プロバイダが Android Build API を使用する必要があるかどうかを返します。

保護されたメソッド

void convertBuildToSigned(RemoteBuildInfo remoteBuild)

この RemoteBuildInfo のパラメータを変更して、署名付きビルドを記述します。

IHttpHelper createHttpHelper()

HttpHelper を作成するためのファクトリ メソッド。

String createSignedParameter(String param)

符号付きパラメータを表すように単一のパラメータを変更します。パラメータがすでに符号付き形式である場合は、変更されずに返されます。

void deleteCacheEntry(String remoteFilePath)

ファイルが破損している場合に備えて、キャッシュからファイルを削除します。

void downloadAdditionalFiles(RemoteBuildInfo remoteBuild, IFileDownloader downloader, IBuildInfo localBuild)
IBuildInfo downloadBuildFiles(RemoteBuildInfo remoteBuild, String testTargetName, String buildName, IFileDownloader downloader)

remoteBuild から --download-build-key で設定された必要なファイルキーをダウンロードし、IBuildInfo に保存します。

final List<Entry<LaunchControlProvider.DownloadFileDescriptor, File>> downloadFilesNonBlocking(IFileDownloader downloader, List<LaunchControlProvider.DownloadFileDescriptor> toBeDownloaded)

ファイルパスのセットをダウンロードし、必須の場合は適用します。

AndroidBuildArtifactHelper getBuildArtifactHelper()
MultiMap<String, File> getExtraDownloadMap()

ダウンロードされた追加ターゲットのマップを返します。

Set<String> getGlobalDownloadExclusionPatterns()
final File getWorkFolder()

現在の呼び出しワークフォルダを返します。

final File handleDirectoryDownload(File downloadedFile)
RemoteBuildInfo performBuildApiQuery()
void performValidityCheckForBuildApi()
RemoteBuildInfo queryForBuild(MultiMap<String, String> params)

起動制御クエリを実行し、エラーが発生した場合は複数回再試行します。

RemoteBuildInfo queryForBuild()

起動制御クエリを実行し、エラーが発生した場合は複数回再試行します。

RemoteBuildInfo queryForBuildWithBuildApi()

ビルド API に対してビルドクエリを実行します。

void replaceParamWithSigned(RemoteBuildInfo buildInfo, RemoteBuildInfo.BuildAttributeKey key)
boolean useCasDefaultRollout()

定数

BUILD_ID_PARAM

protected static final String BUILD_ID_PARAM

定数値: "bid"

BUILD_NAME_PARAM

protected static final String BUILD_NAME_PARAM

定数値: "id"

LC_BASE_URL

protected static final String LC_BASE_URL

定数値: "%s://%s/buildbot-update"

MIN_BUILD_ID_PARAM

protected static final String MIN_BUILD_ID_PARAM

定数値: "min_build_id"

QUERY_TYPE_PARAM

protected static final String QUERY_TYPE_PARAM

定数値: "op"

QUERY_WINDOW_PARAM

protected static final String QUERY_WINDOW_PARAM

定数値: "query_window"

TEST_TAG_PARAM

protected static final String TEST_TAG_PARAM

定数値: "test_tag"

フィールド

protected boolean mEnableResolveSymlinks

パブリック コンストラクタ

LaunchControlProvider

public LaunchControlProvider ()

パブリック メソッド

addFileFilter

public void addFileFilter (String filter)

パラメータ
filter String

addOptionalFileFilter

public void addOptionalFileFilter (String optionalFilter)

パラメータ
optionalFilter String

addRemoteZipFilter

public void addRemoteZipFilter (String fileFilter)

部分的にダウンロードできるリモート ZIP ファイルのフィルタを追加。

パラメータ
fileFilter String

cleanUp

public void cleanUp (IBuildInfo info)

一時ビルドファイルをクリーンアップします。

パラメータ
info IBuildInfo

clearExtraDownloads

public void clearExtraDownloads ()

createLaunchControlDownloader

public IFileDownloader createLaunchControlDownloader (RemoteBuildInfo remoteBuild)

起動制御ファイルに使用するダウンローダーを作成するためのファクトリー メソッド。

パラメータ
remoteBuild RemoteBuildInfo

戻り値
IFileDownloader

decrementTestBuild

public void decrementTestBuild (String buildId)

パラメータ
buildId String

fetchRemoteBuild

public IBuildInfo fetchRemoteBuild (RemoteBuildInfo remoteBuild)

起動制御レスポンスを、必要なすべてのファイルを含むローカル IBuildInfo に変換します。

このパッケージ外の特殊化が直接使用できるように公開されました。通常は代わりに getBuild() を使用する必要があります。

パラメータ
remoteBuild RemoteBuildInfo: 起動制御サーバーのレスポンス

戻り値
IBuildInfo IBuildInfo にビルドファイルのローカル バージョンが入力されている

例外
BuildRetrievalError ビルドファイルをダウンロードできなかった場合

forceUseCas

public void forceUseCas (boolean useCas)

パラメータ
useCas boolean

getAdditionalFilesFilters

public Collection<String> getAdditionalFilesFilters ()

戻り値
Collection<String>

getBranch

public String getBranch ()

現在指定されているクエリ対象のブランチを取得する

戻り値
String ブランチ

getBuild

public IBuildInfo getBuild ()

テスト対象のビルドのデータを取得します。

戻り値
IBuildInfo テスト対象のビルドの IBuildInfo。テストに使用できるビルドがない場合は null

例外
BuildRetrievalError

getBuildArchivePath

public String getBuildArchivePath ()

ビルド アーティファクト アーカイブのパスを取得する

戻り値
String

getBuildFlavor

public String getBuildFlavor ()

クエリするビルドフレーバーを取得する

戻り値
String

getBuildId

public String getBuildId ()

クエリするビルド ID を取得する

戻り値
String

getBuildOs

public String getBuildOs ()

戻り値
String

getConfiguration

public IConfiguration getConfiguration ()

使用中の挿入された IConfiguration を返します。

戻り値
IConfiguration

getContentBasedReportingDefault

public Set<String> getContentBasedReportingDefault ()

戻り値
Set<String>

getInvocationContext

public IInvocationContext getInvocationContext ()

戻り値
IInvocationContext

getLcHostname

public String getLcHostname ()

クエリで使用する Launch Control のホスト名を取得する

戻り値
String

getLcProtocol

public String getLcProtocol ()

クエリで使用する Launch Control プロトコルを取得

戻り値
String

getQueryType

public QueryType getQueryType ()

使用するクエリタイプを取得する

戻り値
QueryType

getRemoteBuild

public RemoteBuildInfo getRemoteBuild ()

すべてのファイルをダウンロードせずに、起動制御のレスポンスを取得します。

このパッケージ外の特殊化が直接使用できるように公開されました。通常は代わりに getBuild() を使用する必要があります。

戻り値
RemoteBuildInfo 起動制御からの RemoteBuildInfo レスポンス

例外
BuildRetrievalError 予期しないエラーによりビルド情報の取得に失敗した場合

getRemoteZipFilters

public Set<String> getRemoteZipFilters ()

部分的にダウンロードできる zip ファイルのフィルタのセットを取得します。

戻り値
Set<String>

getReportContentBasedRollout

public boolean getReportContentBasedRollout ()

戻り値
boolean

getReportContentInformation

public boolean getReportContentInformation ()

戻り値
boolean

getTestConfigOnlyZip

public String getTestConfigOnlyZip ()

テスト専用の構成 zip を取得します。

戻り値
String

getTestLogger

public ITestLogger getTestLogger ()

戻り値
ITestLogger

getTestTag

public String getTestTag ()

クエリで使用するテストタグを取得する

戻り値
String

getUseSsoClient

public boolean getUseSsoClient ()

SSO クライアントを使用する必要があるかどうかを取得します

戻り値
boolean

handleExtraTargetDownloads

public static void handleExtraTargetDownloads (IBuildInfo build, 
                List<Entry<String, File>> entries)

メタデータをバックフィルするために、ハンドル ファイルを動的にダウンロードする

パラメータ
build IBuildInfo

entries List

例外
BuildRetrievalError

isChunkingUncompressedDisabled

public boolean isChunkingUncompressedDisabled ()

戻り値
boolean

isSecondaryParallelDownload

public boolean isSecondaryParallelDownload ()

並列ダウンロードが有効かどうか。

戻り値
boolean

reportTestZipFileFilter

public Set<String> reportTestZipFileFilter ()

戻り値
Set<String>

resetTestBuild

public void resetTestBuild ()

QueryType.RESET_TEST_BUILD クエリを実行して、起動制御にリクエストを送信し、構成されたビルドを「テスト済みビルド」セットから削除します。

エラー処理と再試行メカニズムが限定的です。LCProxy が廃止されたため、非推奨になりました。

resetTestBuild

public void resetTestBuild (String buildId)

QueryType.RESET_TEST_BUILD クエリを実行して、起動制御にリクエストを送信し、指定されたビルドを「テスト済みビルド」セットから削除します。

エラー処理と再試行メカニズムが制限されています。LCProxy が廃止されたため、非推奨になりました。

パラメータ
buildId String: リセットするビルド ID

setAdditionalFilesFilters

public void setAdditionalFilesFilters (Collection<String> additionalFilesFilters)

パラメータ
additionalFilesFilters Collection

setBranch

public void setBranch (String branch)

クエリするブランチを設定する

setBuildArchivePath

public void setBuildArchivePath (String buildArchivePath)

ビルド アーティファクト アーカイブのパスを設定する

setBuildFlavor

public void setBuildFlavor (String flavor)

クエリするビルド フレーバーを設定する

setBuildId

public void setBuildId (String buildId)

クエリするビルド ID を設定する

setBuildOs

public void setBuildOs (String os)

パラメータ
os String

setConfiguration

public void setConfiguration (IConfiguration configuration)

使用中の IConfiguration を挿入します。

パラメータ
configuration IConfiguration

setContentBasedReportingDefault

public void setContentBasedReportingDefault (Set<String> contentBasedReportingDefault)

パラメータ
contentBasedReportingDefault Set

setEnableResolveSymlinks

public void setEnableResolveSymlinks (boolean enableResolveSymlinks)

パラメータ
enableResolveSymlinks boolean

setFetchSigned

public void setFetchSigned (boolean fetchSigned)

パラメータ
fetchSigned boolean

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

パラメータ
invocationContext IInvocationContext

setLcHostname

public void setLcHostname (String lcHostname)

クエリで使用する Launch Control ホスト名を設定する

パラメータ
lcHostname String

setLcProtocol

public void setLcProtocol (String lcProtocol)

クエリで使用する Launch Control プロトコルを設定する

setMinBuildId

public void setMinBuildId (int minBuildId)

使用する最小ビルド ID を設定します。

パラメータ
minBuildId int

setParallelSecondaryDownload

public void setParallelSecondaryDownload (boolean parallel)

パラメータ
parallel boolean

setPartialDownloadForZip

public void setPartialDownloadForZip (boolean enableZipPartialDownload)

パラメータ
enableZipPartialDownload boolean

setQueryType

public void setQueryType (QueryType queryType)

使用するクエリタイプを設定する

setReportContentBasedRollout

public void setReportContentBasedRollout (boolean reportContentBasedRollout)

パラメータ
reportContentBasedRollout boolean

setReportContentInformation

public void setReportContentInformation (boolean reportContentInfo)

パラメータ
reportContentInfo boolean

setSkipCloudContent

public void setSkipCloudContent (boolean skipCloudContent)

パラメータ
skipCloudContent boolean

setTestLogger

public void setTestLogger (ITestLogger testLogger)

ITestLogger インスタンスを挿入します

パラメータ
testLogger ITestLogger

setTestTag

public void setTestTag (String tag)

使用するテストタグを設定します。

パラメータ
tag String

setUseBuildApi

public void setUseBuildApi (boolean useBuildApi)

ビルド プロバイダが Android Build API を使用するかどうかを制御する値を設定します

パラメータ
useBuildApi boolean

setUseSsoClient

public void setUseSsoClient (boolean useSsoClient)

sso クライアントを使用するかどうかを設定します

パラメータ
useSsoClient boolean

shouldFetchSigned

public boolean shouldFetchSigned ()

戻り値
boolean

shouldReportContentInformation

public boolean shouldReportContentInformation ()

戻り値
boolean

shouldUseBuildApi

public boolean shouldUseBuildApi ()

ビルド プロバイダが Android Build API を使用する必要があるかどうかを返します

戻り値
boolean

保護されたメソッド

convertBuildToSigned

protected void convertBuildToSigned (RemoteBuildInfo remoteBuild)

この RemoteBuildInfo のパラメータを変更して、署名付きビルドを記述します。

パラメータ
remoteBuild RemoteBuildInfo: 変更する RemoteBuildInfo

例外
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

createHttpHelper

protected IHttpHelper createHttpHelper ()

HttpHelper を作成するための Factory メソッド。

単体テストでモックできるように公開されています。

戻り値
IHttpHelper

createSignedParameter

protected String createSignedParameter (String param)

符号付きパラメータを表すように単一のパラメータを変更します。パラメータがすでに符号付き形式である場合は、変更されずに返されます。

パラメータ
param String: 初期パラメータ(符号なしまたは符号付き)

戻り値
String 署名付きパラメータ

例外
BuildRetrievalError パラメータの形式が正しくなく、処理できない場合

deleteCacheEntry

protected void deleteCacheEntry (String remoteFilePath)

ファイルが破損している場合に備えて、キャッシュからファイルを削除します。

パラメータ
remoteFilePath String: IFileDownloader.downloadFile(String) で指定されたリモートファイルと同じ。

downloadAdditionalFiles

protected void downloadAdditionalFiles (RemoteBuildInfo remoteBuild, 
                IFileDownloader downloader, 
                IBuildInfo localBuild)

パラメータ
remoteBuild RemoteBuildInfo

downloader IFileDownloader

localBuild IBuildInfo

例外
BuildRetrievalError

downloadBuildFiles

protected IBuildInfo downloadBuildFiles (RemoteBuildInfo remoteBuild, 
                String testTargetName, 
                String buildName, 
                IFileDownloader downloader)

remoteBuild から --download-build-key で設定された必要なファイルキーをダウンロードし、IBuildInfo に保存します。

パラメータ
remoteBuild RemoteBuildInfo: 起動制御サーバーのレスポンス

testTargetName String: テスト ターゲット名

buildName String: リリース制御で定義されているビルドの名前

downloader IFileDownloader: ビルドファイルのダウンロードに使用する IFileDownloader

戻り値
IBuildInfo IBuildInfo にビルドファイルのローカル バージョンが入力されている

例外
BuildRetrievalError ビルドファイルをダウンロードできなかった場合

downloadFilesNonBlocking

protected final List<Entry<LaunchControlProvider.DownloadFileDescriptor, File>> downloadFilesNonBlocking (IFileDownloader downloader, 
                List<LaunchControlProvider.DownloadFileDescriptor> toBeDownloaded)

ファイルパスのセットをダウンロードし、必須の場合は適用します。

パラメータ
downloader IFileDownloader

toBeDownloaded List

戻り値
List<Entry<LaunchControlProvider.DownloadFileDescriptor, File>>

例外
BuildRetrievalError

getBuildArtifactHelper

protected AndroidBuildArtifactHelper getBuildArtifactHelper ()

戻り値
AndroidBuildArtifactHelper

例外
BuildRetrievalError

getExtraDownloadMap

protected MultiMap<String, File> getExtraDownloadMap ()

ダウンロードされた追加のターゲットのマップを返します。

戻り値
MultiMap<String, File>

getGlobalDownloadExclusionPatterns

protected Set<String> getGlobalDownloadExclusionPatterns ()

戻り値
Set<String>

getWorkFolder

protected final File getWorkFolder ()

現在の呼び出しワークフォルダを返します。

戻り値
File

handleDirectoryDownload

protected final File handleDirectoryDownload (File downloadedFile)

パラメータ
downloadedFile File

戻り値
File

performBuildApiQuery

protected RemoteBuildInfo performBuildApiQuery ()

戻り値
RemoteBuildInfo

例外
BuildRetrievalError

performValidityCheckForBuildApi

protected void performValidityCheckForBuildApi ()

queryForBuild

protected RemoteBuildInfo queryForBuild (MultiMap<String, String> params)

エラーが発生した場合は複数回再試行して、リリース制御クエリを実行します。

パラメータ
params MultiMap: リリース制御のパラメータ

戻り値
RemoteBuildInfo 起動制御から取得された RemoteBuildInfo

例外
BuildRetrievalError

queryForBuild

protected RemoteBuildInfo queryForBuild ()

エラーが発生した場合は複数回再試行して、リリース制御クエリを実行します。

戻り値
RemoteBuildInfo 起動制御から取得された RemoteBuildInfo

例外
BuildRetrievalError

queryForBuildWithBuildApi

protected RemoteBuildInfo queryForBuildWithBuildApi ()

ビルド API に対してビルドクエリを実行します。

注: 入力パラメータは、さまざまなクラス スコープ変数によって暗黙的に指定されます。

戻り値
RemoteBuildInfo レスポンスから解析された RemoteBuildInfo

例外
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError

replaceParamWithSigned

protected void replaceParamWithSigned (RemoteBuildInfo buildInfo, 
                RemoteBuildInfo.BuildAttributeKey key)

パラメータ
buildInfo RemoteBuildInfo

key RemoteBuildInfo.BuildAttributeKey

例外
BuildRetrievalError

useCasDefaultRollout

protected boolean useCasDefaultRollout ()

戻り値
boolean