Skip to content

Commit

Permalink
[dPWA Testing] Upgrade test script to support multiple arguments
Browse files Browse the repository at this point in the history
This patch updates the dPWA testing framework script to allow for
multiple arguments in the CUJ actions.

Behavior changes:
* Actions not specify a list of argument (or enumeration) types.
* These types are defined in a new sheet titled "Enums" with values.
* Parameterized actions have a new format to specify the output action,
  where it uses bash argument syntax ($1 for the first arg, $2 for the
  second, etc) to forward arguments of the parameterized action to the
  output actions.

This change does not affect the tests themselves or coverage, and
should be a no-op for test generation.

Future changes:
* After this change has landed, the current cpp method call of
  MethodName("Argument") can change to be MethodName(ArgType::kArg),
  providing a much better coding interface to work with.

Bug: 1310428
Change-Id: I2d6271e08ad2d19b2d4c2dd6ac87df9fe4c8b02d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3553829
Reviewed-by: Phillis Tang <phillis@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986982}
  • Loading branch information
dmurph authored and Chromium LUCI CQ committed Mar 30, 2022
1 parent 8d13f17 commit d8a8ce9
Show file tree
Hide file tree
Showing 37 changed files with 1,234 additions and 933 deletions.
105 changes: 50 additions & 55 deletions chrome/test/webapps/coverage/coverage_cros.tsv

Large diffs are not rendered by default.

208 changes: 130 additions & 78 deletions chrome/test/webapps/coverage/coverage_linux.tsv

Large diffs are not rendered by default.

208 changes: 130 additions & 78 deletions chrome/test/webapps/coverage/coverage_mac.tsv

Large diffs are not rendered by default.

208 changes: 130 additions & 78 deletions chrome/test/webapps/coverage/coverage_win.tsv

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions chrome/test/webapps/data/actions.tsv

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions chrome/test/webapps/data/coverage_required.tsv

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions chrome/test/webapps/data/enums.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Enum Name Values (* = default)
Site SiteA* SiteB SiteC SiteAFoo SiteABar
InstallableSite SiteA* SiteB SiteAFoo SiteABar
Title SiteA SiteAUpdated
Color Red Green
ProfileClient Client2* Client1
UserDisplayMode Standalone Browser
HasShortcuts Shortcuts NoShortcuts
11 changes: 7 additions & 4 deletions chrome/test/webapps/download_data_from_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
SHEET_URL = 'https://docs.google.com/spreadsheets/u/1/d/1d3iAOAnojp4_WrPky9exz1-mjkeulOJVUav5QYG99MQ/export'
UNPROCESSED_REQUIRED_COVERAGE_TESTS_TAB = '2008870403'
ACTIONS_TAB = '1864725389'
ENUMS_TAB = '1470912273'
DATA_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')


def main():
urllib.request.urlretrieve(
f'{SHEET_URL}?gid={UNPROCESSED_REQUIRED_COVERAGE_TESTS_TAB}&format=csv',
os.path.join(DATA_DIR, 'coverage_required.csv'))
urllib.request.urlretrieve(f'{SHEET_URL}?gid={ACTIONS_TAB}&format=csv',
os.path.join(DATA_DIR, 'actions.csv'))
f'{SHEET_URL}?gid={UNPROCESSED_REQUIRED_COVERAGE_TESTS_TAB}&format=tsv',
os.path.join(DATA_DIR, 'coverage_required.tsv'))
urllib.request.urlretrieve(f'{SHEET_URL}?gid={ACTIONS_TAB}&format=tsv',
os.path.join(DATA_DIR, 'actions.tsv'))
urllib.request.urlretrieve(f'{SHEET_URL}?gid={ENUMS_TAB}&format=tsv',
os.path.join(DATA_DIR, 'enums.tsv'))


if __name__ == '__main__':
Expand Down
21 changes: 0 additions & 21 deletions chrome/test/webapps/download_data_from_sheet.sh

This file was deleted.

0 comments on commit d8a8ce9

Please sign in to comment.