1# Copyright 2024 The ChromiumOS Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""Contains all the pre-upload and pre-commit validation checks for SuiteSets""" 6 7# [VPYTHON:BEGIN] 8# python_version: "3.11" 9# wheel: < 10# name: "infra/python/wheels/protobuf-py3" 11# version: "version:4.21.9" 12# > 13# [VPYTHON:END] 14 15import argparse 16import pathlib 17import sys 18 19 20sys.path.insert( 21 1, 22 str( 23 pathlib.Path(__file__).parent.resolve() 24 / "../../../../platform/dev/src/chromiumos/test/python" 25 ), 26) 27 28from src.tools import ( # noqa: E402 pylint: disable=wrong-import-position,no-name-in-module 29 suite_set_utils, 30) 31 32 33def main(args): 34 """Entry point.""" 35 suite_sets = suite_set_utils.load_suite_sets([args.suite_set_file]) 36 suites = suite_set_utils.load_suites([args.suite_file]) 37 suite_set_utils.validate_centralized_suites(suite_sets + suites) 38 39 40if __name__ == "__main__": 41 parser = argparse.ArgumentParser( 42 prog="Validate SuiteSets", 43 description=( 44 "Validates the given Suite/SuiteSet files are well formed." 45 ), 46 ) 47 parser.add_argument( 48 "--suite_set_file", 49 help="Path to SuiteSet file to validate", 50 required=True, 51 ) 52 parser.add_argument( 53 "--suite_file", help="Path to Suite file to validate", required=True 54 ) 55 main(parser.parse_args()) 56