Only setup mock data once for baseline profiles and benchmarks.

This commit is contained in:
Clark
2023-03-10 17:34:15 -05:00
committed by Greyson Parrelli
parent e1e117ce73
commit ed2d6ea903
2 changed files with 10 additions and 4 deletions

View File

@@ -26,10 +26,12 @@ class BaselineProfileGenerator {
fun startup() = baselineProfileRule.collectBaselineProfile(
packageName = "org.thoughtcrime.securesms",
profileBlock = {
val setupIntent = Intent().apply {
component = ComponentName("org.thoughtcrime.securesms", "org.signal.benchmark.BenchmarkSetupActivity")
if (iteration == 0) {
val setupIntent = Intent().apply {
component = ComponentName("org.thoughtcrime.securesms", "org.signal.benchmark.BenchmarkSetupActivity")
}
startActivityAndWait(setupIntent)
}
startActivityAndWait(setupIntent)
startActivityAndWait()
device.findObject(By.textContains("Buddy")).click();
device.wait(

View File

@@ -52,7 +52,11 @@ class StartupBenchmarks {
iterations = iterations,
startupMode = StartupMode.COLD,
compilationMode = compilationMode,
setupBlock = fakeDataSetupBlock
setupBlock = {
if (compilationMode !is CompilationMode.Partial || iteration == 0) {
fakeDataSetupBlock()
}
}
) {
pressHome()
startActivityAndWait()