1// Copyright 2021 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 5syntax = "proto3"; 6 7package chromiumos.test.plan; 8 9option go_package = "go.chromium.org/chromiumos/config/go/test/plan"; 10 11import "chromiumos/test/api/test_suite.proto"; 12 13// Describes the test cases that run when a given set of files are changed. 14// 15// This message is intended to be specified as text proto in a DIR_METADATA file 16// in the source tree, and should be concise enough Starlark, or another config 17// generation tool, is not needed. 18// 19// NEXT ID: 15 20message SourceTestPlan { 21 reserved 1; 22 23 // Paths that will trigger the SourceTestPlan. 24 // 25 // Must be a repo-absolute ChromeOS path. For example, 26 // “arc/adbd/.*” for 27 // https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/arc/adbd. 28 // 29 // Paths can only match files in the subtree of the DIR_METADATA file. 30 // For example, paths specified in "a/b/DIR_METADATA" must start with "a/b/". 31 // 32 // Patterns use Google Re2 syntax. The comparison is a full match. The pattern 33 // is implicitly anchored with ^ and $, so there is no need to add them. 34 // 35 // If path_regexp is not specified, it is implied to be all files in 36 // the directory of the DIR_METADATA file and all files in subdirectories. 37 // 38 // If a file is matched by both path_regexp and path_regexp_exclude, it is 39 // excluded. 40 repeated string path_regexps = 2; 41 repeated string path_regexp_excludes = 3; 42 43 // A Starlark file that will be evaluated to generate HW/VMTestPlan protos. 44 // 45 // The Starlark file must output a list of HW/VMTestPlan protos based on an 46 // input BuildMetadataList and FlatConfigList. 47 message TestPlanStarlarkFile { 48 // Gitiles hostname, e.g. "chromium.googlesource.com". 49 string host = 1; 50 51 // Repository name on the host, e.g. "chromium/src". 52 string project = 2; 53 54 // Absolute path within the repo to the Starlark file. Regexes are not 55 // allowed. 56 string path = 3; 57 58 // Fields that will be made available to the Starlark file via interpreter 59 // builtins. Note that specifying these fields here does NOT automatically 60 // mean the HW/VMTestPlan protos generated will use them in all plans. 61 // 62 // Specifying these fields on a Starlark file that doesn't use them will 63 // cause `test_plan validate` to fail. 64 // 65 // Unless otherwise noted, these parameters are made available in the 66 // Starlark interpreter with function calls named 67 // `testplan.get_<field_name>`; for example, `testplan.get_tag_criteria`. 68 message TemplateParameters { 69 // TestCaseTagCriteria that will be made available to the Starlark file. 70 // Intended for the case where many different DIR_METADATA files want to 71 // run the same plan but with different tag criteria. 72 chromiumos.test.api.TestSuite.TestCaseTagCriteria tag_criteria = 1; 73 74 // Suite name that will be made available to the Starlark file. Intended 75 // to prevent suite name collisions when multiple DIR_METADATA files 76 // reference the same templated Starlark file with different tag_criteria. 77 string suite_name = 2; 78 79 // Program name that will be made available to the Starlark file. 80 // Generally this will be passed to the v1_compatible_hw_test_plan and 81 // v1_compatible_vm_test_plan Starlark functions, but the Starlark file is 82 // free to use the name arbitrarily. 83 string program = 3; 84 } 85 86 TemplateParameters template_parameters = 4; 87 } 88 89 // Starlark files to evaluate to generate HW/VMTestPlan protos. 90 repeated TestPlanStarlarkFile test_plan_starlark_files = 15; 91 92 reserved 4 to 14; 93} 94