• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4"""Utility methods for Skia Gold functionality unittests."""
5
6import argparse
7import collections
8import typing
9from typing import Optional
10
11_SkiaGoldArgs = collections.namedtuple('_SkiaGoldArgs', [
12    'local_pixel_tests',
13    'no_luci_auth',
14    'service_account',
15    'code_review_system',
16    'continuous_integration_system',
17    'git_revision',
18    'gerrit_issue',
19    'gerrit_patchset',
20    'buildbucket_id',
21    'bypass_skia_gold_functionality',
22    'skia_gold_local_png_write_directory',
23])
24
25
26def createSkiaGoldArgs(local_pixel_tests: Optional[bool] = None,
27                       no_luci_auth: Optional[bool] = None,
28                       service_account: Optional[str] = None,
29                       code_review_system: Optional[str] = None,
30                       continuous_integration_system: Optional[str] = None,
31                       git_revision: Optional[str] = None,
32                       gerrit_issue: Optional[int] = None,
33                       gerrit_patchset: Optional[int] = None,
34                       buildbucket_id: Optional[int] = None,
35                       bypass_skia_gold_functionality: Optional[bool] = None,
36                       skia_gold_local_png_write_directory: Optional[str] = None
37                       ) -> argparse.Namespace:
38  return typing.cast(
39      argparse.Namespace,
40      _SkiaGoldArgs(local_pixel_tests, no_luci_auth, service_account,
41                    code_review_system, continuous_integration_system,
42                    git_revision, gerrit_issue, gerrit_patchset, buildbucket_id,
43                    bypass_skia_gold_functionality,
44                    skia_gold_local_png_write_directory))
45