Class TestInfo

  • All Implemented Interfaces:
    ProviderInfo<TestInfo>, SkylarkProviderInfo, com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable, com.google.devtools.build.lib.skylarkinterface.SkylarkValue, com.google.devtools.build.lib.syntax.ClassObject
    Direct Known Subclasses:
    ImmutableTestInfo

    public abstract class TestInfo
    extends BuiltInProviderInfo<TestInfo>
    Provider that passes along information needed by the buck test runner / external test runners
    • Constructor Detail

      • TestInfo

        public TestInfo()
    • Method Detail

      • testName

        public abstract String testName()
        Returns:
        the type of test. This should generally be the rule name
      • testCaseName

        public abstract String testCaseName()
        Returns:
        the name of the test case
      • labels

        public abstract com.google.common.collect.ImmutableSet<String> labels()
      • contacts

        public abstract com.google.common.collect.ImmutableSet<String> contacts()
      • timeoutMs

        public abstract Object timeoutMs()
      • runTestsSeparately

        public abstract boolean runTestsSeparately()
      • type

        public abstract String type()
        Returns:
        the 'type' to pass to the external test runner
      • typedTimeoutMs

        @Lazy
        public Optional<Long> typedTimeoutMs()
      • of

        public static TestInfo of​(String testName,
                                  String testCaseName,
                                  com.google.common.collect.ImmutableSet<String> labels,
                                  com.google.common.collect.ImmutableSet<String> contacts,
                                  Optional<Long> timeoutMs,
                                  boolean runTestsSeparately,
                                  String type)
        Create an instance from native values
      • instantiateFromSkylark

        public static TestInfo instantiateFromSkylark​(String testName,
                                                      String testCaseName,
                                                      com.google.devtools.build.lib.syntax.SkylarkList<String> labels,
                                                      com.google.devtools.build.lib.syntax.SkylarkList<String> contacts,
                                                      Object timeoutMs,
                                                      boolean runTestsSeparately,
                                                      String type,
                                                      com.google.devtools.build.lib.events.Location location)
                                               throws com.google.devtools.build.lib.syntax.EvalException
        Create an instance from skylark objects
        Throws:
        com.google.devtools.build.lib.syntax.EvalException