功能標誌目標準備器
public class FeatureFlagTargetPreparer
extends BaseTargetPreparer
更新 DeviceConfig(由遠端服務調整的功能標誌)。
這可用於重現裝置的狀態(透過使用「adb shell device_config list」將所有標誌值轉儲到檔案中)或批次啟用/停用標誌(全開/全關測試)。
用法範例:
- 若要用於全開/全關測試,請指定必要的標誌檔案:
--flag-file=flag_file_path
- 若要覆寫一個或多個標誌,請指定它們的值(可與標誌檔案組合):
--flag-file=flag_file_path --flag-value=namespace/name=value
- 若要用於可逆性測試,請指定全開文件,後面接著全關文件,並在兩個文件之間啟用重新啟動:
--flag-file=all_on_file_path --flag-file=all_off_file_path --reboot-between-flag-files
應與DeviceSetup
結合使用,以在測試期間停用 DeviceConfig 同步,這可能會覆寫此準備器所做的變更。
概括
公共構造函數
功能標誌目標準備器
public FeatureFlagTargetPreparer ()
公共方法
public void setUp (TestInformation testInformation)
參數 |
---|
testInformation | TestInformation |
public void tearDown (TestInformation testInformation,
Throwable e)
參數 |
---|
testInformation | TestInformation |
e | Throwable |