public class PythonTest extends AbstractBuildRuleWithDeclaredAndExtraDeps implements TestRule, HasRuntimeDeps, ExternalTestRunnerRule, BinaryBuildRule
TestRule.TestReportingCallbackNOOP_REPORTING_CALLBACK| Modifier and Type | Method and Description |
|---|---|
static PythonTest |
from(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams params,
BuildRuleResolver ruleResolver,
java.util.function.Function<BuildRuleResolver,com.google.common.collect.ImmutableMap<String,Arg>> env,
PythonBinary binary,
com.google.common.collect.ImmutableSet<String> labels,
com.google.common.collect.ImmutableList<Pair<Float,com.google.common.collect.ImmutableSet<Path>>> neededCoverage,
com.google.common.collect.ImmutableSet<SourcePath> additionalCoverageTargets,
Optional<Long> testRuleTimeoutMs,
com.google.common.collect.ImmutableSet<String> contacts) |
protected com.google.common.collect.ImmutableSet<SourcePath> |
getAdditionalCoverageTargets() |
protected PythonBinary |
getBinary() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
com.google.common.collect.ImmutableSet<String> |
getContacts() |
Tool |
getExecutableCommand(OutputLabel outputLabel)
Command to execute the output of this rule.
|
ExternalTestSpec |
getExternalTestRunnerSpec(ExecutionContext executionContext,
TestRunningOptions testRunningOptions,
BuildContext buildContext) |
com.google.common.collect.ImmutableSet<String> |
getLabels() |
Path |
getPathToTestOutputDirectory() |
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToOutput() |
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() |
void |
updateBuildRuleResolver(BuildRuleResolver ruleResolver)
Updates the BuildRuleResolver and associated objects for this build rule.
|
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDepsequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitonPreTestcompareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toStringgetDependencies, getSourcePathOutputsgetTypepublic static PythonTest from(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params, BuildRuleResolver ruleResolver, java.util.function.Function<BuildRuleResolver,com.google.common.collect.ImmutableMap<String,Arg>> env, PythonBinary binary, com.google.common.collect.ImmutableSet<String> labels, com.google.common.collect.ImmutableList<Pair<Float,com.google.common.collect.ImmutableSet<Path>>> neededCoverage, com.google.common.collect.ImmutableSet<SourcePath> additionalCoverageTargets, Optional<Long> testRuleTimeoutMs, com.google.common.collect.ImmutableSet<String> contacts)
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRulepublic SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulepublic com.google.common.collect.ImmutableList<Step> runTests(ExecutionContext executionContext, TestRunningOptions options, BuildContext buildContext, TestRule.TestReportingCallback testReportingCallback)
TestRuleNote: 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 com.google.common.collect.ImmutableSet<String> getContacts()
getContacts in interface TestRulepublic Path getPathToTestOutputDirectory()
getPathToTestOutputDirectory in interface TestRulepublic com.google.common.collect.ImmutableSet<String> getLabels()
public Callable<TestResults> interpretTestResults(ExecutionContext executionContext, SourcePathResolverAdapter pathResolver, boolean isUsingTestSelectors)
interpretTestResults in interface TestRulepublic boolean runTestSeparately()
runTestSeparately in interface TestRulepublic java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDepspublic boolean supportsStreamingTests()
supportsStreamingTests in interface TestRulerunTests() on this rule invokes the callbacks in testReportingCallback as the tests run, false otherwise.protected PythonBinary getBinary()
protected com.google.common.collect.ImmutableSet<SourcePath> getAdditionalCoverageTargets()
public Tool getExecutableCommand(OutputLabel outputLabel)
BinaryBuildRulegetExecutableCommand in interface BinaryBuildRuleoutputLabel - associated with the executablepublic ExternalTestSpec getExternalTestRunnerSpec(ExecutionContext executionContext, TestRunningOptions testRunningOptions, BuildContext buildContext)
getExternalTestRunnerSpec in interface ExternalTestRunnerRulepublic void updateBuildRuleResolver(BuildRuleResolver ruleResolver)
BuildRuleBuild rules sometimes hold field references to build rule resolvers. If this build rule is to be cached, it must update its BuildRuleResolver when a new action graph is constructed to avoid leaking the entire action graph it was originally associated with.
updateBuildRuleResolver in interface BuildRuleupdateBuildRuleResolver in class AbstractBuildRule