public class RuleAnalysisLegacyTestBuildRuleView extends RuleAnalysisLegacyBinaryBuildRuleView implements TestRule, ExternalTestRunnerRule
RuleAnalysisLegacyBuildRuleView
, but also implements TestRule
so that this
rule can be run by buck test
TestRule.TestReportingCallback
NOOP_REPORTING_CALLBACK
Constructor and Description |
---|
RuleAnalysisLegacyTestBuildRuleView(String type,
BuildTarget buildTarget,
Optional<Action> action,
BuildRuleResolver ruleResolver,
ProjectFilesystem projectFilesystem,
ProviderInfoCollection providerInfoCollection)
Create an instance of
RuleAnalysisLegacyTestBuildRuleView |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<String> |
getContacts() |
ExternalTestSpec |
getExternalTestRunnerSpec(ExecutionContext executionContext,
TestRunningOptions testRunningOptions,
BuildContext buildContext) |
com.google.common.collect.ImmutableSet<String> |
getLabels() |
Path |
getPathToTestOutputDirectory() |
Callable<TestResults> |
interpretTestResults(ExecutionContext executionContext,
SourcePathResolverAdapter pathResolver,
boolean isUsingTestSelectors) |
com.google.common.collect.ImmutableList<Step> |
runTests(ExecutionContext executionContext,
TestRunningOptions options,
BuildContext buildContext,
TestRule.TestReportingCallback testReportingCallback)
Returns the commands required to run the tests.
|
boolean |
runTestSeparately() |
boolean |
supportsStreamingTests() |
getExecutableCommand
getBuildDeps, getBuildSteps, getOutputLabels, getProviderInfos, getSourcePathToOutput, getSourcePathToOutput, getType, isCacheable, updateBuildRuleResolver
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
onPreTest
compareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, getSourcePathToOutput, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
inputBasedRuleKeyIsEnabled, isSupported
public RuleAnalysisLegacyTestBuildRuleView(String type, BuildTarget buildTarget, Optional<Action> action, BuildRuleResolver ruleResolver, ProjectFilesystem projectFilesystem, ProviderInfoCollection providerInfoCollection)
RuleAnalysisLegacyTestBuildRuleView
type
- the type of this BuildRule
buildTarget
- the BuildTarget
of this analysis ruleaction
- the action of the result for which we want to provide the BuildRule
viewruleResolver
- the current BuildRuleResolver
to query dependent rulesprojectFilesystem
- the filesystemproviderInfoCollection
- the providers returned by this build targetIllegalStateException
- if providerInfoCollection
does not contain an instance of
both RunInfo
and TestInfo
public com.google.common.collect.ImmutableList<Step> runTests(ExecutionContext executionContext, TestRunningOptions options, BuildContext buildContext, TestRule.TestReportingCallback testReportingCallback)
TestRule
Note: This method may be run without BuildEngine.build(com.facebook.buck.core.build.engine.BuildEngineBuildContext,
ExecutionContext, BuildRule)
having been run. This happens if the user has built [and ran] the
test previously and then re-runs it using the --debug
flag.
public Callable<TestResults> interpretTestResults(ExecutionContext executionContext, SourcePathResolverAdapter pathResolver, boolean isUsingTestSelectors)
interpretTestResults
in interface TestRule
public com.google.common.collect.ImmutableSet<String> getLabels()
public com.google.common.collect.ImmutableSet<String> getContacts()
getContacts
in interface TestRule
public Path getPathToTestOutputDirectory()
getPathToTestOutputDirectory
in interface TestRule
public boolean runTestSeparately()
runTestSeparately
in interface TestRule
public boolean supportsStreamingTests()
supportsStreamingTests
in interface TestRule
runTests()
on this rule invokes the callbacks in testReportingCallback
as the tests run, false otherwise.public ExternalTestSpec getExternalTestRunnerSpec(ExecutionContext executionContext, TestRunningOptions testRunningOptions, BuildContext buildContext)
getExternalTestRunnerSpec
in interface ExternalTestRunnerRule