public class GoTest extends AbstractBuildRuleWithDeclaredAndExtraDeps implements TestRule, HasRuntimeDeps, ExternalTestRunnerRule, BinaryBuildRule
TestRule.TestReportingCallback
NOOP_REPORTING_CALLBACK
Constructor and Description |
---|
GoTest(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams buildRuleParams,
GoBinary testMain,
com.google.common.collect.ImmutableSet<String> labels,
com.google.common.collect.ImmutableSet<String> contacts,
Optional<Long> testRuleTimeoutMs,
com.google.common.collect.ImmutableMap<String,Arg> env,
boolean runTestsSeparately,
com.google.common.collect.ImmutableSortedSet<SourcePath> resources,
com.facebook.buck.features.go.GoTestCoverStep.Mode coverageMode) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableList<? extends 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() |
protected Path |
getPathToTestExitCode() |
Path |
getPathToTestOutputDirectory() |
protected Path |
getPathToTestResults() |
protected Path |
getPathToTestWorkingDirectory() |
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() |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDeps
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
onPreTest
compareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
public GoTest(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams buildRuleParams, GoBinary testMain, com.google.common.collect.ImmutableSet<String> labels, com.google.common.collect.ImmutableSet<String> contacts, Optional<Long> testRuleTimeoutMs, com.google.common.collect.ImmutableMap<String,Arg> env, boolean runTestsSeparately, com.google.common.collect.ImmutableSortedSet<SourcePath> resources, com.facebook.buck.features.go.GoTestCoverStep.Mode coverageMode)
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 com.google.common.collect.ImmutableList<? extends Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
@Nullable public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
protected Path getPathToTestResults()
protected Path getPathToTestWorkingDirectory()
protected Path getPathToTestExitCode()
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 java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps
in interface HasRuntimeDeps
public ExternalTestSpec getExternalTestRunnerSpec(ExecutionContext executionContext, TestRunningOptions testRunningOptions, BuildContext buildContext)
getExternalTestRunnerSpec
in interface ExternalTestRunnerRule
public Tool getExecutableCommand(OutputLabel outputLabel)
BinaryBuildRule
getExecutableCommand
in interface BinaryBuildRule
outputLabel
- associated with the executable