Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a99a3058 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use common test config" into main

parents 8b9becf5 d4e8f638
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -54,6 +54,13 @@ android_test {
    defaults: [
        "structured_concurrency_perf_tests_defaults",
    ],
    test_config: "configs/structured-concurrency-perf.xml",
    test_options: {
        extra_test_configs: [
            "configs/structured-concurrency-perf.xml",
            "configs/structured-concurrency-base.xml",
        ],
    },
}

android_test {
@@ -61,7 +68,13 @@ android_test {
    defaults: [
        "structured_concurrency_perf_tests_defaults",
    ],
    test_config: "AndroidTest-debug.xml",
    test_config: "configs/structured-concurrency-debug.xml",
    test_options: {
        extra_test_configs: [
            "configs/structured-concurrency-debug.xml",
            "configs/structured-concurrency-base.xml",
        ],
    },
    srcs: [
        "src-debug/**/*.kt",
    ],
+0 −14
Original line number Diff line number Diff line
@@ -31,11 +31,6 @@
        <option name="screen-always-on" value="on" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="StructuredConcurrencyPerfTests-debug.apk" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <!-- perf-setup.sh is pre-installed on eng and userdebug builds -->
        <option name="run-command" value="perf-setup.sh" />
@@ -69,13 +64,4 @@
        <option name="strict-include-metric-filter" value="(perfetto_mt|time_nanos|allocation_count)_.*" />
    </metric_post_processor>

    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="com.android.app.concurrent.benchmark" />
        <option name="runner" value="androidx.benchmark.junit4.AndroidBenchmarkRunner" />
        <option name="device-listeners" value="com.android.app.concurrent.benchmark.util.CsvMetricCollector" />
        <option name="instrumentation-arg" key="csv-metric-collector:per_run" value="true" />
        <option name="instrumentation-arg" key="androidx.benchmark.profiling.mode" value="None" />
        <option name="instrumentation-arg" key="androidx.benchmark.iterations" value="50" />
        <option name="instrumentation-arg" key="androidx.benchmark.zipTraceWithInMemoryEvents.enable" value="true" />
    </test>
</configuration>
+35 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2025 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<configuration description="Installs apk needed for StructuredConcurrencyPerfTests">

    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="StructuredConcurrencyPerfTests-debug.apk" />
    </target_preparer>

    <include name="structured-concurrency-base.config" />

    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="com.android.app.concurrent.benchmark" />
        <option name="runner" value="androidx.benchmark.junit4.AndroidBenchmarkRunner" />
        <option name="device-listeners" value="com.android.app.concurrent.benchmark.util.CsvMetricCollector" />
        <option name="instrumentation-arg" key="csv-metric-collector:per_run" value="true" />
        <option name="instrumentation-arg" key="androidx.benchmark.profiling.mode" value="None" />
        <option name="instrumentation-arg" key="androidx.benchmark.iterations" value="50" />
        <option name="instrumentation-arg" key="androidx.benchmark.zipTraceWithInMemoryEvents.enable" value="true" />
    </test>

</configuration>
+45 −0
Original line number Diff line number Diff line
@@ -13,61 +13,14 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<configuration description="Runs StructuredConcurrencyPerfTests metric instrumentation.">
    <!-- Declare as a performance test module -->
    <option name="config-descriptor:metadata" key="test-type" value="performance" />
    <option name="test-tag" value="structured-concurrency-perf-test" />

    <!-- Needed for storing the perfetto trace files in the sdcard/test_results-->
    <option name="isolated-storage" value="false"/>

    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
    <target_preparer class="com.android.tradefed.targetprep.DeviceSetup">
        <option name="airplane-mode" value="on" />
        <option name="wifi" value="off" />
        <option name="bluetooth" value="off" />
        <option name="nfc" value="off" />
        <option name="screen-adaptive-brightness" value="off" />
        <option name="screen-always-on" value="on" />
    </target_preparer>
<configuration description="Installs apk needed for StructuredConcurrencyPerfTests">

    <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="StructuredConcurrencyPerfTests.apk" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <!-- perf-setup.sh is pre-installed on eng and userdebug builds -->
        <option name="run-command" value="perf-setup.sh" />
        <option name="run-command" value="pm compile -m speed -f com.android.app.concurrent.benchmark" />
        <option name="run-command" value="cat /dev/cpuset/camera-daemon-high-group/cpus > /dev/cpuset/top-app/cpus" />
        <option name="throw-if-cmd-fail" value="true" />
    </target_preparer>

    <metrics_collector class="com.android.tradefed.device.metric.PerfettoFilePullerCollector">
        <option name="pull-pattern-keys" value="additionalTestOutputFile_.*"/>
        <!-- Collect the files on each test case ended. Otherwise, traces of sibling tests will
             be associated with each test, and 2) additionalTestOutputFile_profiling_trace
             will be overwritten by subsequent test runs, meaning we'll only get one
             profiling trace for whatever ran last -->
        <option name="collect-on-run-ended-only" value="false"/>
        <!-- Don't clean up the file after pulling. Otherwise, the removal of the file from the last
             test may overlap with execution of the next test, causing inconsistent results. The
             benchmark runner will clean up the test output directory at the beginning of each test
             module. -->
        <option name="clean-up" value="false"/>
    </metrics_collector>

    <!-- Pull test metric results summary file from device to host -->
    <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
        <option name="pull-pattern-keys" value="metricSummaryOutputFile"/>
        <option name="clean-up" value="false" />
    </metrics_collector>

    <metric_post_processor class="com.android.tradefed.postprocessor.MetricFilePostProcessor">
        <option name="enable-per-test-log" value="true" />
        <option name="strict-include-metric-filter" value="(perfetto_mt|time_nanos|allocation_count)_.*" />
    </metric_post_processor>
    <include name="structured-concurrency-base.config" />

    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
        <option name="package" value="com.android.app.concurrent.benchmark" />
@@ -88,4 +41,5 @@
    <target_preparer class="com.android.tradefed.targetprep.DeviceCleaner">
        <option name="cleanup-action" value="REBOOT" />
    </target_preparer>

</configuration>