Skip to content

analysis_test expect_failure does not work for rules with outputs #134

Closed

Description

@c-parsons

It looks as if an analysis test depending on a rule with an implicit rule output, such as the example:

custom_rule = rule(
    implementation = custom_rule_impl,
    outputs = {'my_output': '%{name}.txt'})

doesn't always behave nicely with expect_failures = True.

Specifically, if the custom_rule target fails before an action is registered to output my_output, a stack trace is thrown by Bazel.

at com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment.verifyGeneratedArtifactHaveActions(CachingAnalysisEnvironment.java:144)
	at com.google.devtools.build.lib.analysis.CachingAnalysisEnvironment.disable(CachingAnalysisEnvironment.java:107)
	at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:856)
	at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:358)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:440)
	... 6 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions