Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete BaselineCoverageResult #24488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/main/java/com/google/devtools/build/lib/analysis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ java_library(
":test/analysis_failure",
":test/analysis_failure_info",
":test/analysis_test_result_info",
":test/baseline_coverage_result",
":test/coverage_report_action_factory",
":test/execution_info",
":test/instrumented_files_info",
Expand Down Expand Up @@ -343,7 +342,6 @@ java_library(
":test/analysis_failure_info",
":test/analysis_failure_propagation_exception",
":test/analysis_test_result_info",
":test/baseline_coverage_result",
":test/coverage_configuration",
":test/execution_info",
":test/instrumented_files_info",
Expand Down Expand Up @@ -2737,16 +2735,6 @@ java_library(
],
)

java_library(
name = "test/baseline_coverage_result",
srcs = ["test/BaselineCoverageResult.java"],
deps = [
"//src/main/java/com/google/devtools/build/lib/actions:artifacts",
"//src/main/java/com/google/devtools/build/lib/events",
"//third_party:guava",
],
)

java_library(
name = "test/coverage_configuration",
srcs = ["test/CoverageConfiguration.java"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ArtifactExpander;
import com.google.devtools.build.lib.actions.Artifacts;
import com.google.devtools.build.lib.actions.NotifyOnActionCacheHit;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.actions.AbstractFileWriteAction;
import com.google.devtools.build.lib.analysis.actions.DeterministicWriter;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import com.google.devtools.build.lib.util.Fingerprint;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.io.PrintWriter;
Expand All @@ -39,8 +36,7 @@
/** Generates baseline (empty) coverage for the given non-test target. */
@VisibleForTesting
@Immutable
public final class BaselineCoverageAction extends AbstractFileWriteAction
implements NotifyOnActionCacheHit {
public final class BaselineCoverageAction extends AbstractFileWriteAction {
private final NestedSet<Artifact> instrumentedFiles;

private BaselineCoverageAction(
Expand Down Expand Up @@ -76,24 +72,6 @@ public DeterministicWriter newDeterministicWriter(ActionExecutionContext ctx) {
};
}

@Override
protected void afterWrite(ActionExecutionContext actionExecutionContext) {
notifyAboutBaselineCoverage(actionExecutionContext.getEventHandler());
}

@Override
public boolean actionCacheHit(ActionCachedContext context) {
notifyAboutBaselineCoverage(context.getEventHandler());
return true;
}

/** Notifies interested parties about new baseline coverage data. */
private void notifyAboutBaselineCoverage(ExtendedEventHandler eventHandler) {
Artifact output = getPrimaryOutput();
String ownerString = Label.print(getOwner().getLabel());
eventHandler.post(new BaselineCoverageResult(output, ownerString));
}

static BaselineCoverageAction create(
RuleContext ruleContext, NestedSet<Artifact> instrumentedFiles) {
// Baseline coverage artifacts will still go into "testlogs" directory.
Expand Down

This file was deleted.