Skip to content

Commit

Permalink
Enable more tests.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 397550221
  • Loading branch information
MarkDacek authored and copybara-github committed Sep 19, 2021
1 parent ba64b03 commit bb9a488
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/test/java/com/google/devtools/build/lib/buildtool/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,19 @@ java_test(
java_test(
name = "UnusedInputsFailureIntegrationTest",
srcs = ["UnusedInputsFailureIntegrationTest.java"],
tags = ["manual"],
tags = [
"no_windows",
],
deps = [
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/skyframe:detailed_exceptions",
"//src/main/java/com/google/devtools/build/lib/util/io",
"//src/main/java/com/google/devtools/build/lib/vfs",
"//src/main/java/com/google/devtools/build/lib/vfs:pathfragment",
"//src/main/protobuf:failure_details_java_proto",
"//src/test/java/com/google/devtools/build/lib/analysis/util",
"//src/test/java/com/google/devtools/build/lib/buildtool/util",
"//src/test/java/com/google/devtools/build/lib/packages:testutil",
"//third_party:junit4",
"//third_party:truth",
"@com_google_testparameterinjector//:testparameterinjector",
Expand Down Expand Up @@ -535,6 +539,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/analysis:configured_target",
"//src/main/java/com/google/devtools/build/lib/util/io",
"//src/main/java/com/google/devtools/build/lib/util/io:out-err",
"//src/test/java/com/google/devtools/build/lib/analysis/util",
"//src/test/java/com/google/devtools/build/lib/buildtool/util",
"//third_party:guava",
"//third_party:junit4",
Expand All @@ -545,14 +550,17 @@ java_library(
java_test(
name = "TargetCompleteEventKeepsMinimalMetadataTest",
srcs = ["TargetCompleteEventKeepsMinimalMetadataTest.java"],
tags = ["manual"],
tags = [
"no_windows",
],
deps = [
"//src/main/java/com/google/devtools/build/lib:runtime",
"//src/main/java/com/google/devtools/build/lib/actions:artifacts",
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
"//src/main/java/com/google/devtools/build/lib/analysis:configured_target",
"//src/main/java/com/google/devtools/build/lib/cmdline",
"//src/main/java/com/google/devtools/build/lib/collect/nestedset",
"//src/test/java/com/google/devtools/build/lib/analysis/util",
"//src/test/java/com/google/devtools/build/lib/buildtool/util",
"//third_party:guava",
"//third_party:junit4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
import com.google.devtools.build.lib.analysis.OutputGroupInfo;
import com.google.devtools.build.lib.analysis.TargetCompleteEvent;
import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget;
import com.google.devtools.build.lib.analysis.util.AnalysisMock;
import com.google.devtools.build.lib.buildtool.util.BuildIntegrationTestCase;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import java.util.Collection;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand All @@ -38,6 +40,11 @@
@RunWith(JUnit4.class)
public class TargetCompleteEventKeepsMinimalMetadataTest extends BuildIntegrationTestCase {

@Before
public void stageEmbeddedTools() throws Exception {
AnalysisMock.get().setupMockToolsRepository(mockToolsConfig);
}

@Test
public void artifactsNotRetained() throws Exception {
write(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.BuildFailedException;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
import com.google.devtools.build.lib.analysis.util.AnalysisMock;
import com.google.devtools.build.lib.buildtool.util.BuildIntegrationTestCase;
import com.google.devtools.build.lib.util.io.OutErr;
import com.google.devtools.build.lib.util.io.RecordingOutErr;
Expand Down Expand Up @@ -48,6 +49,11 @@ public final void addJobNumberOption() throws Exception {
addOptions("--jobs", "" + numJobs());
}

@Before
public void stageEmbeddedTools() throws Exception {
AnalysisMock.get().setupMockToolsRepository(mockToolsConfig);
}

private void assertSameConfiguredTarget(String label) throws Exception {
assertThat(getOnlyElement(getResult().getSuccessfulTargets()))
.isSameInstanceAs(getConfiguredTarget(label));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
import static org.junit.Assert.assertThrows;

import com.google.devtools.build.lib.actions.BuildFailedException;
import com.google.devtools.build.lib.analysis.util.AnalysisMock;
import com.google.devtools.build.lib.buildtool.util.BuildIntegrationTestCase;
import com.google.devtools.build.lib.packages.util.MockGenruleSupport;
import com.google.devtools.build.lib.server.FailureDetails;
import com.google.devtools.build.lib.skyframe.DetailedException;
import com.google.devtools.build.lib.util.io.RecordingOutErr;
Expand All @@ -36,6 +38,12 @@ public final class UnusedInputsFailureIntegrationTest extends BuildIntegrationTe

@TestParameter private boolean keepGoing;

@Before
public void stageEmbeddedTools() throws Exception {
AnalysisMock.get().setupMockToolsRepository(mockToolsConfig);
MockGenruleSupport.setup(mockToolsConfig);
}

@Before
public void setOptions() {
addOptions("--keep_going=" + keepGoing);
Expand Down

0 comments on commit bb9a488

Please sign in to comment.