1// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package adservices.longevity.profile.concurrent;
18
19option java_package = "android.adservices.test.longevity.concurrent.proto";
20option java_multiple_files = true;
21
22message Configuration {
23  // Schedule used to run the profile.
24  enum Schedule {
25    TIMESTAMPED = 1;
26    INDEXED = 2;
27    SEQUENTIAL = 3;
28  }
29  optional Schedule schedule = 1 [default = TIMESTAMPED];
30
31  // Information for each scenario.
32  message Scenario {
33    oneof schedule {
34      string at = 1;    // A timestamp (HH:MM:SS) for when to run the scenario.
35      int32 index = 2;  // An index for the relative order of the scenario.
36    }
37
38    message Journey {
39      // Reference to the CUJ (<package>.<class>).
40      optional string journey = 1;
41
42      // Optional. Test method name which we want to run. If the test class has single @Test
43      // annotated method , this is optional. If multiple @Test annotated methods present, it is
44      // must to specify the test method name.
45      optional string methodName = 2;
46
47      // Extra arguments to pass to the CUJ.
48      message ExtraArg {
49        optional string key = 1;
50        optional string value = 2;
51      }
52      repeated ExtraArg extras = 3;
53    }
54
55    // Journeys which we want to execute concurrently
56    repeated Journey journeys = 3;
57
58    // For app-based scenarios, whether to stay in the app after the tested
59    // action is performed.
60    enum AfterTest {
61      STAY_IN_APP = 1;
62      EXIT = 2;
63    }
64    optional AfterTest after_test = 4 [default = EXIT];
65  }
66  repeated Scenario scenarios = 2;
67
68  // Amount of times the whole scenarios will be executed.
69  // For example, scenarios A->B->C with repetitions = 2 will be executed twice
70  // in a row: A->B->C->A->B->C.
71  optional int32 repetitions = 3 [default = 1];
72}
73