mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-03-27 21:18:59 +00:00
[workload/JetNews] Address reviewer comments
- Add JetNews workload description. - Fixup copyright years. - Adjust formatting. - Add constraints to the workload's parameters. - Fix comment typos. - Remove unused commented-out code from app/build.gradle.
This commit is contained in:
parent
1a308b6e39
commit
9212b7f051
@ -14,7 +14,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from wa import ApkUiautoWorkload, Parameter, TestPackageHandler
|
from wa import ApkUiautoWorkload, Parameter, TestPackageHandler
|
||||||
|
|
||||||
from wa.utils.types import list_of_strs
|
from wa.utils.types import list_of_strs
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class Jetnews(ApkUiautoWorkload):
|
class Jetnews(ApkUiautoWorkload):
|
||||||
@ -22,9 +24,22 @@ class Jetnews(ApkUiautoWorkload):
|
|||||||
name = 'jetnews'
|
name = 'jetnews'
|
||||||
package_names = ['com.example.jetnews']
|
package_names = ['com.example.jetnews']
|
||||||
description = '''
|
description = '''
|
||||||
JetNews
|
This workload uses the JetNews sample app to run a set of UiAutomation
|
||||||
|
tests, with the goal of gathering frame metrics and calculating jank
|
||||||
|
frame percentages.
|
||||||
|
|
||||||
|
It uses two APK's, the JetNews app itself (modified to contain more posts)
|
||||||
|
and the UiAutomation tests that interact with the app.
|
||||||
|
|
||||||
|
There are 3 available tests, two in portrait mode and 1 in landscape mode.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
_OUTPUT_SECTION_REGEX = re.compile(
|
||||||
|
r'(\s*INSTRUMENTATION_STATUS: gfx-[\w-]+=[-+\d.]+\n)+'
|
||||||
|
r'\s*INSTRUMENTATION_STATUS_CODE: (?P<code>[-+\d]+)\n?', re.M)
|
||||||
|
_OUTPUT_GFXINFO_REGEX = re.compile(
|
||||||
|
r'INSTRUMENTATION_STATUS: (?P<name>[\w-]+)=(?P<value>[-+\d.]+)')
|
||||||
|
|
||||||
default_test_strings = [
|
default_test_strings = [
|
||||||
'PortraitVerticalTest',
|
'PortraitVerticalTest',
|
||||||
'PortraitHorizontalTest',
|
'PortraitHorizontalTest',
|
||||||
@ -38,25 +53,20 @@ class Jetnews(ApkUiautoWorkload):
|
|||||||
tests are PortraitVerticalTest, LandscapeVerticalTest and
|
tests are PortraitVerticalTest, LandscapeVerticalTest and
|
||||||
PortraitHorizontalTest. If none are specified, the default
|
PortraitHorizontalTest. If none are specified, the default
|
||||||
is to run all of them.
|
is to run all of them.
|
||||||
""", default=default_test_strings),
|
""", default=default_test_strings,
|
||||||
|
constraint=lambda x: all(v in ['PortraitVerticalTest', 'PortraitHorizontalTest', 'LandscapeVerticalTest'] for v in x)),
|
||||||
Parameter('flingspeed', kind=int,
|
Parameter('flingspeed', kind=int,
|
||||||
description="""
|
description="""
|
||||||
Default fling speed for the tests. The default is 5000 and
|
Default fling speed for the tests. The default is 5000 and
|
||||||
the minimum value is 1000.
|
the minimum value is 1000.
|
||||||
""", default=5000),
|
""", default=5000, constraint=lambda x: x >= 1000),
|
||||||
Parameter('repeat', kind=int,
|
Parameter('repeat', kind=int,
|
||||||
description="""
|
description="""
|
||||||
The number of times the tests should be repeated. The default
|
The number of times the tests should be repeated. The default
|
||||||
is 1.
|
is 1.
|
||||||
""", default=1)
|
""", default=1, constraint=lambda x: x > 0)
|
||||||
]
|
]
|
||||||
|
|
||||||
_OUTPUT_SECTION_REGEX = re.compile(
|
|
||||||
r'(\s*INSTRUMENTATION_STATUS: gfx-[\w-]+=[-+\d.]+\n)+'
|
|
||||||
r'\s*INSTRUMENTATION_STATUS_CODE: (?P<code>[-+\d]+)\n?', re.M)
|
|
||||||
_OUTPUT_GFXINFO_REGEX = re.compile(
|
|
||||||
r'INSTRUMENTATION_STATUS: (?P<name>[\w-]+)=(?P<value>[-+\d.]+)')
|
|
||||||
|
|
||||||
def __init__(self, target, **kwargs):
|
def __init__(self, target, **kwargs):
|
||||||
super(Jetnews, self).__init__(target, **kwargs)
|
super(Jetnews, self).__init__(target, **kwargs)
|
||||||
# This test uses the androidx library.
|
# This test uses the androidx library.
|
||||||
|
@ -8,7 +8,6 @@ kotlin {
|
|||||||
jvmToolchain(17)
|
jvmToolchain(17)
|
||||||
}
|
}
|
||||||
|
|
||||||
//apply plugin: 'com.android.application'
|
|
||||||
def packageName = "com.arm.wa.uiauto.jetnews"
|
def packageName = "com.arm.wa.uiauto.jetnews"
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2014-2024 ARM Limited
|
/* Copyright 2024 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -26,7 +26,7 @@ import com.arm.wa.uiauto.UiAutoUtils;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
// Dummy workload for jetnews. We need to use JankTestBasem but we
|
// Dummy workload for jetnews. We need to use the JankTestBase class but we
|
||||||
// can't inherit from that class as we already inherit BaseUiAutomation.
|
// can't inherit from that class as we already inherit BaseUiAutomation.
|
||||||
// Therefore we have another class (UiAutomationJankTests) that uses
|
// Therefore we have another class (UiAutomationJankTests) that uses
|
||||||
// this class instead.
|
// this class instead.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2014-2024 ARM Limited
|
/* Copyright 2024 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user