Skip to content

Commit

Permalink
Rename .bazelignore file in test data of ManagedDirectoriesBlackBoxTe…
Browse files Browse the repository at this point in the history
…st into bazelignore.test to avoid problems with dot-starting name.

PiperOrigin-RevId: 247384048
  • Loading branch information
Googler authored and copybara-github committed May 9, 2019
1 parent 384fc0b commit 04bab36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ java_test(
timeout = "moderate",
srcs = ["manageddirs/ManagedDirectoriesBlackBoxTest.java"],
resources = [
"manageddirs/.bazelignore",
"manageddirs/BUILD.test",
"manageddirs/WORKSPACE.test",
"manageddirs/bazelignore.test",
"manageddirs/package.json",
"manageddirs/test_rule.bzl",
"manageddirs/use_node_modules.bzl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static com.google.common.truth.Truth.assertThat;

import com.google.common.collect.Lists;
import com.google.devtools.build.lib.blackbox.framework.BuilderRunner;
import com.google.devtools.build.lib.blackbox.framework.PathUtils;
import com.google.devtools.build.lib.blackbox.framework.ProcessResult;
Expand All @@ -32,14 +31,6 @@

/** Tests for managed directories. */
public class ManagedDirectoriesBlackBoxTest extends AbstractBlackBoxTest {
private static final List<String> FILES =
Lists.newArrayList(
"BUILD.test",
"WORKSPACE.test",
".bazelignore",
"package.json",
"test_rule.bzl",
"use_node_modules.bzl");
private Random random;
private Integer currentDebugId;

Expand Down Expand Up @@ -341,14 +332,19 @@ public void testRepositoryOverrideChangeToConflictWithManagedDirectories() throw
}

private void generateProject() throws IOException {
for (String fileName : FILES) {
String text = ResourceFileLoader.loadResource(ManagedDirectoriesBlackBoxTest.class, fileName);
assertThat(text).isNotNull();
assertThat(text).isNotEmpty();
fileName =
fileName.endsWith(".test") ? fileName.substring(0, fileName.length() - 5) : fileName;
context().write(fileName, text);
}
writeProjectFile("BUILD.test", "BUILD");
writeProjectFile("WORKSPACE.test", "WORKSPACE");
writeProjectFile("bazelignore.test", ".bazelignore");
writeProjectFile("package.json", "package.json");
writeProjectFile("test_rule.bzl", "test_rule.bzl");
writeProjectFile("use_node_modules.bzl", "use_node_modules.bzl");
}

private void writeProjectFile(String oldName, String newName) throws IOException {
String text = ResourceFileLoader.loadResource(ManagedDirectoriesBlackBoxTest.class, oldName);
assertThat(text).isNotNull();
assertThat(text).isNotEmpty();
context().write(newName, text);
}

private void checkProjectFiles() throws IOException {
Expand Down

0 comments on commit 04bab36

Please sign in to comment.