test_suite.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. // Copyright 2021 Google LLC
  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. syntax = "proto3";
  15. package google.devtools.resultstore.v2;
  16. import "google/devtools/resultstore/v2/common.proto";
  17. import "google/devtools/resultstore/v2/file.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "TestSuiteProto";
  21. option java_package = "com.google.devtools.resultstore.v2";
  22. // The result of running a test suite, as reported in a <testsuite> element of
  23. // an XML log.
  24. message TestSuite {
  25. // The full name of this suite, as reported in the name attribute. For Java
  26. // tests, this is normally the fully qualified class name. Eg.
  27. // "com.google.common.hash.BloomFilterTest".
  28. string suite_name = 1;
  29. // The results of the test cases and test suites contained in this suite,
  30. // as reported in the <testcase> and <testsuite> elements contained within
  31. // this <testsuite>.
  32. repeated Test tests = 2;
  33. // Failures reported in <failure> elements within this <testsuite>.
  34. repeated TestFailure failures = 3;
  35. // Errors reported in <error> elements within this <testsuite>.
  36. repeated TestError errors = 4;
  37. // The timing for the entire TestSuite, as reported by the time attribute.
  38. Timing timing = 6;
  39. // Arbitrary name-value pairs, as reported in custom attributes or in a
  40. // <properties> element within this <testsuite>. Multiple properties are
  41. // allowed with the same key. Properties will be returned in lexicographical
  42. // order by key.
  43. repeated Property properties = 7;
  44. // Files produced by this test suite, as reported by undeclared output
  45. // annotations.
  46. // The file IDs must be unique within this list. Duplicate file IDs will
  47. // result in an error. Files will be returned in lexicographical order by ID.
  48. repeated File files = 8;
  49. }
  50. // The result of running a test case or test suite. JUnit3 TestDecorators are
  51. // represented as a TestSuite with a single test.
  52. message Test {
  53. // Either a TestCase of a TestSuite
  54. oneof test_type {
  55. // When this contains just a single TestCase
  56. TestCase test_case = 1;
  57. // When this contains a TestSuite of test cases.
  58. TestSuite test_suite = 2;
  59. }
  60. }
  61. // The result of running a test case, as reported in a <testcase> element of
  62. // an XML log.
  63. message TestCase {
  64. // The result of running a test case.
  65. enum Result {
  66. // The implicit default enum value. Do not use.
  67. RESULT_UNSPECIFIED = 0;
  68. // Test case ran to completion. Look for failures or errors to determine
  69. // whether it passed, failed, or errored.
  70. COMPLETED = 1;
  71. // Test case started but did not complete because the test harness received
  72. // a signal and decided to stop running tests.
  73. INTERRUPTED = 2;
  74. // Test case was not started because the test harness received a SIGINT or
  75. // timed out.
  76. CANCELLED = 3;
  77. // Test case was not run because the user or process running the test
  78. // specified a filter that excluded this test case.
  79. FILTERED = 4;
  80. // Test case was not run to completion because the test case decided it
  81. // should not be run (eg. due to a failed assumption in a JUnit4 test).
  82. // Per-test setup or tear-down may or may not have run.
  83. SKIPPED = 5;
  84. // The test framework did not run the test case because it was labeled as
  85. // suppressed. Eg. if someone temporarily disables a failing test.
  86. SUPPRESSED = 6;
  87. }
  88. // The name of the test case, as reported in the name attribute. For Java,
  89. // this is normally the method name. Eg. "testBasic".
  90. string case_name = 1;
  91. // The name of the class in which the test case was defined, as reported in
  92. // the classname attribute. For Java, this is normally the fully qualified
  93. // class name. Eg. "com.google.common.hash.BloomFilterTest".
  94. string class_name = 2;
  95. // An enum reported in the result attribute that is used in conjunction with
  96. // failures and errors below to report the outcome.
  97. Result result = 3;
  98. // Failures reported in <failure> elements within this <testcase>.
  99. repeated TestFailure failures = 4;
  100. // Errors reported in <error> elements within this <testcase>.
  101. repeated TestError errors = 5;
  102. // The timing for the TestCase, as reported by the time attribute.
  103. Timing timing = 7;
  104. // Arbitrary name-value pairs, as reported in custom attributes or in a
  105. // <properties> element within this <testcase>. Multiple properties are
  106. // allowed with the same key. Properties will be returned in lexicographical
  107. // order by key.
  108. repeated Property properties = 8;
  109. // Files produced by this test case, as reported by undeclared output
  110. // annotations.
  111. // The file IDs must be unique within this list. Duplicate file IDs will
  112. // result in an error. Files will be returned in lexicographical order by ID.
  113. repeated File files = 9;
  114. }
  115. // Represents a violated assertion, as reported in a <failure> element within a
  116. // <testcase>. Some languages allow assertions to be made without stopping the
  117. // test case when they're violated, leading to multiple TestFailures. For Java,
  118. // multiple TestFailures are used to represent a chained exception.
  119. message TestFailure {
  120. // The exception message reported in the message attribute. Typically short,
  121. // but may be multi-line. Eg. "Expected 'foo' but was 'bar'".
  122. string failure_message = 1;
  123. // The type of the exception being thrown, reported in the type attribute.
  124. // Eg: "org.junit.ComparisonFailure"
  125. string exception_type = 2;
  126. // The stack trace reported as the content of the <failure> element, often in
  127. // a CDATA block. This contains one line for each stack frame, each including
  128. // a method/function name, a class/file name, and a line number. Most recent
  129. // call is usually first, but not for Python stack traces. May contain the
  130. // exception_type and message.
  131. string stack_trace = 3;
  132. // The expected values.
  133. //
  134. // These values can be diffed against the actual values. Often, there is just
  135. // one actual and one expected value. If there is more than one, they should
  136. // be compared as an unordered collection.
  137. repeated string expected = 4;
  138. // The actual values.
  139. //
  140. // These values can be diffed against the expected values. Often, there is
  141. // just one actual and one expected value. If there is more than one, they
  142. // should be compared as an unordered collection.
  143. repeated string actual = 5;
  144. }
  145. // Represents an exception that prevented a test case from completing, as
  146. // reported in an <error> element within a <testcase>. For Java, multiple
  147. // TestErrors are used to represent a chained exception.
  148. message TestError {
  149. // The exception message, as reported in the message attribute. Typically
  150. // short, but may be multi-line. Eg. "argument cannot be null".
  151. string error_message = 1;
  152. // The type of the exception being thrown, reported in the type attribute.
  153. // For Java, this is a fully qualified Throwable class name.
  154. // Eg: "java.lang.IllegalArgumentException"
  155. string exception_type = 2;
  156. // The stack trace reported as the content of the <error> element, often in
  157. // a CDATA block. This contains one line for each stack frame, each including
  158. // a method/function name, a class/file name, and a line number. Most recent
  159. // call is usually first, but not for Python stack traces. May contain the
  160. // exception_type and message.
  161. string stack_trace = 3;
  162. }