Stay organized with collections
Save and categorize content based on your preferences.
FailureRetention
@Incubating interface FailureRetention
Options for configuring Android Test Retention.
When enabled, Android Test Retention automatically takes emulator snapshots on test failures.
Summary
Public methods
|
abstract Unit |
Call this function to take unlimited number of test failure snapshots (will ignore
maxSnapshots setting)
|
Properties
|
abstract Boolean |
Enables snapshot compression.
|
abstract Boolean |
Enables Android Test Retention.
|
abstract Int |
Maximum number of failures that would be snapshotted.
|
Public methods
retainAll
abstract fun retainAll(): Unit
Call this function to take unlimited number of test failure snapshots (will ignore
maxSnapshots setting)
Properties
compressSnapshots
abstract var compressSnapshots: Boolean
Enables snapshot compression. Default to false.
enable
abstract var enable: Boolean
Enables Android Test Retention. Default to false.
maxSnapshots
abstract var maxSnapshots: Int
Maximum number of failures that would be snapshotted. Any failures after the first
$maxSnapshots will not have snapshots. Default to 5. Must be >0
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# FailureRetention\n================\n\n```\n@Incubating interface FailureRetention\n```\n\n|-------------------------------------------------|\n| [com.android.build.api.dsl.FailureRetention](#) |\n\nOptions for configuring Android Test Retention.\n\nWhen enabled, Android Test Retention automatically takes emulator snapshots on test failures.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [retainAll](#retainAll())`()` Call this function to take unlimited number of test failure snapshots (will ignore maxSnapshots setting) |\n\n| ### Properties ||\n|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compressSnapshots](#compressSnapshots:kotlin.Boolean) Enables snapshot compression. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [enable](#enable:kotlin.Boolean) Enables Android Test Retention. |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [maxSnapshots](#maxSnapshots:kotlin.Int) Maximum number of failures that would be snapshotted. |\n\nPublic methods\n--------------\n\n### retainAll\n\n```\nabstract fun retainAll(): Unit\n```\n\nCall this function to take unlimited number of test failure snapshots (will ignore\nmaxSnapshots setting)\n\nProperties\n----------\n\n### compressSnapshots\n\n```\nabstract var compressSnapshots: Boolean\n```\n\nEnables snapshot compression. Default to false. \n\n### enable\n\n```\nabstract var enable: Boolean\n```\n\nEnables Android Test Retention. Default to false. \n\n### maxSnapshots\n\n```\nabstract var maxSnapshots: Int\n```\n\nMaximum number of failures that would be snapshotted. Any failures after the first\n$maxSnapshots will not have snapshots. Default to 5. Must be \\\u003e0"]]